Comments (9)
Right, commit
is an "undocumented" argument (though it is in the README). This is just a warning in the logs.
What is your use-case, maybe it is worth "documenting" it in the actions.yml
.
from publish-unit-test-result-action.
Ah, gotcha.
Well for use case I'm using slash command dispatch to dispatch some jest tests. The comment is made on the PR (you would actually comment /test
on the PR), and want to report the results of the test. Since the test command is technically launched from a repository_dispatch
, there's no reference to the PR I want to comment on. I got around this by adding the git sha (of the HEAD of the PR branch) to the commit
argument so that way this publish package knew where to publish the reports.
I would be happy to post a simple example YAML of my workflow if that helps illustrate my example more.
from publish-unit-test-result-action.
Very interesting use-case, please add an example YAML file to see how this all wires together (especially the commit sha).
from publish-unit-test-result-action.
File that runs the jest tests:
name: Run jest tests
on:
repository_dispatch:
types: [e2e-command]
jobs:
test_local:
needs: build_local
runs-on: ubuntu-latest
steps:
# repository_dispatch doesn't have the correct $GITHUB_REF so we need to provide it
# first, get the name of the branch from the PR
- name: Github API Request
id: request
uses: octokit/[email protected]
with:
route: ${{ github.event.client_payload.github.payload.issue.pull_request.url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# then, check it out
- uses: actions/checkout@v2
with:
ref: ${{ fromJson(steps.request.outputs.data).head.ref }}
- name: Set up Node.js v13
uses: actions/setup-node@v1
with:
node-version: '13.x'
- name: Node install dependencies
uses: bahmutov/npm-install@v1
- name: Run tests
run: |
npm run serve &
npm test ${{ github.event.client_payload.slash_command.args.unnamed.all }}
- name: Publish test results
uses: EnricoMi/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: test/results/*.xml
report_individual_runs: true
commit: ${{ fromJson(steps.request.outputs.data).head.sha }}
Dispatch file:
name: Slash Command Dispatch
on:
issue_comment:
types: [created]
jobs:
slashCommandDispatch:
runs-on: ubuntu-latest
steps:
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v2
with:
token: ${{ secrets.PAT }}
commands: |
e2e
Then, in a PR, you can comment /e2e xxx
to run npm test xxx
. The comment will launch the dispatch file which in turn will do a repository dispatch action of type e2e-command.
from publish-unit-test-result-action.
This is an excellent use case for the commit
argument. I am glad I haven't removed it. Thanks for the reference yaml, I find this is a very useful setup.
Please try the action from this branch:
uses: EnricoMi/publish-unit-test-result-action@branch-commit-arg-in-action-yaml
Let me know if the warning goes away.
from publish-unit-test-result-action.
@RyanSchw any chance to test the action from this branch?
from publish-unit-test-result-action.
I lost access to the repo that was running that CICD pipeline. I think the warning went away when it ran, though. Sorry I canβt be more helpful.
from publish-unit-test-result-action.
Thanks for insights, fix is merged!
from publish-unit-test-result-action.
can I get reports in comment for a workflow_dispatch event? I've also mentioned the commit parameter as head SHA of PR? Should I mentioning it as head of workflow event?
from publish-unit-test-result-action.
Related Issues (20)
- Wrong duration using Mocha and the JSON reporter HOT 2
- Add support for publishing check to different Github repository HOT 1
- TAP support? HOT 2
- getting error "Key is not specified"
- Check is put into the wrong workflow group HOT 4
- Support node-tap XML HOT 2
- How do I disable checks? i.e. just get red/green step/job/workflow based on unit test results HOT 6
- Can't run on windows with python 3.11>> because lxml fails to build HOT 3
- ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied HOT 7
- No more test results in the pull request since 2.9.0 HOT 3
- Getting error " CData section too big found, line 357183, column 7 (TESTS-TestSuites.xml, line 357183)" HOT 2
- Publish arm images HOT 4
- Publish test results task is not working due to test result XML not being found HOT 2
- Action fails if comment made by user whose account has been deleted prior to merge HOT 2
- Test Results are not shown in workflow run job list HOT 15
- action_fail_on_inconclusive passed with just a warning annotation HOT 11
- Remove symbols links HOT 2
- Support Maven Surefire Plugin rerunning flaky tests HOT 7
- Add support for TRX StdOut-Element HOT 3
- Option "check_run" not recognized HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from publish-unit-test-result-action.