-
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: make sure do not ignore the UI tests (#494)
Found a problem with the test in https://github.com/tokio-rs/console/actions/runs/6988785469/job/19016699616?pr=493. If the binary does not exist, it will ignore the test cases. After this change, it will bail out an error. I moved it to integration tests dir, we don't need to build the binary manually.
- Loading branch information
1 parent
8269b5f
commit 075ab0c
Showing
6 changed files
with
26 additions
and
15 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use std::env; | ||
|
||
#[test] | ||
// You can use `TRYCMD=overwrite` to overwrite the expected output. | ||
fn cli_tests() { | ||
// 72 chars seems to fit reasonably in the default width of | ||
// RustDoc's code formatting | ||
// Set the env var COLUMNS to override this. | ||
env::set_var("COLUMNS", "72"); | ||
// The following might be changed by the test runner, so we | ||
// explicitly set them to known values. | ||
env::set_var("LANG", "en_US.UTF-8"); | ||
env::set_var("COLORTERM", "truecolor"); | ||
|
||
let t = trycmd::TestCases::new(); | ||
let console = trycmd::cargo::cargo_bin("tokio-console"); | ||
t.register_bin("tokio-console", console); | ||
let readme_path = std::path::Path::new(&std::env::var("CARGO_MANIFEST_DIR").unwrap()) | ||
.parent() | ||
.expect("README.md exists in the root of the repo") | ||
.join("README.md"); | ||
t.case("tests/cli-ui.toml").case(readme_path); | ||
} |
2 changes: 1 addition & 1 deletion
2
tokio-console/cli-ui.stdout → tokio-console/tests/cli-ui.stdout
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
File renamed without changes.