Write generated tests to OUT_DIR instead of repo working dir#235
Open
patonw wants to merge 1 commit intoqdrant:devfrom
Open
Write generated tests to OUT_DIR instead of repo working dir#235patonw wants to merge 1 commit intoqdrant:devfrom
patonw wants to merge 1 commit intoqdrant:devfrom
Conversation
Member
|
I would prefer to keep generated tests in the source. Maybe better alternative would be to move generation of tests out of |
Author
|
That could be done with a fairly trivial shell script. A separate git hook could also verify that the snippets and tests are in sync by generating to a temp dir and comparing with the source. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the build script to write generated integration tests to the
OUT_DIRin accordance to The Cargo Book :Additionally, the current method of writing tests to the repo working directory during builds causes issues with hermetic build systems that need the source to be hashable and hence immutable. Such systems require that any artifacts created during the build process are written outside the source directory into a designated output location. Projects using this library as a direct dependency can work around by overriding the default feature set (which is a bit awkward). But for transitive dependencies this is fairly problematic.
I've attached a log from running the integration tests to demonstrate that they can and are still being run from the output directory: test-output.log
Another run, but injecting a fault into the snippets to demonstrate that it runs against the snippets from the repo and not empty modules or extraneous code: fault-injection.log
All Submissions:
devbranch. Did you create your branch fromdev?P.S. Might be helpful to include the link to CONTRIBUTING in the PR template in checkbox 2