forked from tape-testing/faucet
-
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.
feat: Upgrade TAP parser, overhaul formated output
* Add `-v|--verbose` command line parameter and option to print succeeding assertions too * Print total count of passed, failed, todo and skipped tests only if they are non-zero * Print also todo and skipped tests, mismatch between planned and executed test count and bail-out message * Format error information on multiple lines * Fail the tests if no TAP output is printed on the console * Upgrade the TAP parser * Upgrade the rest of npm module dependencies * Migrate from npm to pnpm * Migrate from Travis to GitHub Actions BREAKING CHANGE: The upgraded TAP parser 11.0 has different behaviour than the original 0.7. Programmatically, the "comment" event is triggered with the comment including the "# " prefix and the "results" event was renamed to "complete". Further optimisations of the formatted output reduce unnecessary text and render errors in a more legible way.
- Loading branch information
Showing
48 changed files
with
1,631 additions
and
508 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
trim_trailing_whitespace = false | ||
insert_final_newline = true |
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,33 @@ | ||
name: Test or Release | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
test-or-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Sources | ||
uses: actions/checkout@v2 | ||
- name: Install Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 'lts/*' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install PNPM | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: '>=6' | ||
run_install: | | ||
- args: [--frozen-lockfile, --no-verify-store-integrity] | ||
- name: Test | ||
run: npm test | ||
- name: Publish | ||
uses: cycjimmy/semantic-release-action@v2 | ||
with: | ||
semantic_version: 18 | ||
branches: master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
.DS_Store | ||
node_modules | ||
nom-debug.log |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -4,6 +4,6 @@ | |
|
||
* Trim too long assert messages to prevent line overflow ([6f9b1fb](https://github.com/prantlf/astrobench/commit/6f9b1fb2c6262115608e3392bd65f6e3957530d3)) | ||
* Upgrade npm modules, which were possible ([fb949e](https://github.com/prantlf/astrobench/commit/fb949e553b181092047961194d732b0a281d5deb)) | ||
* switch sprintf out for sprintf-js (Chris Apparicio <[email protected]>) ([1bb6b6e](https://github.com/prantlf/astrobench/commit/1bb6b6e7c2d1fe0770d4df70ade03e79b078d530)) | ||
* Switch `sprintf` out for `sprintf-js` (Chris Apparicio <[email protected]>) ([1bb6b6e](https://github.com/prantlf/astrobench/commit/1bb6b6e7c2d1fe0770d4df70ade03e79b078d530)) | ||
|
||
This is the first version released after forking the [original project](https://github.com/substack/faucet). |
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,26 @@ | ||
TAP version 13 | ||
ok - created Board | ||
ok | ||
ok | ||
ok | ||
ok | ||
ok | ||
ok | ||
ok | ||
--- | ||
message: "Board layout" | ||
severity: comment | ||
dump: | ||
board: | ||
- ' 16G 05C ' | ||
- ' G N C C C G ' | ||
- ' G C + ' | ||
- '10C 01G 03C ' | ||
- 'R N G G A G C C C ' | ||
- ' R G C + ' | ||
- ' 01G 17C 00C ' | ||
- ' G A G G N R R N R ' | ||
- ' G R G ' | ||
... | ||
ok - board has 7 tiles + starter tile | ||
1..9 |
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,4 @@ | ||
TAP version 13 | ||
1..573 | ||
not ok 1 - database handle | ||
Bail out! Couldn't connect to database. |
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,6 @@ | ||
TAP version 13 | ||
1..4 | ||
ok 1 - Creating test program | ||
ok 2 - Test program runs, no error | ||
not ok 3 - infinite loop # TODO halting problem unsolved | ||
not ok 4 - infinite loop 2 # TODO halting problem unsolved |
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,17 @@ | ||
TAP version 13 | ||
1..4 | ||
ok 1 - Input file opened | ||
not ok 2 - First line of the input valid | ||
--- | ||
message: 'First line invalid' | ||
severity: fail | ||
data: | ||
got: 'Flirble' | ||
expect: 'Fnible' | ||
... | ||
ok 3 - Read the rest of the file | ||
not ok 4 - Summarized correctly # TODO Not written yet | ||
--- | ||
message: "Can't make summary yet" | ||
severity: todo | ||
... |
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 @@ | ||
TAP version 13 | ||
1..5 | ||
ok 1 - approved operating system | ||
# $^0 is solaris | ||
ok 2 - # SKIP no /sys directory | ||
ok 3 - # SKIP no /sys directory | ||
ok 4 - # SKIP no /sys directory | ||
ok 5 - # SKIP no /sys directory |
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,2 @@ | ||
TAP version 13 | ||
1..0 # skip because English-to-French translator isn't installed |
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,18 @@ | ||
TAP version 13 | ||
ok 1 - retrieving servers from the database | ||
# need to ping 6 servers | ||
ok 2 - pinged diamond | ||
ok 3 - pinged ruby | ||
not ok 4 - pinged saphire | ||
--- | ||
message: 'hostname "saphire" unknown' | ||
severity: fail | ||
... | ||
ok 5 - pinged onyx | ||
not ok 6 - pinged quartz | ||
--- | ||
message: 'timeout' | ||
severity: fail | ||
... | ||
ok 7 - pinged gold | ||
1..7 |
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,7 @@ | ||
TAP version 13 | ||
1..6 | ||
not ok | ||
ok | ||
not ok | ||
ok | ||
ok |
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,9 @@ | ||
TAP version 14 | ||
1..2 | ||
|
||
# skip: true | ||
ok 1 - do it later # Skipped | ||
|
||
# skip: true | ||
# skip reason: "only run on windows" | ||
ok 2 - works on windows # Skipped: only run on windows |
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,15 @@ | ||
TAP version 14 | ||
|
||
# skip: true | ||
# skip reason: "this test is skipped" | ||
# description: "" | ||
ok 1 # skip this test is skipped | ||
|
||
# skip: false | ||
# description: "not skipped: https://example.com/page.html\#skip is a url" | ||
ok 2 not skipped: https://example.com/page.html#skip is a url | ||
|
||
# skip: true | ||
# skip reason: "case insensitive, so this is skipped" | ||
# description: "" | ||
ok 3 - #SkIp case insensitive, so this is skipped |
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,12 @@ | ||
TAP version 14 | ||
1..6 | ||
# | ||
# Create a new Board and Tile, then place | ||
# the Tile onto the board. | ||
# | ||
ok 1 - The object isa Board | ||
ok 2 - Board size is zero | ||
ok 3 - The object isa Tile | ||
ok 4 - Get possible places to put the Tile | ||
ok 5 - Placing the tile produces no error | ||
ok 6 - Board size is 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
TAP version 14 | ||
ok - created Board | ||
ok | ||
ok | ||
ok | ||
ok | ||
ok | ||
ok | ||
ok | ||
--- | ||
message: "Board layout" | ||
severity: comment | ||
dump: | ||
board: | ||
- ' 16G 05C ' | ||
- ' G N C C C G ' | ||
- ' G C + ' | ||
- '10C 01G 03C ' | ||
- 'R N G G A G C C C ' | ||
- ' R G C + ' | ||
- ' 01G 17C 00C ' | ||
- ' G A G G N R R N R ' | ||
- ' G R G ' | ||
... | ||
ok - board has 7 tiles + starter tile | ||
1..9 |
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,35 @@ | ||
TAP version 14 | ||
|
||
# description: hello | ||
# todo: true | ||
ok 1 - hello # todo | ||
|
||
# description: hello # todo | ||
# todo: false | ||
ok 2 - hello \# todo | ||
|
||
# description: hello | ||
# todo: true | ||
# todo reason: hash # character | ||
ok 3 - hello # todo hash \# character | ||
# (assuming "character" isn't a known custom directive) | ||
ok 4 - hello # todo hash # character | ||
|
||
# description: hello \ | ||
# todo: true | ||
# todo reason: hash # character | ||
ok 5 - hello \\# todo hash \# character | ||
# (assuming "character" isn't a known custom directive) | ||
ok 6 - hello \\# todo hash # character | ||
|
||
# description: hello # description # todo | ||
# todo: false | ||
# (assuming "description" isn't a known custom directive) | ||
ok 7 - hello # description # todo | ||
|
||
# multiple escaped \ can appear in a row | ||
# description: hello \\\# todo | ||
# todo: false | ||
ok 8 - hello \\\\\\\# todo | ||
|
||
1..8 |
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,4 @@ | ||
TAP version 14 | ||
1..573 | ||
not ok 1 - database handle | ||
Bail out! Couldn't connect to database. |
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,17 @@ | ||
TAP version 14 | ||
1..4 | ||
ok 1 - Input file opened | ||
not ok 2 - First line of the input valid | ||
--- | ||
message: 'First line invalid' | ||
severity: fail | ||
data: | ||
got: 'Flirble' | ||
expect: 'Fnible' | ||
... | ||
ok 3 - Read the rest of the file | ||
not ok 4 - Summarized correctly # TODO Not written yet | ||
--- | ||
message: "Can't make summary yet" | ||
severity: todo | ||
... |
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,10 @@ | ||
TAP version 14 | ||
# tell the parser to bail out on any failures from now on | ||
pragma +bail | ||
|
||
# tell the parser to execute in strict mode, treating any invalid TAP | ||
# line as a test failure. | ||
pragma +strict | ||
|
||
# turn off a feature we don't want to be active right now | ||
pragma -bail |
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,6 @@ | ||
TAP version 14 | ||
1..4 | ||
ok 1 - Creating test program | ||
ok 2 - Test program runs, no error | ||
not ok 3 - infinite loop # TODO halting problem unsolved | ||
not ok 4 - infinite loop 2 # TODO halting problem unsolved |
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 @@ | ||
TAP version 14 | ||
1..5 | ||
ok 1 - approved operating system | ||
# $^0 is solaris | ||
ok 2 - # SKIP no /sys directory | ||
ok 3 - # SKIP no /sys directory | ||
ok 4 - # SKIP no /sys directory | ||
ok 5 - # SKIP no /sys directory |
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,2 @@ | ||
TAP version 14 | ||
1..0 # skip because English-to-French translator isn't installed |
Oops, something went wrong.