-
Notifications
You must be signed in to change notification settings - Fork 208
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
tests: small change in tests
folder will cause a full rebuild of binary
#472
Comments
According to cargo: change detection of build script, re-run of build scripts only relies on the modification of filesystem "last-modified" timestamp. To avoid re-run each time when only file content changes, we can manually maintain a list of the test cases (filenames) in a single file instead and declare it as the trigger. |
Good idea! |
... so we can create a "test_cases.rs", which includes a function, and Meanwhile, in the rerun-if-changed config, we can only specify |
What is the function in "test_cases.rs" for? If it's for scanning the dir, the build script can not be triggered when there're modifications in IMO only a list of file names is needed. Developers should maintain the list whenever a test file is added or removed. Besides, we can add a check on the list to make sure all files are included (and no non-existing files). |
You're right. Ignore my comments above 🤪 |
Then I think a better approach is to:
|
I'm a little bit confused: if we need to maintain a list of files now, what's the difference from the situaion before the auto discovery? |
That's true... Maybe we should find another way to do auto-discovery of tests... |
How about moving the integration test into a separate crate? Because now test file generation depends on cargo build script but currently cargo does not support test build scripts. |
Cause by #376
Is there any way that
build.rs
only detects only file name instead of full file content?The text was updated successfully, but these errors were encountered: