Description
Current implementation of java tests run against a snapshot of the schema files, shipped with org.cyclinedx
java package.
This is undesired and error-prone, as changes to the schema files in this repo are not checked against the schema example files.
Therefore, most java checks in pull requests are just bogus results without any meaning.
This must change ASAP.
Use cases:
- a PullRequest is opened, that modifies a schema file. tests must run based on these changes, not some snapshots.
- a PullRequest is opened, that modify some test-resources. tests must run based on these changes.
acceptance criteria
- all test run against the actual schema files in this repo, not against any other snapshots
- optional, but preferred: tests run offline, do not load any data from external sources
- all currently running tests still pass
scope
- test resources: https://github.com/CycloneDX/specification/tree/master/tools/src/test/resources
- tests for JSON files
- tests for XML files
- text for ProtoBuf files
valid-*.{json,xml,textproto}
should pass schema validationinvalid-*.{json,xml,textproto}
should fail schema validation
- schema files: https://github.com/CycloneDX/specification/tree/master/schema
- XSD for XML
- JSON schema for JSON
- proto for textproto
targets
- Java tests -- open, uses remote snapshot which is about to be changed
- see
- see
out of scope (since already fixed/done)
- PHP tests -- done, uses local versions
- see
specification/tools/src/test/php/json-schema-functional-tests.php
Lines 15 to 16 in d37a107
- see
specification/tools/src/test/php/json-schema-lint-tests.php
Lines 5 to 6 in d37a107
- see
specification/tools/src/test/php/xml-schema-functional-tests.php
Lines 15 to 16 in d37a107
- see
- JS tests -- done, uses local versions
- see
specification/tools/src/test/js/json-schema-functional-tests.js
Lines 24 to 25 in 2003555
- see
- see
- ProtoBuf tests -- done, uses local versions
- see
specification/tools/src/test/proto/test.sh
Lines 104 to 130 in 19a1530
- see
caused by #255
related: https://cyclonedx.slack.com/archives/G01PMU9ERJA/p1687363757137109