-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
Fails if XML file other than NUnit format is output to artifactsPath #285
Comments
@coderabbitai, please review the file located at src/model/results-check.ts. There is an issue where files with a “.xml” extension, not in NUnit format, are causing errors when processed. Can you suggest a fix for this? |
Tip For best results, initiate chat on the files or code changes. @GabLeRoux, I see the issue in To fix this, you can modify the code to handle parsing errors gracefully by wrapping the parsing logic in a // Parse all results files
const runs: RunMeta[] = [];
const files = fs.readdirSync(artifactsPath);
await Promise.all(
files.map(async filepath => {
if (!filepath.endsWith('.xml')) return;
core.info(`Processing file ${filepath}...`);
try {
const fileData = await ResultsParser.parseResults(path.join(artifactsPath, filepath));
core.info(fileData.summary);
runs.push(fileData);
} catch (error) {
core.warning(`Failed to parse ${filepath}: ${error.message}`);
// Optionally handle the error or skip the file
}
}),
); By adding the Let me know if this helps! 🔗 Analysis chain🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Output the contents of src/model/results-check.ts
cat src/model/results-check.ts
Length of output: 4227 |
Thanks!! |
Bug description
Fails if XML file other than NUnit format is output to artifactsPath.
How to reproduce
Test outputs a file with a ".xml" extension other than the NUnit format.
Expected behavior
Ignore non-test result XML files.
Additional details
unity-test-runner/src/model/results-check.ts
Lines 21 to 28 in 05a00ef
The text was updated successfully, but these errors were encountered: