Skip to content

Use TestResults library for result file generation#74

Merged
Malcolmnixon merged 4 commits intomainfrom
copilot/use-testresults-for-generation
Jan 28, 2026
Merged

Use TestResults library for result file generation#74
Malcolmnixon merged 4 commits intomainfrom
copilot/use-testresults-for-generation

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

Pull Request

Description

Replaces custom TRX generation with DemaConsulting.TestResults library. Adds JUnit XML format support with automatic format detection based on file extension.

Changes

  • Added dependency: DemaConsulting.TestResults 1.4.0 NuGet package
  • Replaced manual XML generation: Removed ~110 lines of XElement-based TRX construction in TestResults.SaveToTrx() with library serializers
  • Multi-format support:
    • .xml extension → JUnit XML format via JUnitSerializer
    • .trx or other extensions → TRX format via TrxSerializer
    • Format detection in new SaveResults(string fileName) method
  • Backward compatibility: Kept SaveToTrx() as wrapper to SaveResults()
  • Parameter validation: Added null/empty checks with ArgumentException

Usage

var results = new TestResults("TestRun", "CodeBase");
// ... add test results ...

// TRX format
results.SaveResults("results.trx");

// JUnit format  
results.SaveResults("results.xml");

// Backward compatible
results.SaveToTrx("legacy.trx");

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Code quality improvement

Related Issues

Issue linking handled separately.

Pre-Submission Checklist

Build and Test

  • Code builds successfully: dotnet build --configuration Release
  • All tests pass: dotnet test --configuration Release (90 tests passing)
  • Code produces zero warnings

Code Quality

  • Code formatting is correct: dotnet format --verify-no-changes
  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

  • Spell checker passes: cspell "**/*.{md,cs}"
  • Markdown linter passes: markdownlint "**/*.md"
  • YAML linter passes: yamllint '**/*.{yml,yaml}'

Testing

  • Added unit tests for new functionality (6 new tests)
  • Updated existing tests if behavior changed
  • All tests follow the AAA (Arrange, Act, Assert) pattern
  • Test coverage is maintained or improved

Documentation

  • Updated README.md (if applicable)
  • Updated ARCHITECTURE.md (if applicable)
  • Added code examples for new features (if applicable)
  • Updated requirements.yaml (if applicable)

Additional Notes

  • Security scan (CodeQL): 0 vulnerabilities
  • NuGet advisory check: No vulnerabilities in DemaConsulting.TestResults 1.4.0
  • Both TRX and JUnit outputs validated with integration tests
Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature]: Use TestResults for result file generation</issue_title>
<issue_description>### Problem Statement

VHDLTest currently contains its own code to write TRX test result files. Instead the DemaConsulting.TestResults library should be used.

Proposed Solution

This should entail:

  • Adding the DemaConsulting.TestResults (https://github.com/demaconsulting/TestResults) 1.4.0 NuGet package from NuGet.org to the project
  • Updating all TRX result generation logic to instead use the TestResults library
  • Add support for both TRX and JUnit outputs based on the file extension - this would be both for normal test execution and for self-validation
  • Add additional unit tests for the JUnit serialization output

Alternatives Considered

No response

Usage Examples

Benefits

Replace TRX-writing logic with well-tested Dema Consulting library, and add support for additional results format.

Priority

Low - Nice to have

Willingness to Contribute

Yes, I can submit a pull request

Additional Context

No response

Checklist

  • I have searched existing issues to ensure this is not a duplicate
  • I have provided a clear description of the feature
  • I have explained why this feature would be useful</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.

Copilot AI and others added 3 commits January 28, 2026 19:45
… for TRX/JUnit

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title [WIP] Use DemaConsulting.TestResults for result file generation Use TestResults library for result file generation Jan 28, 2026
Copilot AI requested a review from Malcolmnixon January 28, 2026 19:57
@Malcolmnixon Malcolmnixon marked this pull request as ready for review January 28, 2026 20:54
@Malcolmnixon Malcolmnixon merged commit 4078620 into main Jan 28, 2026
51 of 53 checks passed
@Malcolmnixon Malcolmnixon deleted the copilot/use-testresults-for-generation branch January 28, 2026 20:54
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.

[Feature]: Use TestResults for result file generation

2 participants