Skip to content

Commit

Permalink
fix CI test spec and print output correctly #69
Browse files Browse the repository at this point in the history
  • Loading branch information
marsella committed Feb 22, 2022
1 parent dcc0389 commit 37615c2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Run sandbox
run: docker run --rm --name my-sandbox --detach -p 20000:20000 tqtezos/flextesa:20210602 flobox start

- name: Configure tezos client and run integration tests
- name: Configure tezos client and run all test targets
uses: addnab/docker-run-action@v3
with:
image: ${{ steps.tags.outputs.tagged_image }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
- name: Build
run: cargo build --all-features --all-targets --verbose

- name: Run all unit + library tests (not doc or integration tests)
run: cargo test --all-features --all-targets --lib --verbose
- name: Run all unit + library tests (not doc, integration, benchmark, or example tests)
run: cargo test --all-features --lib --bins

- name: Run all doctests
run: cargo test --all-features --doc --verbose
Expand Down
12 changes: 8 additions & 4 deletions integration_tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ pub async fn main() {
println!("Executing {} tests", tests.len());
let mut results = Vec::with_capacity(tests.len());
for test in tests {
println!("\nNow running: {}", test.name);
eprintln!("\n\ntest integration_tests::{} ... ", test.name);
let result = test.execute(&rng, &customer_config, &merchant_config).await;
if let Err(error) = &result {
eprintln!("Test failed: {}\n{:?}", test.name, error)
eprintln!("failed\n{:?}", error)
} else {
eprintln!("ok")
}
results.push(result);

Expand All @@ -53,8 +55,10 @@ pub async fn main() {
common::teardown(server_future).await;

// Fail if any test failed. This is separate from evaluation to enforce that _every_ test must
// run -- otherwise, any will short-circuit the execution
assert!(results.iter().all(|result| result.is_ok()));
// run without short-circuiting the execution at first failure
if !results.iter().all(|result| result.is_ok()) {
std::process::exit(101);
}
}

/// Get a list of tests to execute.
Expand Down

0 comments on commit 37615c2

Please sign in to comment.