-
-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-add the future keywords tests. #561
base: main
Are you sure you want to change the base?
Conversation
The intent of them is *not* to express that an implementation might wish to recognize these keywords. The intent of them is precisely the same as the original intent -- to allow an implementation to test itself for *not* recognizing new keywords. Such an implementation should enable these tests, as it is free to do so, and these tests will help ensure it does not accidentally leak newer keywords backwards in time if it doesn't mean to. All of the previous discussion was strictly centered on not putting these in the required directory. The reason is that all drafts *allow* implementations to add extra keywords. So a compliant implementation may indeed decide it actively *wants* to implement new keywords. Then this file would not help them, and they wouldn't run it. They would presumably love a version of this file that *did* contain all the future assertions as correct for future drafts, and in the future we could provide one. But given no implementations really do do this, at least as far as I'm aware, and given that this version of the file is here and written and more common, it would seem perfectly reasonable to have it and hope for the other version if or when someone wants it. Further discussion is in #383 and later #559. This reverts commit f605fbf.
CC @handrews @karenetheridge let's discuss here so we're not using a closed PR perhaps? |
I am opposed to merging this at this time.
|
Can you elaborate how this conflicts with adding As for the second point, I agree it'd be nice to get to tackling optional, which is why I'd like to get changes merged and out of the way in order to get to it, and especially to illustrate the scenarios we need to support. The notion we'd need to potentially support conflicting optional tests isn't new to me, it's been mentioned in previous issues, but it seems it was non-obvious to others -- In short what new is unclear about this PR that isn't already unclear about existing tests like zeroTerminatedFloats or bignum or others? Would you feel more comfortable with a comment indicating which implementations should run this file? |
Putting this with other "optional" tests might cause some amount of confusion. Maybe we can create a new class of "behavior" tests. For example, in https://cache-tests.fyi/, "behavior" tests are those with grey "+" or "-" symbols, where the cache behavior may legitimately vary depending on the needs or environmental conditions of the cache. |
Is it really necessary to have this merged? We know that this is case to sort out, whether it's checked in or not. If the current state of affairs is too confusing to reach agreement, can we just table this until we've made enough progress to agree on where this ought to go? I generally don't like having PRs and issues hanging around. But perhaps we're better off looking at this as a dependency. |
I certainly would rather do so than keep talking about trivial changes. There's nothing different about these tests than existing optional ones, but I won't keep pushing to get them in. We can come back to them later. |
I'm not sure what this PR is testing. Possible ways how a validator could behave would be:
What does this PR test for when it expects |
I don't believe 1 is spec compliant, but would have to double check we still have language requiring unknown keywords to be ignored. 2 is what this PR was meant to cover, and the fact that 3 is equally spec compliant was why I removed them from required and moved them here (so authors of implementations that want 2 can still run them -- in theory we could offer versions of these for mutually exclusive 2-or-3 behavior and implementers would use whichever they wanted).
Sorry, just to add -- this is just a copy paste error and meant to be all |
@Julian re: 1 -- a validator that has either opt-in or opt-out on that would still be spec-compliant, I think ).
Ah, so that was a bug. But that also implies that this wasn't actually tested on any real implementation ) |
The spec says that implementations MUST ignore unrecognized keywords. This needs to be the default for the implementation. If an implementation does not do this without configuration, then it's not compliant. (So your 1 is not spec-compliant behavior.) An implementation could have a configuration setting that enables a "strict" mode. That would be opt-in. |
It's SHOULD ignore up through 2019-09, and then SHOULD collect as annotations in 2020-12 (and if not, SHOULD or MUST ignore, but we forgot to actually say that - it's kind of implied, though, as implementations that don't collect annotations ignore them). Reading back over this after #574, this gets to the same question of what sort of "configuration" (including not just configuration options but also additional things not required or explicitly allowed by the spec) is appropriate for testing compliance. I know @Relequestual has some thoughts on this which probably warranted a discussion being opened somewhere (as it's a topic that touches on both the spec and the test suite). In the meantime, @Julian is correct that implementations can add arbitrary non-vocabulary keywords and have them always be on. They cannot enable random vocabularies, but that's irrelevant for draft-07 and earlier. For 2019-09 or later, it matters whether the keywords are implemented as a vocabulary or not, but we should just rely on the So we should assume that any "future" keywords that show up as always-on are non-vocabulary keywords and therefore allowed. The rationale in #574 does not apply here, as we are not trying to make a distinction between implementing the standard (which doesn't have these keywords in it, by definition) vs implementing something that just happens to look like the standard. In this case, it's automatically a "happens to look like a future standard" thing. Like the backwards compatibility As I understand it, the difference between this situation and the required |
The intent of them is not to express that an implementation might wish
to recognize these keywords.
The intent of them is precisely the same as the original intent -- to
allow an implementation to test itself for not recognizing new
keywords. Such an implementation should enable these tests, as it is
free to do so, and these tests will help ensure it does not accidentally
leak newer keywords backwards in time if it doesn't mean to.
All of the previous discussion was strictly centered on not putting
these in the required directory.
The reason is that all drafts allow implementations to add extra
keywords. So a compliant implementation may indeed decide it actively
wants to implement new keywords. Then this file would not help them,
and they wouldn't run it. They would presumably love a version of this
file that did contain all the future assertions as correct for future
drafts, and in the future we could provide one. But given no
implementations really do do this, at least as far as I'm aware, and
given that this version of the file is here and written and more common,
it would seem perfectly reasonable to have it and hope for the other
version if or when someone wants it.
Further discussion is in #383 and later #559.
This reverts commit f605fbf.