forked from FuelLabs/sway
-
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.
Update test runners to accept optional
--locked
flag. Use it in CI. (…
…FuelLabs#1964) * Update E2E test runner to accept `--locked` flag This allows users to run the tests without the `--locked` flag by default, which is often the easiest way to update the `Forc.lock` files for each test locally. * Move `--locked` flag to an arg in stdlib test build script This allows us to only lock the tests and runner during CI, making it easier for users to update lock files locally by running the build script.
- Loading branch information
1 parent
1cc7e96
commit 95518c2
Showing
5 changed files
with
44 additions
and
24 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,10 +1,25 @@ | ||
mod e2e_vm_tests; | ||
|
||
fn main() { | ||
let filter_regex = std::env::args().nth(1).map(|filter_str| { | ||
regex::Regex::new(&filter_str) | ||
.unwrap_or_else(|_| panic!("Invalid filter regex: '{}'.", filter_str)) | ||
}); | ||
let mut locked = false; | ||
let mut filter_regex = None; | ||
for arg in std::env::args().skip(1) { | ||
// Check for the `--locked` flag. Must precede the regex. | ||
// Intended for use in `CI` to ensure test lock files are up to date. | ||
if arg == "--locked" { | ||
locked = true; | ||
continue; | ||
} | ||
|
||
e2e_vm_tests::run(filter_regex); | ||
// Check for a regex, used to filter the set of tests. | ||
let regex = regex::Regex::new(&arg).unwrap_or_else(|_| { | ||
panic!( | ||
"Expected either `--locked` or a filter regex, found: {:?}.", | ||
arg | ||
) | ||
}); | ||
filter_regex = Some(regex); | ||
} | ||
|
||
e2e_vm_tests::run(locked, filter_regex); | ||
} |
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