8000 Fix for empty TRX TestDefinitions by OlesGalatsan · Pull Request #582 · dorny/test-reporter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix for empty TRX TestDefinitions #582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 17, 2025

Conversation

OlesGalatsan
Copy link
Contributor

This PR is a fix for phoenix-actions/test-reporting#64 that is also relevant for this action.
Currently, this action only checks if TestDefinitions are not defined, but it is possible that it will just be empty:

<?xml version="1.0" encoding="utf-8"?>
<TestRun id="f4386078-5371-420d-b9c6-122f1e77f109" name="test" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
  <Times creation="2025-05-13T12:53:18.295323Z" queuing="2025-05-13T12:53:18.295323Z" start="2025-05-13T12:53:18.295323Z" finish="2025-05-13T12:53:18.4362393Z" />
  <TestSettings name="default" id="f25a2621-1af4-4d50-a859-619a3039691e">
    <Deployment runDeploymentRoot="test" />
  </TestSettings>
  <Results />
  <TestDefinitions />
  <TestEntries />
  <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" />
  </ResultSummary>
</TestRun>

In order to fix it, we need to check if td.UnitTest exists and is an array for it to be then parsed.
Test run: https://github.com/OlesGalatsan/MstTrx/actions/runs/15045476377

@jozefizso
Copy link
Collaborator

Hi @OlesGalatsan, thanks for contributing this fix.

Could you please also create new integration test for this situation?

@jozefizso jozefizso self-assigned this May 15, 2025
@OlesGalatsan
Copy link
Contributor Author
OlesGalatsan commented May 16, 2025

Hello @jozefizso, I've added the integration test for this case, so it should be good now.
And one small question - do you by any chance know when the new version with all the latest changes can be released?

@jozefizso jozefizso added the enhancement New feature or request label May 17, 2025

@jozefizso jozefizso merged commit d1bf678 into dorny:main May 17, 2025
2 checks passed
@jozefizso
Copy link
Collaborator

@OlesGalatsan The v2.1.0 is released now.

@OlesGalatsan OlesGalatsan deleted the bugfix/empty-trx-test-definitions branch May 19, 2025 12:03
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.

2 participants
0