forked from near/nearcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
cfg_attr
to ignore expensive tests (near#6032)
Rather than using `cfg` to not compile expensive tests, use `cfg_attr` to conditionally mark such tests as ignored. In other words, instead of writing: #[cfg(feature = "expensive_tests")] #[test] fn test_clear_old_data_too_many_heights() { // ... } write: #[test] #[cfg_attr(not(feature = "expensive_tests"), ignore)] fn test_clear_old_data_too_many_heights() { // ... } With this change, expensive tests will always be built which means that i) any code changes breaking them will be caught by CI (rather than having to wait for a nightly run) and ii) code used by expensive tests only is no longer unused when `expensive_tests` feature is not enabled (which means fewer `#[cfg(feature = "expensive_tests")]` directives sprinkled throughout code). Since we no longer mark whole modules as compiled only if the feature is enabled, this change also means that each individual test needs to be marked individually (rather than being able to mark whole module). This makes it more obvious which tests are expensive and which aren’t (since the marking is right at the test definition site) and simplifies `check_nightly.py` script. Issue: near#4490
- Loading branch information
Showing
18 changed files
with
190 additions
and
139 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
mod challenges; | ||
#[cfg(feature = "expensive_tests")] | ||
mod doomslug; | ||
mod gc; | ||
mod simple_chain; | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
mod bug_repros; | ||
#[cfg(feature = "expensive_tests")] | ||
mod catching_up; | ||
mod chunks_management; | ||
#[cfg(feature = "expensive_tests")] | ||
mod consensus; | ||
mod cross_shard_tx; | ||
mod query_client; |
Oops, something went wrong.