cffconvert-github-action
cffconvert-github-action copied to clipboard
Test for actual output, not just exit code
The tests in https://github.com/citation-file-format/cffconvert-github-action/blob/a73af040d6aeb196ca0f696e6fdcc72663c5a96b/.github/workflows/selftest.yml test for exit code. It would be better if we can test for their actual output.
How do we test a solution? Pushing and checking?
Maybe using https://github.com/nektos/act?
Not sure what would be a good way to do this, maybe @sverhoeven can help?
You could capture the stdout and compare it with a expected output using https://man7.org/linux/man-pages/man1/comm.1.html
We are having issues capturing the stdout.
The args:
passed can't have a > output
because the docker cffconvert thinks it is an argument. From what I saw, Faruk and Jurrian tried to get the output from the actions interface, but also could not find a way.
Might need a composite
action.yml or perhaps setting a different entrypoint
(to a script that captures the dockerized cffconvert's stdout) could also work:
- https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-actions
- https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runsentrypoint
Testing @nlescgt