Skip to content

Comments

Fix for empty TRX TestDefinitions#66

Open
OlesGalatsan wants to merge 1 commit intophoenix-actions:mainfrom
OlesGalatsan:bugfix/empty-trx-test-definitions
Open

Fix for empty TRX TestDefinitions#66
OlesGalatsan wants to merge 1 commit intophoenix-actions:mainfrom
OlesGalatsan:bugfix/empty-trx-test-definitions

Conversation

@OlesGalatsan
Copy link

@OlesGalatsan OlesGalatsan commented May 14, 2025

This PR is a fix for #64
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/15017567979

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant