-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add tests to rustbuild #48913
Merged
Merged
Add tests to rustbuild #48913
Commits on Apr 3, 2018
-
Stop accessing current_dir in bootstrap
This ensures that the working directory of rustbuild has no effect on it's run; since tests will run with a different cwd this is required for consistent behavior.
Configuration menu - View commit details
-
Copy full SHA for 84b5b34 - Browse repository at this point
Copy the full SHA 84b5b34View commit details -
Configuration menu - View commit details
-
Copy full SHA for a5e56b6 - Browse repository at this point
Copy the full SHA a5e56b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for e7342b8 - Browse repository at this point
Copy the full SHA e7342b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for cd33d3a - Browse repository at this point
Copy the full SHA cd33d3aView commit details -
Ensures that test cases will be somewhat easier to write.
Configuration menu - View commit details
-
Copy full SHA for fde70b0 - Browse repository at this point
Copy the full SHA fde70b0View commit details -
Extract default Config into function
Will permit creating Config in tests without having to parse a toml file.
Configuration menu - View commit details
-
Copy full SHA for 8fd42ec - Browse repository at this point
Copy the full SHA 8fd42ecView commit details -
In order to run tests, previous commits have cfg'd out various parts of rustbuild. Generally speaking, these are filesystem-related operations and process-spawning related parts. Then, rustbuild is run "as normal" and the various steps that where run are retrieved from the cache and checked against the expected results. Note that this means that the current implementation primarily tests "what" we build, but doesn't actually test that what we build *will* build. In other words, it doesn't do any form of dependency verification for any crate. This is possible to implement, but is considered future work. This implementation strives to cfg out as little code as possible; it also does not currently test anywhere near all of rustbuild. The current tests are also not checked for "correctness," rather, they simply represent what we do as of this commit, which may be wrong. Test cases are drawn from the old implementation of rustbuild, though the expected results may vary.
Configuration menu - View commit details
-
Copy full SHA for 42fde21 - Browse repository at this point
Copy the full SHA 42fde21View commit details -
Configuration menu - View commit details
-
Copy full SHA for f4620a3 - Browse repository at this point
Copy the full SHA f4620a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for b0dbc7c - Browse repository at this point
Copy the full SHA b0dbc7cView commit details -
Refactor to use a dry-run config instead of cfg(test)
This ensures that each build will support the testing design of "dry running" builds. It's also checked that a dry run build is equivalent step-wise to a "wet" run build; the graphs we generate when running are directly compared node/node and edge/edge, both for order and contents.
Configuration menu - View commit details
-
Copy full SHA for a727447 - Browse repository at this point
Copy the full SHA a727447View commit details -
Configuration menu - View commit details
-
Copy full SHA for 545b92f - Browse repository at this point
Copy the full SHA 545b92fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ce5cf0 - Browse repository at this point
Copy the full SHA 0ce5cf0View commit details -
Stop checking that the graph produced by a dry run is equivalent
This is too likely to cause spurious bounces on CI; what we run may be dependent on what ran successfully before hand (e.g. RLS features with Clippy), which makes this not tenable. There's no good way to ignore specifically these problematic steps so we'll just ignore everything for the time being. We still test that a dry run worked though so largely this is the same from a ensure-that-tests-work perspective. Eventually we'll want to undo this commit, though, to make our tests more accurate.
Configuration menu - View commit details
-
Copy full SHA for 184d3bc - Browse repository at this point
Copy the full SHA 184d3bcView commit details
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.