-
Notifications
You must be signed in to change notification settings - Fork 8
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
Use a consistent approach for organising test fixture files #681
Conversation
Previously test fixtures were located under a mixture of: * `<crate>/fixtures/` * `<crate>/test-fixtures/` Now for consistency they are all located under: `<crate>/tests/fixtures/` This matches the pattern already used by the Python CNB, Procfile CNB etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for consistency, I'm not sure about the location though. Cargo will try to compile code it finds in tests
, even when in subdirectories below tests
. If we ever had a test fixture that Cargo would detect as test code (imagine a test fixture that is an app written in Rust) this location will give us trouble.
That doesn't seem to be the case, when I tried an experiment just now? With this PR there is already Rust code under one of the My understanding of Cargo's automatic target discovery (https://doc.rust-lang.org/cargo/reference/cargo-targets.html#target-auto-discovery and https://doc.rust-lang.org/cargo/guide/project-layout.html) is that it only looks for modules (or lib/bin targets) within the top-level |
I tried adding a Edit: it seems only |
Yeah anything nested in a further subdirectory isn't picked up. There are already some Since all of our fixtures will be in their own directory, and not loose in the |
Previously test fixtures were located under a mixture of:
<crate>/fixtures/
<crate>/test-fixtures/
Now for consistency they are all located under:
<crate>/tests/fixtures/
This matches the pattern already used by the Python CNB, Procfile CNB etc.
GUS-W-14161083.