This crate contains the build script necessary for autogenerated tests.
The tests
directory is scanned for index usage and specification query tests. Each
file is parsed in the build script to:
- determine if a test should be generated
- create the tests
Autogenerated tests may contain cases that are irrelevant for a particular test; this is fine because it's generated code and all tests eventually use all contents.
You can run specific test types with feature flags. The generated
flag is
required for any test type. -- --test-threads=1
is required to run any of
the test suites, as they are not thread safe.
- Query tests:
cargo test --package e2e-tests --features generated,query -- --test-threads=1
- Index tests:
cargo test --package e2e-tests --features generated,index -- --test-threads=1
- E2E tests:
cargo test --package e2e-tests --features generated,e2e -- --test-threads=1
- Error tests:
cargo test --package e2e-tests --features generated,error -- --test-threads=1
- ALL tests:
cargo test --package e2e-tests --features generated,all -- --test-threads=1
The easiest way to add new tests is to append to a file, or create a new file in the tests directory following the structure of a similar file. This will automatically be built into a new test file with test cases.
See the readme in the build_utils