nasamin / trx-parser Goto Github PK
View Code? Open in Web Editor NEWThis repository contains a Typescript GitHub action for parsing trx files and creating status check for each trx file based on its test outcome
License: MIT License
This repository contains a Typescript GitHub action for parsing trx files and creating status check for each trx file based on its test outcome
License: MIT License
I have 2 workflows "DevBuild.yml" and "RunTests.yml"(Both are dependent, executes one after other) .
I am using TRX parser in "RunTests.yml", but it is showing showing parsed tests results report under "DevBuild.yml" and some times in "RunTest.yml" .
Fix it if it a bug
Asked In Community as well
https://github.community/t/getting-job-results-of-workflow-2-in-workflow-1-how-to-fix-this/168499
The trx-parser
only creates a status check on pull request event.
So when you merge your changes to the default branch, no checks are created on the build.
Currently, if you have multiple workflows in your CI, this action randomly puts the check in one of those workflows.
This sometimes causing the PR to be blocked even if the check passes because it can't find the check (presumably).
What should really happen is this action should create a separate check suite (name TBD).
This issue is to explore some options and find out why the check is created in ramdom workflows and create a separate check suit outside of workflows.
But what should happen on pushes and non PR workflow. Can a separate check suit be created on pushes. If not then where should the check be? Because we still want to fail the pipeline if there is a failure.
Getting the following error, any idea?
https://github.com/mocsharp/clara-dicom-adapter/runs/1663835318?check_suite_focus=true
Run NasAmin/[email protected]
with:
TRX_PATH: /home/runner/work/clara-dicom-adapter/clara-dicom-adapter/test-results
REPO_TOKEN: ***
IGNORE_FAILURE: false
Finding Trx files in: /home/runner/work/clara-dicom-adapter/clara-dicom-adapter/test-results
Files count: 10
Processing 7 trx files
Transforming file /home/runner/work/clara-dicom-adapter/clara-dicom-adapter/test-results/_3860a79a0dda_2021-01-07_16_58_06.trx
Error: Cannot read property '_storage' of undefined
Workflow on windows is running very slowly.
Investigate why and possibly use the cache
action to speed things up
Could be related to actions/runner-images#5158
If I wanted to use this action in a workflow triggered by workflow_run
then the current sha defaults to main/master.
I'd like to be able to pass in github.event.workflow_run.head_sha instead (as that would be the sha from the original workflow who's completion caused the current workflow to run.
trx-parser is not configurable for whether to break the workflow or proceed further in case of test failures, rather all the following steps/jobs get executed regardless of test status.
It would give more control to a developer if trx-parser can be configured based on some input parameters such as BREAK_ON_TEST_FAILURE with boolean values or similar.
Line 36 in 08fc31d
Hi, are you planning to update this action to run on Node 20 per https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/ ?
Node.js 12 actions are deprecated, is there an already released version that uses Node.js 16?
when there's no test detected in the trx.
Error: Cannot read property 'UnitTest' of undefined
is thrown
example trx:
<?xml version="1.0" encoding="utf-8"?>
<TestRun id="42bf458b-ce32-46d6-8e27-0560a086d144" name="Cheng@CHENG-PC-SSD 2021-02-18 18:07:52" runUser="CHENG-PC-SSD\Cheng" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Times creation="2021-02-18T18:07:52.0946403-05:00" queuing="2021-02-18T18:07:52.0946418-05:00" start="2021-02-18T18:07:49.7128282-05:00" finish="2021-02-18T18:07:52.0960517-05:00" />
<TestSettings name="default" id="df32bb72-e474-448b-8dae-bcc400803a90">
<Deployment runDeploymentRoot="Cheng_CHENG-PC-SSD_2021-02-18_18_07_52" />
</TestSettings>
<TestLists>
<TestList name="Results Not in a List" id="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestList name="All Loaded Results" id="19431567-8539-422a-85d7-44ee4e166bda" />
</TestLists>
<ResultSummary outcome="Completed">
<Counters total="0" executed="0" passed="0" failed="0" error="0" timeout="0" aborted="0" inconclusive="0" passedButRunAborted="0" notRunnable="0" notExecuted="0" disconnected="0" warning="0" completed="0" inProgress="0" pending="0" />
<Output>
<StdOut>blabla
</StdOut>
</Output>
<RunInfos>
<RunInfo computerName="CHENG-PC-SSD" outcome="Warning" timestamp="2021-02-18T18:07:51.9559154-05:00">
<Text>No test matches the given testcase filter `UnitTests` in C:\blabla\test\bin\Debug\net5.0\blabla.dll</Text>
</RunInfo>
</RunInfos>
</ResultSummary>
</TestRun>
I am kicking the tires on this action using a project with about 1000 tests. Unfortunately it fails. Any suggestions?
Finding Trx files in: /home/runner/work/mit-yousee-odin-api/mit-yousee-odin-api/TestResults
Files count: 1
Processing 1 trx files
Transforming file /home/runner/work/mit-yousee-odin-api/mit-yousee-odin-api/TestResults/_fv-az186-920_2020-12-28_08_37_52.trx
Checking for failing tests
Creating PR check for ODINAPI SELFCARE.TESTS
Creating status check for GitSha: 97c859732655f4633222f0db3b6483c07ab21e70 on a push event
Check time is: Mon, 28 Dec 2020 08:38:34 GMT
Error: Invalid request.
Only 65535 characters are allowed; 1607778 were supplied.
Been running into some issues with this action and Dependabot PR's, when uploading the test result to the GH API. I've got a organization level token specified ,(ORG_GITHUB_TOKEN) as the REPO_TOKEN parameter, since Dependabot does not have access to GITHUB-TOKEN but get the following errror
Syntax
- name: Parse Trx files
uses: NasAmin/[email protected]
id: trx-parser
if: always()
with:
TRX_PATH: ${{ github.workspace }}/TestResults
REPO_TOKEN: ${{ secrets.ORG_GITHUB_TOKEN }}
Error
....
Creating PR check for ORBIT UNITTESTS
Creating status check for GitSha: c040653ee8bead3071fee97ac7d27f52[18](https://github.com/...api/runs/5380650173?check_suite_focus=true#step:7:18)6c681d on a pull request event
Check time is: Tue, 01 Mar 2022 [19](https://github.com/...api/runs/5380650173?check_suite_focus=true#step:7:19):09:12 GMT
Error: Resource not accessible by integration
....
Should Dependabot not be able to write to GH API with this?
Currently this Action takes the name of the underlying assembly for each trx parser and make that the title of the report and the name of the status check.
In some cases where you want to run the same tests in multiple environments e.g. Dev and staging. In such cases there is one status check created. To support some seggregation between different test runs in the same workflow, a prefix should be allowed e.g. dev-
or staging
Here is a repo that is being tested on multiple operating systems (ubuntu-latest
, macos-latest
, and windows-latest
),
https://github.com/lextudio/sharpsnmplib/runs/4499386025?check_suite_focus=true
and you can see the reports from Ubuntu and macOS have the same name so in the end only one report is showed.
The algorithm should be improved such as adding the job name to report names.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.