Coder Social home page Coder Social logo

nasamin / trx-parser Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 16.0 3.39 MB

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

TypeScript 97.35% JavaScript 1.18% Shell 1.47%
trx-parser trx-testresults trx parser status-check dotnet github-actions

trx-parser's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

trx-parser's Issues

Status check not created on push

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.

This action should create a separate check suit

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.

Error: Cannot read property '_storage' of undefined

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

Support a 'sha' property to override which commit to associate with

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.

Workflow not failing if there are test failures

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.

Error: Cannot read property 'UnitTest' of undefined

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>

Error: Invalid request - only 65535 characters are allowed

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.

Dependabot and GH API access

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?

Add optional report prefix

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.