Skip to content

Commit

Permalink
fix(cli): wrong SolcReq into and only run integration tests (foundry-…
Browse files Browse the repository at this point in the history
…rs#1076)

* fix(cli): wrong SolcReq into

* ci: only run integration tests in integration job
  • Loading branch information
mattsse authored Mar 27, 2022
1 parent 67e0bb4 commit abbd381
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
cache-on-failure: true

- name: cargo test
run: cargo test --locked --workspace --all-features --test '*'
run: cargo test --locked --workspace --features integration-tests --test integration

lint:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ openssl = ["ethers/openssl"]

integration-tests = []

[[test]]
name = "integration"
path = "tests/integration.rs"
required-features = ["integration-tests"]

[[bin]]
name = "cast"
path = "src/cast.rs"
Expand Down
1 change: 1 addition & 0 deletions cli/test-utils/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ fn config_paths_exist(paths: &ProjectPathsConfig, cached: bool) {
paths.libraries.iter().for_each(|lib| assert!(lib.exists()));
}

#[track_caller]
pub fn pretty_err<T, E: std::error::Error>(path: impl AsRef<Path>, res: Result<T, E>) -> T {
match res {
Ok(t) => t,
Expand Down
3 changes: 1 addition & 2 deletions cli/tests/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ contract Greeter {}
.unwrap();

// explicitly set to run with 0.8.10
let config =
Config { solc: Some(SolcReq::Local(PathBuf::from("0.8.10"))), ..Default::default() };
let config = Config { solc: Some("0.8.10".into()), ..Default::default() };
prj.write_config(config);

cmd.arg("build");
Expand Down

0 comments on commit abbd381

Please sign in to comment.