-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from CloudCannon/feta/run-one
Add arguments to the CLI to run a specific test
- Loading branch information
Showing
5 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
cd $SCRIPT_DIR | ||
|
||
TOOLPROOF=$(realpath "$SCRIPT_DIR/target/$1/toolproof") | ||
|
||
cargo run --release -- --placeholders toolproof_path="$TOOLPROOF" -c 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Run a single toolproof test | ||
|
||
steps: | ||
- step: I have a "my_test_a.toolproof.yml" file with the content {yaml} | ||
yaml: |- | ||
name: Inner test A | ||
steps: | ||
- I run 'echo "toolproof π"' | ||
- stdout should contain "π" | ||
- step: I have a "my_test_b.toolproof.yml" file with the content {yaml} | ||
yaml: |- | ||
name: Inner test B | ||
steps: | ||
- I run 'echo "toolproof π"' | ||
- stdout should contain "π" | ||
- I run "%toolproof_path% -n 'Inner test A'" | ||
- step: "stdout should contain 'Passing tests: 1'" | ||
- step: "stdout should contain 'Failing tests: 0'" | ||
- step: "stdout should contain 'Skipped tests: 0'" | ||
- step: "stdout should contain 'All tests passed'" | ||
- stderr should be empty | ||
- I run "%toolproof_path% -n 'Inner test B'" and expect it to fail | ||
- step: "stdout should contain 'Passing tests: 0'" | ||
- step: "stdout should contain 'Failing tests: 1'" | ||
- step: "stdout should contain 'Skipped tests: 0'" | ||
- step: "stdout should contain 'Some tests failed'" | ||
- stderr should be empty |