Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Parallel test execution is now enabled on Alpine Linux (#370)

### Fixed
- Dim/faint labels now render as gray (SGR 90) so keywords like `Expected` and `Tests:` stay colored in GitHub Actions logs (#323)
- Syntax error in a test file now fails the suite instead of passing silently (#220)
- `--stop-on-failure` now stops on runtime errors such as `command not found` or `illegal option` (#383)
- Spying on `echo` or `printf` no longer hangs via infinite recursion (#607)
Expand Down
4 changes: 3 additions & 1 deletion src/colors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ if bashunit::env::is_no_color_enabled; then
_BASHUNIT_COLOR_DEFAULT=""
else
_BASHUNIT_COLOR_BOLD="$(bashunit::sgr 1)"
_BASHUNIT_COLOR_FAINT="$(bashunit::sgr 2)"
# Use SGR 90 (bright black / gray) instead of SGR 2 (faint), since
# GitHub Actions' log renderer does not render the faint attribute.
_BASHUNIT_COLOR_FAINT="$(bashunit::sgr 90)"
_BASHUNIT_COLOR_BLACK="$(bashunit::sgr 30)"
_BASHUNIT_COLOR_FAILED="$(bashunit::sgr 31)"
_BASHUNIT_COLOR_PASSED="$(bashunit::sgr 32)"
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/bashunit_execution_error_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function test_bashunit_when_a_execution_error() {
local test_file=./tests/acceptance/fixtures/test_bashunit_when_a_execution_error.sh
local color_default="$(bashunit::sgr 0)"
local color_bold="$(bashunit::sgr 1)"
local color_dim="$(bashunit::sgr 2)"
local color_dim="$(bashunit::sgr 90)"
local color_red="$(bashunit::sgr 31)"

function format_summary_title() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
✗ Failed: assert same
Expected 'foo'
but got  'bar'
Expected 'foo'
but got  'bar'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
✗ Failed: assert same
Expected 'foo'
but got  'bar'
Expected 'foo'
but got  'bar'
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Running tests/acceptance/fixtures/test_bashunit_when_a_test_returns_non_zero.sh
✗ Error: Returns non zero



There was 1 failure:

|1) tests/acceptance/fixtures/test_bashunit_when_a_test_returns_non_zero.sh:3

Tests:  1 failed, 1 total
Assertions: 0 failed, 0 total
Tests:  1 failed, 1 total
Assertions: 0 failed, 0 total

 Some tests failed 
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

|1) ./tests/acceptance/fixtures/test_bashunit_when_a_test_fail.sh:12
|✗ Failed: Assert failing
| Expected '1'
| but got  '0'
| Source:
| 13: assert_same 1 0
| Expected '1'
| but got  '0'
| Source:
| 13: assert_same 1 0



Tests:  4 passed, 1 failed, 5 total
Assertions: 6 passed, 1 failed, 7 total
Tests:  4 passed, 1 failed, 5 total
Assertions: 6 passed, 1 failed, 7 total

 Some tests failed 
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

|1) ./tests/acceptance/fixtures/test_bashunit_when_a_test_fail.sh:12
|✗ Failed: Assert failing
| Expected '1'
| but got  '0'
| Source:
| 13: assert_same 1 0
| Expected '1'
| but got  '0'
| Source:
| 13: assert_same 1 0



Tests:  4 passed, 1 failed, 5 total
Assertions: 6 passed, 1 failed, 7 total
Tests:  4 passed, 1 failed, 5 total
Assertions: 6 passed, 1 failed, 7 total

 Some tests failed 
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
✓ Passed: Assert same
✓ Passed: Assert contains
✗ Failed: Assert failing
Expected '1'
but got  '0'
Expected '1'
but got  '0'
✓ Passed: Assert greater and less than
✓ Passed: Assert empty

There was 1 failure:

|1) ./tests/acceptance/fixtures/test_bashunit_when_a_test_fail.sh:12
|✗ Failed: Assert failing
| Expected '1'
| but got  '0'
| Source:
| 13: assert_same 1 0
| Expected '1'
| but got  '0'
| Source:
| 13: assert_same 1 0

Tests:  4 passed, 1 failed, 5 total
Assertions: 6 passed, 1 failed, 7 total
Tests:  4 passed, 1 failed, 5 total
Assertions: 6 passed, 1 failed, 7 total

 Some tests failed 
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
✓ Passed: Assert same
✓ Passed: Assert contains
✗ Failed: Assert failing
Expected '1'
but got  '0'
Expected '1'
but got  '0'
✓ Passed: Assert greater and less than
✓ Passed: Assert empty

There was 1 failure:

|1) ./tests/acceptance/fixtures/test_bashunit_when_a_test_fail.sh:12
|✗ Failed: Assert failing
| Expected '1'
| but got  '0'
| Source:
| 13: assert_same 1 0
| Expected '1'
| but got  '0'
| Source:
| 13: assert_same 1 0

Tests:  4 passed, 1 failed, 5 total
Assertions: 6 passed, 1 failed, 7 total
Tests:  4 passed, 1 failed, 5 total
Assertions: 6 passed, 1 failed, 7 total

 Some tests failed 
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Running ./tests/acceptance/fixtures/test_bashunit_when_exit_immediately_after_execution_error.sh
✗ Error: Error



There was 1 failure:

|1) ./tests/acceptance/fixtures/test_bashunit_when_exit_immediately_after_execution_error.sh:3

Tests:  1 failed, 1 total
Assertions: 0 failed, 0 total
Tests:  1 failed, 1 total
Assertions: 0 failed, 0 total

 Some tests failed 
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
Running ./tests/acceptance/fixtures/test_bashunit_with_multiple_failing_tests.sh
✓ Passed: Assert same
✗ Failed: Assert failing
Expected '1'
but got  '2'
✒ Incomplete: Assert todo and skip foo
↷ Skipped: Assert todo and skip bar
↷ Skipped: Assert skip and todo baz
✒ Incomplete: Assert skip and todo yei
Expected '1'
but got  '2'
✒ Incomplete: Assert todo and skip foo
↷ Skipped: Assert todo and skip bar
↷ Skipped: Assert skip and todo baz
✒ Incomplete: Assert skip and todo yei

There was 1 failure:

|1) ./tests/acceptance/fixtures/test_bashunit_with_multiple_failing_tests.sh:7
|✗ Failed: Assert failing
| Expected '1'
| but got  '2'
| Source:
| 8: assert_same 1 2
| 9: assert_same 3 4
| Expected '1'
| but got  '2'
| Source:
| 8: assert_same 1 2
| 9: assert_same 3 4

Tests:  1 passed, 0 skipped, 2 incomplete, 1 failed, 4 total
Assertions: 1 passed, 2 skipped, 2 incomplete, 1 failed, 6 total
Tests:  1 passed, 0 skipped, 2 incomplete, 1 failed, 4 total
Assertions: 1 passed, 2 skipped, 2 incomplete, 1 failed, 6 total

 Some tests failed 
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
✓ Passed: Assert same
✓ Passed: Assert contains

Tests:  6 passed, 6 total
Assertions: 9 passed, 9 total
Tests:  6 passed, 6 total
Assertions: 9 passed, 9 total

 All tests passed 
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
✓ Passed: Assert same
✓ Passed: Assert contains

Tests:  6 passed, 6 total
Assertions: 9 passed, 9 total
Tests:  6 passed, 6 total
Assertions: 9 passed, 9 total

 All tests passed 
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
✓ Passed: Assert greater and less than
✓ Passed: Assert empty

Tests:  2 passed, 2 total
Assertions: 3 passed, 3 total
Tests:  2 passed, 2 total
Assertions: 3 passed, 3 total

 All tests passed 
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
Running ./tests/acceptance/fixtures/test_bashunit_when_log_junit.sh
✓ Passed: Success
✗ Failed: Failure
Expected '2'
but got  '3'
Expected '2'
but got  '3'

There was 1 failure:

|1) ./tests/acceptance/fixtures/test_bashunit_when_log_junit.sh:7
|✗ Failed: Failure
| Expected '2'
| but got  '3'
| Source:
| 8: assert_same 2 3
| Expected '2'
| but got  '3'
| Source:
| 8: assert_same 2 3

Tests:  1 passed, 1 failed, 2 total
Assertions: 1 passed, 1 failed, 2 total
Tests:  1 passed, 1 failed, 2 total
Assertions: 1 passed, 1 failed, 2 total

 Some tests failed 
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
Running ./tests/acceptance/fixtures/test_bashunit_when_log_junit.sh
✓ Passed: Success
✗ Failed: Failure
Expected '2'
but got  '3'
Expected '2'
but got  '3'

There was 1 failure:

|1) ./tests/acceptance/fixtures/test_bashunit_when_log_junit.sh:7
|✗ Failed: Failure
| Expected '2'
| but got  '3'
| Source:
| 8: assert_same 2 3
| Expected '2'
| but got  '3'
| Source:
| 8: assert_same 2 3

Tests:  1 passed, 1 failed, 2 total
Assertions: 1 passed, 1 failed, 2 total
Tests:  1 passed, 1 failed, 2 total
Assertions: 1 passed, 1 failed, 2 total

 Some tests failed 
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
....

Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total
Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total

 All tests passed 
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
....

Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total
Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total

 All tests passed 
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
✓ Passed: Assert greater and less than
✓ Passed: Assert empty

Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total
Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total

 All tests passed 
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
✓ Passed: Assert greater and less than
✓ Passed: Assert empty

Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total
Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total

 All tests passed 
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Tests:  0 total
Assertions: 0 total
Tests:  0 total
Assertions: 0 total

 No tests found 
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
✓ Passed: Assert same
✓ Passed: Assert contains

Tests:  6 passed, 6 total
Assertions: 9 passed, 9 total
Tests:  6 passed, 6 total
Assertions: 9 passed, 9 total

 All tests passed 
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
✓ Passed: Assert same
✓ Passed: Assert contains

Tests:  6 passed, 6 total
Assertions: 9 passed, 9 total
Tests:  6 passed, 6 total
Assertions: 9 passed, 9 total

 All tests passed 
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Running ./tests/acceptance/fixtures/test_bashunit_when_report_html.sh
✓ Passed: Success
✗ Failed: Fail
Expected 'to be empty'
but got  'non empty'
Expected 'to be empty'
but got  'non empty'
↷ Skipped: Skipped
✒ Incomplete: Todo

There was 1 failure:

|1) ./tests/acceptance/fixtures/test_bashunit_when_report_html.sh:7
|✗ Failed: Fail
| Expected 'to be empty'
| but got  'non empty'
| Source:
| 8: assert_empty "non empty"
| Expected 'to be empty'
| but got  'non empty'
| Source:
| 8: assert_empty "non empty"

Tests:  1 passed, 1 skipped, 1 incomplete, 1 failed, 4 total
Assertions: 1 passed, 1 skipped, 1 incomplete, 1 failed, 4 total
Tests:  1 passed, 1 skipped, 1 incomplete, 1 failed, 4 total
Assertions: 1 passed, 1 skipped, 1 incomplete, 1 failed, 4 total

 Some tests failed 
Loading
Loading