Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not appear to do anything #2

Closed
ensonic opened this issue Feb 10, 2024 · 8 comments
Closed

Does not appear to do anything #2

ensonic opened this issue Feb 10, 2024 · 8 comments
Assignees
Milestone

Comments

@ensonic
Copy link

ensonic commented Feb 10, 2024

I get this output:

Run pcolby/tap-summary@v1
  with:
    path: /tmp/*.tap
  
    summary-file: tap_summary.md
Run set -o errexit -o noclobber -o nounset -o pipefail
  set -o errexit -o noclobber -o nounset -o pipefail
  [[ -z "$(shopt globstar [2](https://github.com/Buzztrax/buzztrax/actions/runs/7856445010/job/21439210478#step:9:2)> /dev/null)" ]] && echo 'Shell does not support globstar' || shopt -s globstar
  : "${SUMMARY_FILE:=$GITHUB_STEP_SUMMARY}"
  gawk --file "$GITHUB_ACTION_PATH/summary.gawk" --sandbox -- /tmp/*.tap
   >> "$SUMMARY_FILE"
  echo "summary-file=$SUMMARY_FILE" >> "$GITHUB_OUTPUT"
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    SUMMARY_FILE: tap_summary.md
|       Test result       | Passed | Failed | Skipped | Test name |
|:------------------------|-------:|-------:|--------:|:---|
| :heavy_check_mark: pass |      0 |      0 |       0 | 2  |
| :heavy_check_mark: pass |      0 |      0 |       0 | ok |

example tap file from /tmp/*.tap (you can download the artifact.zip from the linked build too):

ok 1 - tests/lib/bml/e-core.c:BmlCoreExamples:test_bml_setup: Passed
ok 2 - tests/lib/bml/e-core.c:BmlCoreExamples:test_bml_finalize: Passed
ok 3 - tests/lib/bml/e-core.c:BmlCoreExamples:test_bmln_master_info: Passed
ok 4 - tests/lib/bml/e-core.c:BmlCoreExamples:test_bmln_open: Passed
ok 5 - tests/lib/bml/e-class.c:BmlClassExamples:test_bmln_get_machine_info: Passed
1..5
@pcolby
Copy link
Owner

pcolby commented Feb 11, 2024

Thanks @ensonic, I'll take a look 🙂

@pcolby pcolby self-assigned this Feb 11, 2024
pcolby added a commit that referenced this issue Feb 11, 2024
In preparation for adding a test suite for issue #2.
@pcolby
Copy link
Owner

pcolby commented Feb 11, 2024

Hey @ensonic, I've just released v1.1.0 which has better support for vanilla TAP files (as opposed to those created by QtTest).

You can see in this build (I forked the commit from the build you linked above), the output is now:

|       Test result       | Passed | Failed | Skipped | Test name   |
|:------------------------|-------:|-------:|--------:|:------------|
| :heavy_check_mark: pass |      5 |      0 |       0 | bml.log     |
| :heavy_check_mark: pass |      6 |      0 |       0 | bt_cmd.log  |
| :x:                fail |    320 |      5 |       0 | bt_core.log |
| :x:                fail |      3 |    110 |       0 | bt_edit.log |
| :heavy_check_mark: pass |     95 |      0 |       0 | bt_gst.log  |
| :heavy_check_mark: pass |     15 |      0 |       0 | bt_ic.log   |

Which renders in the Workflow run summary like:

Test result Passed Failed Skipped Test name
✔️ pass 5 0 0 bml.log
✔️ pass 6 0 0 bt_cmd.log
❌ fail 320 5 0 bt_core.log
❌ fail 3 110 0 bt_edit.log
✔️ pass 95 0 0 bt_gst.log
✔️ pass 15 0 0 bt_ic.log

You will need to use the v1.1.0 or later tag. v1.1 and v1 have been updated to point to this version too, so any of those will work.

PS Thanks for a great bug report including the build with downloadable artifacts - make it much easier. I hope you don't mind, but I've included your build's TAP files in my automated tests.

Cheers.

@pcolby pcolby added this to the v1.1.0 milestone Feb 11, 2024
@ensonic
Copy link
Author

ensonic commented Feb 11, 2024

Thanks for the quick fix. Just switching back to your reporter (in Buzztrax/buzztrax@5de1028).
It works! I'll need to figure out how to show the generated summary at the end of the run like you do (https://github.com/pcolby/tap-summary/actions/runs/7861129078) next.

FYI I am using libcheck for the unit tests - in case you want to track the producers.

@ensonic ensonic closed this as completed Feb 11, 2024
@pcolby
Copy link
Owner

pcolby commented Feb 15, 2024 via email

@pcolby
Copy link
Owner

pcolby commented Feb 16, 2024

Hey @ensonic, I see now why the table appears in our workflow log, and not the summary. It's because you've used folder block scalar, and not chomped the trailing newline in your path property.

That is, as per the example in the README.md, instead of:

      with:
        path: |
          /tmp/*.tap
          /tmp/*.tap

You should:

      with:
        path: >-
          /tmp/*.tap
          /tmp/*.tap

I'll see if I can add some logic to catch that mistake, but might be a bit tricky without affecting Bash's globstar support 🤔 In the meantime, just replace | with >-. Cheers.

@pcolby
Copy link
Owner

pcolby commented Feb 16, 2024

@ensonic, the new 1.1.1 release should now handle any block scalar types. Since you're using the @v1 tag, you should pick up the fix in your next (re-)build. Cheers :D

Edit: You can see an example of the output from my fork of your repo, after rebuilding with no changes (because the tap-summary@v1 tag has moved forward) here: https://github.com/pcolby/buzztrax/actions/runs/7861379079#summary-21637346108

image

Cheers.

@ensonic
Copy link
Author

ensonic commented Feb 16, 2024

Thanks for the help. I yesterday added a step to cat the summary to $GITHUB_STEP_SUMMARY and that was what was missing to show the summary. Would it be a useful addition to you README? e.g. suggesting this in a minimal example:

    - name: Output test results
      if: always()
      run: cat test_summary.md >> $GITHUB_STEP_SUMMARY   

@ensonic
Copy link
Author

ensonic commented Feb 16, 2024

By the way, the build step typically takes just under 40 minutes... I'm not too familiar with your test framework, but is there a tweak I can make to just have a subset of tests built? I still want one or more tap files produced, but don't want the full test suite run - just to speed up the my experiment cycles :)

It is normally much faster, we just ported from travis to github actions and the UI tests time out one by one. I'll try to disable them for the time being, when it runs on github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants