Skip to content

BenjaminMichaelis/trx-to-vsplaylist

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TRX to Playlist Converter Action

A GitHub Action that converts TRX (Visual Studio Test Results) files to Visual Studio Test playlist files. This action uses the trx-to-vsplaylist .NET global tool to perform the conversion and automatically uploads the generated playlist file as an artifact that can be easily downloaded from your GitHub Actions run.

Features

  • ✅ Converts TRX files to VS Test playlist files
  • ✅ Configurable output path
  • ✅ Customizable test outcome filtering

Usage

Basic Usage

- name: Convert TRX to Playlist
  uses: BenjaminMichaelis/trx-to-vsplaylist@v1
  with:
    trx-file-path: './TestResults/results.trx'

Advanced Usage

- name: Convert TRX to Playlist
  uses: BenjaminMichaelis/trx-to-vsplaylist@v1
  with:
    trx-file-path: './TestResults/results.trx'
    output-directory: './artifacts'
    test-outcomes: 'Failed,NotExecuted'
    skip-empty: false # disables skipping empty playlists

Complete Workflow Example

name: Test and Generate Playlist

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    
    steps:
    - uses: actions/checkout@v4
    
    - name: Setup .NET
      uses: actions/setup-dotnet@v4
      with:
        dotnet-version: '8.x'
    
    - name: Run Tests
      run: |
        dotnet test --logger trx --results-directory ./TestResults
    
    - name: Convert TRX to Playlist
      if: always() # Run even if tests fail
      uses: BenjaminMichaelis/trx-to-vsplaylist@v1
      with:
        trx-file-path: './TestResults/*.trx'
        test-outcomes: 'Failed'
    
    # The playlist file will be automatically uploaded as an artifact named either by the specified `artifact-name` or as `playlists`

Inputs

Input Description Required Default
trx-file-path Path to the TRX file to convert (supports glob patterns for multiple files) Yes -
output-directory Directory to write the output playlist file(s) to. If not specified, saves in the same directory as the TRX file with .playlist extension No -
test-outcomes Test outcomes to include in the playlist (comma-separated). Accepts: Passed, Failed, NotExecuted, Inconclusive, Timeout No Failed
artifact-name Name for the uploaded artifact. If not specified, will use the playlist file name (without extension) No playlist file name
skip-empty Skip writing out empty playlist files. If true, empty playlists will not be created. No true

Outputs

Output Description
playlist-path Path to the generated playlist file

Test Outcomes

The following test outcomes can be specified in the test-outcomes input:

  • Passed
  • Failed
  • NotExecuted
  • Inconclusive
  • Timeout
  • Pending

You can specify multiple outcomes by separating them with commas: Failed,NotExecuted,Timeout

Artifact Download

The generated playlist file is automatically uploaded as a workload artifact.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

If you encounter any issues or have questions, please open an issue on the GitHub repository.

About

Get a playlist of your .net test results; plug and play

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published