Skip to content

Commit

Permalink
test: make tests independent from fixed commit sha
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbaliasnikov committed May 8, 2024
1 parent b50980a commit 0ba5b39
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/actions/build_and_test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ runs:
check_name: ${{ matrix.name }} Test Results
files: ${{ env.UNIT_TESTS_RESULTS_XML }}
action_fail_on_inconclusive: true
comment_mode: off

- name: Upload test results (MacOS)
if: runner.os == 'macos'
Expand All @@ -28,6 +29,7 @@ runs:
check_name: ${{ matrix.name }} Test Results
files: ${{ env.UNIT_TESTS_RESULTS_XML }}
action_fail_on_inconclusive: true
comment_mode: off

- name: Upload test results (windows)
if: runner.os == 'Windows'
Expand All @@ -36,3 +38,4 @@ runs:
check_name: ${{ matrix.name }} Test Results
files: ${{ env.UNIT_TESTS_RESULTS_XML }}
action_fail_on_inconclusive: true
comment_mode: off
6 changes: 2 additions & 4 deletions tests/checkout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ fn checkout_after_clone() -> anyhow::Result<()> {
checkout_cmd.arg("checkout");
checkout_cmd
.assert()
.success()
.stderr(predicate::str::contains("HEAD is now at"));
.success();
Ok(())
}

Expand Down Expand Up @@ -71,8 +70,7 @@ fn force_checkout() -> anyhow::Result<()> {
checkout_cmd.arg("checkout").arg("--force");
checkout_cmd
.assert()
.success()
.stderr(predicate::str::contains("HEAD is now at"));
.success();
Ok(())
}

Expand Down
4 changes: 2 additions & 2 deletions tests/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn clone() -> anyhow::Result<()> {
cmd.arg("clone");
cmd.assert()
.success()
.stderr(predicate::str::contains("HEAD is now at"));
.stderr(predicate::str::is_match(".*Updating files:.*100%.*done").unwrap());
Ok(())
}

Expand Down Expand Up @@ -59,7 +59,7 @@ fn clone_deep() -> anyhow::Result<()> {
cmd.arg("--deep");
cmd.assert()
.success()
.stderr(predicate::str::contains("HEAD is now at"));
.stderr(predicate::str::is_match(".*Updating files:.*100%.*done").unwrap());
Ok(())
}

Expand Down

0 comments on commit 0ba5b39

Please sign in to comment.