Skip to content

Commit

Permalink
Merge pull request #137 from Concordium/fix-integration-tests
Browse files Browse the repository at this point in the history
Fix integration tests should panic if error occurs
DOBEN authored Nov 22, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 2afe042 + ceb7604 commit 6953eb5
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 2 additions & 0 deletions cargo-concordium/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

## Unreleased changes

- Fix a bug so that a non-zero status code is now returned by `cargo concordium test` if tests fail.

## 3.1.4

- Support crate names with uppercase letters.
22 changes: 10 additions & 12 deletions cargo-concordium/src/main.rs
Original file line number Diff line number Diff line change
@@ -645,19 +645,17 @@ pub fn main() -> anyhow::Result<()> {
only_unit_tests,
test_targets,
} => {
let success_unit = build_and_run_wasm_test(&build_options.cargo_args, seed)
.context("Could not build and run tests.")?;
let success_integration = if only_unit_tests {
true
} else {
build_and_run_integration_tests(build_options, test_targets).is_ok()
};
let unit_test_success = build_and_run_wasm_test(&build_options.cargo_args, seed)
.context("Could not build and run unit tests.")?;
if !only_unit_tests {
build_and_run_integration_tests(build_options, test_targets)
.context("Could not build and run integration tests.")?;
}
if !unit_test_success {
anyhow::bail!("One or more unit tests failed.");
}

if success_unit && success_integration {
eprintln!("{}", Color::Green.bold().paint("All tests passed"));
} else {
eprintln!("\n{}", Color::Red.bold().paint("One or more tests failed"));
};
eprintln!("{}", Color::Green.bold().paint("All tests passed"));
}
Command::Init { path } => {
init_concordium_project(path)

0 comments on commit 6953eb5

Please sign in to comment.