Skip to content
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

ci: fix windows external tests #6280

Merged
merged 3 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions crates/forge/tests/cli/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ forgetest!(
dss_exec_lib,
"-vvv",
]);
cmd.print_output();
cmd.assert_non_empty_stdout();
}
);

Expand Down Expand Up @@ -1177,21 +1177,18 @@ contract ContractThreeTest is DSTest {
cmd.forge_fuse();
let first_out = cmd.arg("test").arg("--gas-report").stdout_lossy();
assert!(first_out.contains("foo") && first_out.contains("bar") && first_out.contains("baz"));
// cmd.arg("test").arg("--gas-report").print_output();

cmd.forge_fuse();
prj.write_config(Config { gas_reports: (vec![]), ..Default::default() });
cmd.forge_fuse();
let second_out = cmd.arg("test").arg("--gas-report").stdout_lossy();
assert!(second_out.contains("foo") && second_out.contains("bar") && second_out.contains("baz"));
// cmd.arg("test").arg("--gas-report").print_output();

cmd.forge_fuse();
prj.write_config(Config { gas_reports: (vec!["*".to_string()]), ..Default::default() });
cmd.forge_fuse();
let third_out = cmd.arg("test").arg("--gas-report").stdout_lossy();
assert!(third_out.contains("foo") && third_out.contains("bar") && third_out.contains("baz"));
// cmd.arg("test").arg("--gas-report").print_output();

cmd.forge_fuse();
prj.write_config(Config {
Expand All @@ -1205,7 +1202,6 @@ contract ContractThreeTest is DSTest {
cmd.forge_fuse();
let fourth_out = cmd.arg("test").arg("--gas-report").stdout_lossy();
assert!(fourth_out.contains("foo") && fourth_out.contains("bar") && fourth_out.contains("baz"));
// cmd.arg("test").arg("--gas-report").print_output();
});

forgetest!(gas_report_some_contracts, |prj, cmd| {
Expand Down Expand Up @@ -1310,7 +1306,6 @@ contract ContractThreeTest is DSTest {
cmd.forge_fuse();
let first_out = cmd.arg("test").arg("--gas-report").stdout_lossy();
assert!(first_out.contains("foo") && !first_out.contains("bar") && !first_out.contains("baz"));
// cmd.arg("test").arg("--gas-report").print_output();

// report for Two
cmd.forge_fuse();
Expand All @@ -1323,7 +1318,6 @@ contract ContractThreeTest is DSTest {
assert!(
!second_out.contains("foo") && second_out.contains("bar") && !second_out.contains("baz")
);
// cmd.arg("test").arg("--gas-report").print_output();

// report for Three
cmd.forge_fuse();
Expand All @@ -1334,7 +1328,6 @@ contract ContractThreeTest is DSTest {
cmd.forge_fuse();
let third_out = cmd.arg("test").arg("--gas-report").stdout_lossy();
assert!(!third_out.contains("foo") && !third_out.contains("bar") && third_out.contains("baz"));
// cmd.arg("test").arg("--gas-report").print_output();
});

forgetest!(gas_ignore_some_contracts, |prj, cmd| {
Expand Down Expand Up @@ -1439,7 +1432,6 @@ contract ContractThreeTest is DSTest {
cmd.forge_fuse();
let first_out = cmd.arg("test").arg("--gas-report").stdout_lossy();
assert!(!first_out.contains("foo") && first_out.contains("bar") && first_out.contains("baz"));
// cmd.arg("test").arg("--gas-report").print_output();

// ignore ContractTwo
cmd.forge_fuse();
Expand All @@ -1453,7 +1445,6 @@ contract ContractThreeTest is DSTest {
assert!(
second_out.contains("foo") && !second_out.contains("bar") && second_out.contains("baz")
);
// cmd.arg("test").arg("--gas-report").print_output();

// ignore ContractThree
cmd.forge_fuse();
Expand Down
5 changes: 1 addition & 4 deletions crates/forge/tests/cli/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ use foundry_test_utils::util::{setup_forge_remote, RemoteProject};
fn can_generate_solmate_docs() {
let (prj, _) =
setup_forge_remote(RemoteProject::new("transmissions11/solmate").set_build(false));
prj.forge_command()
.args(["doc", "--build"])
.ensure_execute_success()
.expect("`forge doc` failed");
prj.forge_command().args(["doc", "--build"]).assert_success();
}
8 changes: 7 additions & 1 deletion crates/forge/tests/cli/ext_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ forgetest_external!(
forgetest_external!(stringutils, "Arachnid/solidity-stringutils");
forgetest_external!(lootloose, "gakonst/lootloose");
forgetest_external!(lil_web3, "m1guelpf/lil-web3");
forgetest_external!(snekmate, "pcaversaccio/snekmate");
forgetest_external!(
// https://github.com/foundry-rs/foundry/pull/6280
// `run: pnpm --version` is ok, `Command::new("pnpm")` isn't. Good job Windows.
#[cfg_attr(windows, ignore = "Windows cannot find installed programs")]
snekmate,
"pcaversaccio/snekmate"
);

// Forking tests

Expand Down
Loading