Skip to content

Add test result publishing to GitHub Actions workflows#26

Merged
IvanMurzak merged 3 commits into
mainfrom
copilot/add-github-action-tests-output
Nov 9, 2025
Merged

Add test result publishing to GitHub Actions workflows#26
IvanMurzak merged 3 commits into
mainfrom
copilot/add-github-action-tests-output

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 9, 2025

Plan for Implementing GitHub Action Test Output

  • Update .github/workflows/pull_request.yml to:

    • Add TRX logger to test command
    • Add EnricoMi/publish-unit-test-result-action@v2 step to publish test results
    • Ensure proper permissions for the action
  • Update .github/workflows/release.yml to:

    • Add TRX logger to test command
    • Add EnricoMi/publish-unit-test-result-action@v2 step to publish test results
    • Ensure proper permissions for the action
  • Fix TRX file size issue

Summary of Changes

Both workflow files have been updated with:

  1. Permissions: Added necessary permissions for the action:

    • checks: write - Required to create check runs with test results
    • pull-requests: write - Required to comment on PRs with test results
    • contents: read/write - For repository access
  2. Test Command: Modified to generate TRX test result files:

    • Changed from --logger "trx;LogFileName=test-results.trx" to --logger trx
    • This allows dotnet to create separate TRX files for each target framework (net8.0, net9.0) with unique names
  3. Publish Test Results Step: Added new step using EnricoMi/publish-unit-test-result-action@v2:

    • Runs even if tests fail (if: always())
    • Collects all TRX files from **/TestResults/*.trx pattern
    • Creates a check named "Test Results" with detailed test information
    • Added large_files: true to enable XML_PARSE_HUGE for handling large TRX files

Fix for TRX File Size Issue

The initial implementation was generating a single combined TRX file that exceeded 32MB and 450,000 lines when running tests for multiple target frameworks. This caused the error:

Resource limit exceeded: Text node too long, try XML_PARSE_HUGE

The fix:

  • Removed the explicit LogFileName parameter to allow dotnet test to create separate TRX files per target framework
  • Added large_files: true parameter to the publish action to enable XML_PARSE_HUGE parsing option
Original prompt

This section details on the original issue you should resolve

<issue_title>Implement GitHub Action tests output</issue_title>
<issue_description>Need to print tests results in a readable form using EnricoMi/publish-unit-test-result-action@v2.

  • Update .github/workflows/pull_request.yml
  • Update .github/workflows/release.yml</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: IvanMurzak <9135028+IvanMurzak@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 9, 2025

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
1 files    0 ❌
1 errors

For more details on these parsing errors, see this check.

Results for commit fca9656.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 9, 2025

Test Results

    2 files      2 suites   1m 18s ⏱️
  541 tests   541 ✅ 0 💤 0 ❌
1 082 runs  1 082 ✅ 0 💤 0 ❌

Results for commit b9930ee.

♻️ This comment has been updated with latest results.

Copilot AI changed the title [WIP] Add GitHub Action tests output for readable results Add test result publishing to GitHub Actions workflows Nov 9, 2025
Copilot AI requested a review from IvanMurzak November 9, 2025 09:35
@IvanMurzak
Copy link
Copy Markdown
Owner

@copilot The job fails with this output.

Error processing result file

Resource limit exceeded: Text node too long, try XML_PARSE_HUGE, line 254178, column 215 (test-results.trx, line 254178

…ault logger

Co-authored-by: IvanMurzak <9135028+IvanMurzak@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 9, 2025

@copilot The job fails with this output.

Fixed in b9930ee. Changed the test logger to use --logger trx (without specifying a filename) so dotnet creates separate TRX files for each target framework, and added large_files: true to the publish action to enable XML_PARSE_HUGE for handling large test result files.

@IvanMurzak IvanMurzak marked this pull request as ready for review November 9, 2025 09:49
Copy link
Copy Markdown
Owner

@IvanMurzak IvanMurzak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@IvanMurzak IvanMurzak merged commit 8b4bd1f into main Nov 9, 2025
3 checks passed
@IvanMurzak IvanMurzak deleted the copilot/add-github-action-tests-output branch November 9, 2025 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement GitHub Action tests output

2 participants