Comments (4)
If you'd like to assign me to this, I'll take it on.
I propose the following in response to this:
- Use UUIDs for the IDs, and make them globally unique, rather than just unique within the version of the spec.
- Using Array index for the tests themselves is extremely brittle - people keep arbitrarily adding tests in the middle of the lists, and it is difficult to enforce. I propose using a UUID for each test within the test suite.
- I will write a tool to update the IDs for everything and land a complete update all in one go
- If a test changes in any way, I propose that its ID should be changed, and we should document that in the README
- Note that with respect to (4) a test that relies on the metaschema should not be considered to be changed if the metaschema changes.
from json-schema-test-suite.
I originally presumed we would have some sort of human readable ID. UUIDs would be simpler in some respects.
I guess it depends on the intended use case.
If someone has a list of tests they skip, having human readable names which partially suggest the sort of test in question, it could be helpful. However, this wouldn't be the best if we agree that IDs should change if the test changes (which I think is a good idea).
In that case, I wonder if a simpler approach is to just MD5 the test object... although I suspect because of JSON and object ordering, that might not end up the same depending on various things.
All that to say, are we convinced UUIDs as IDs would be the best here?
from json-schema-test-suite.
I did consider an MD5 hash of the test object (and the schema in the case of the test case) but that makes it rather harder to generate while developing the tests, and feels like a barrier to entry.
from json-schema-test-suite.
I don't really have any strong preference on the structure of the IDs -- I think I mentioned I think slugs are better because of the extra benefit (of being user readable and usable for other reasons in isolation) but if I'm not doing the work I definitely don't care.
The only thing I do care about is:
I will write a tool to update the IDs for everything and land a complete update all in one go
I don't personally want to (ever) review large automated PRs (and have said elsewhere that as far as I have seen in "real life" it's simply impossible for any human to do.) -- meaning I'm happy to review the script you write to do this, or else for someone else who thinks it's possible to do the review -- though experience in this repo itself has reaffirmed as far as I'm concerned that this is the case :) -- the last two times I said this (no large automated PRs) and others reviewed it, the PRs indeed introduced subtle test bugs that were fixed over a few months afterwards (not that it took months to fix, it took months to notice, which is often the problem).
So yeah, happy to review the script, or else to say "find any other test suite contributor willing to review the PR".
Otherwise I'm fine with UUIDs if you prefer.
from json-schema-test-suite.
Related Issues (20)
- Negative schema tests HOT 4
- File URIs with pointer fragments HOT 6
- New release? HOT 4
- Perhaps add test for `"type": []` HOT 3
- Suite contains invalid, positive tests for idn-hostname HOT 2
- Add tests for single label IDN hostnames
- Missing test for `unevaluatedProperties` and `$dynamicRef` HOT 1
- Add a `specification` property to test cases + tests HOT 12
- Should identifier declarations be respected in non-schema locations? HOT 29
- Clarify how test runners should handle `format`. HOT 1
- Unknown `format` handling HOT 2
- Test for jumping over a resource HOT 16
- Syntax highlight schemas + instances in the terminal HOT 1
- Description and test case contradiction: `unevaluatedProperties` HOT 3
- update the test suite for draft-next HOT 6
- Make CI annotate pull requests with links to the {section} specified in "specification" HOT 11
- Tests for mixed Arabic-Indic digits and Extended Arabic-Indic digits violates the Bidi rule HOT 10
- Clarification Needed on Handling Duplicate `anchor` Definitions Across JSON Schema Tests HOT 3
- draft2020-12 test cases are not compliant with the specification HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-schema-test-suite.