Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,16 @@
bin/
obj/
TestResults/

# Code coverage reports
coverage/
*.coverage
*.coveragexml
*.opencover.xml

# Test results
*.trx

# Temporary files
*.tmp
.DS_Store
58 changes: 57 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,11 @@ cspell "**/*.{md,cs}"
# Run markdown linter (requires npm install -g markdownlint-cli)
markdownlint "**/*.md"

# Format code (if format tools are installed)
# Format code
dotnet format

# Verify formatting
dotnet format --verify-no-changes
```

## Testing Guidelines
Expand Down Expand Up @@ -226,6 +229,7 @@ All builds must pass:
5. Update XML documentation
6. Update README.md with usage examples
7. Run all tests and ensure they pass
8. Complete pre-finalization quality checks (see below)

### Fixing a Bug

Expand All @@ -234,6 +238,7 @@ All builds must pass:
3. Ensure the test now passes
4. Verify no other tests are broken
5. Update documentation if the bug fix changes behavior
6. Complete pre-finalization quality checks (see below)

### Improving Code Quality

Expand All @@ -243,13 +248,63 @@ All builds must pass:
4. Improve naming and clarity
5. Add missing documentation
6. Verify all tests still pass
7. Complete pre-finalization quality checks (see below)

### Updating Dependencies

1. Check dependency versions in .csproj files
2. Update to latest stable versions when appropriate
3. Test thoroughly after updates
4. Update documentation if APIs changed
5. Complete pre-finalization quality checks (see below)

## Pre-Finalization Quality Checks

Before marking any task as complete and finalizing your session, you **MUST** run the following quality checks in this order:

### 1. Build and Test Validation

```bash
# Build the project
dotnet build --configuration Release

# Run all tests
dotnet test --configuration Release
```

All builds must complete with zero warnings and all tests must pass.

### 2. Code Review

Use the **code_review** tool to get automated feedback on your changes:

- Review all comments and suggestions
- Address relevant feedback
- If significant changes are made, run code_review again

### 3. Security Scanning

Use the **codeql_checker** tool to scan for security vulnerabilities:

- This tool must be run after code_review is complete
- Investigate all alerts discovered
- Fix any alerts that require localized changes
- Re-run codeql_checker after fixes to verify
- Include a Security Summary with any unfixed vulnerabilities

### Quality Check Workflow

The complete workflow before task completion:

1. Make code changes
2. Run build and tests → Fix any issues
3. Run code_review tool → Address relevant feedback
4. Run codeql_checker tool → Fix security issues
5. If significant changes were made, repeat steps 2-4
6. Report progress with final commit
7. Complete task

**Note**: Only proceed to finalize your task after all quality checks pass and all issues are addressed.

## Boundaries and Guardrails

Expand All @@ -270,6 +325,7 @@ All builds must pass:
- Add tests for new functionality
- Resolve all warnings and analyzer suggestions
- Keep changes minimal and focused
- Complete all pre-finalization quality checks (build, test, code_review, codeql_checker) before marking work as complete

### What AI Agents Should ASK About

Expand Down
20 changes: 14 additions & 6 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ An enumeration representing possible test outcomes:

#### `TrxSerializer`

The `TrxSerializer` class is responsible for converting the domain model into TRX XML format:
The `TrxSerializer` class is responsible for converting between the domain model and TRX XML format:

- Uses .NET's built-in XML serialization capabilities
- Produces TRX files compatible with Visual Studio and Azure DevOps
- Can deserialize TRX XML files back into the domain model
- Handles proper formatting and schema compliance
- Implements helper methods for complex XML structure creation to maintain code clarity and reduce complexity

#### `JUnitSerializer`

Expand All @@ -76,6 +78,7 @@ The `JUnitSerializer` class is responsible for converting between the domain mod
- Can deserialize JUnit XML files back into the domain model
- Groups test results by class name into test suites
- Maps test outcomes to JUnit semantics (failure, error, skipped)
- Implements helper methods for complex XML structure creation to maintain code clarity and reduce complexity

## Data Flow

Expand All @@ -89,8 +92,13 @@ The `JUnitSerializer` class is responsible for converting between the domain mod
## Design Patterns

- **Data Transfer Object (DTO)**: The `TestResults` and `TestResult` classes serve as DTOs for test data
- **Serializer Pattern**: The `TrxSerializer` class encapsulates all serialization logic
- **Serializer Pattern**: The `TrxSerializer` and `JUnitSerializer` classes encapsulate all
serialization/deserialization logic
- **Builder Pattern**: The API allows for fluent construction of test results
- **Helper Method Extraction**: Complex serialization/deserialization logic is broken down into focused helper
methods, each handling a specific portion of the XML structure
- **Constant Extraction**: Repeated string literals are extracted as private constants to improve maintainability
and reduce duplication

## File Organization

Expand Down Expand Up @@ -138,10 +146,10 @@ The library is designed to be extended in several ways:

Potential enhancements that could be considered:

1. **Deserialization**: Add support for reading existing TRX and JUnit XML files back into the object model
2. **Additional Formats**: Support for other test result formats (NUnit XML, xUnit XML, etc.)
3. **Streaming**: Support for streaming large test result sets to avoid memory issues
4. **Validation**: Add schema validation to ensure generated files are well-formed
1. **Additional Formats**: Support for other test result formats (NUnit XML, xUnit XML, etc.)
2. **Streaming**: Support for streaming large test result sets to avoid memory issues
3. **Validation**: Add schema validation to ensure generated files are well-formed
4. **Format Detection**: Automatic detection of input format when deserializing

## Dependencies

Expand Down
28 changes: 26 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,32 @@ Enhancement suggestions are tracked as GitHub issues. When creating an enhanceme
2. Make your changes, following the coding guidelines below
3. Add or update tests as needed
4. Run the full test suite to ensure nothing is broken
5. Commit your changes with a clear and descriptive commit message
6. Push to your fork and submit a pull request
5. Run pre-commit quality checks (see below)
6. Commit your changes with a clear and descriptive commit message
7. Push to your fork and submit a pull request

### Pre-Commit Quality Checks

Before committing your changes, ensure the following checks pass:

```bash
# Build the project
dotnet build --configuration Release

# Run all tests
dotnet test --configuration Release

# Verify code formatting
dotnet format --verify-no-changes

# (Optional) Run spell checker if you modified documentation
cspell "**/*.{md,cs}"

# (Optional) Run markdown linter if you modified markdown files
markdownlint "**/*.md"
```

All builds must complete with zero warnings, and all tests must pass.

## Coding Guidelines

Expand Down