Skip to content

Improves assertion errors#535

Merged
aaronzi merged 5 commits into
eclipse-basyx:mainfrom
aaronzi:main
May 5, 2026
Merged

Improves assertion errors#535
aaronzi merged 5 commits into
eclipse-basyx:mainfrom
aaronzi:main

Conversation

@aaronzi

@aaronzi aaronzi commented May 5, 2026

Copy link
Copy Markdown
Member

This pull request improves test reporting and integration test code quality. The main changes include enhanced handling and formatting of test failure messages in the test engine, and refactoring integration tests to use clearer assertion helpers for API responses.

Test reporting improvements:

  • Added utility functions (normalizeFailureMessage, sanitizeFailureMessages, compactFailureReason, formatFailureDetailLine) to clean up and standardize failure messages in scripts/test-engine.mjs. This ensures consistent formatting and better readability in reports.
  • Updated how failure reasons and details are handled and displayed in Markdown, JUnit, and console reports, including showing additional failure details when available. [1] [2] [3] [4] [5]

Integration test refactoring:

These changes result in more maintainable and robust test infrastructure, with clearer output and more reliable assertions.

aaronzi and others added 5 commits May 5, 2026 22:07
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request improves developer feedback during CI runs by (1) standardizing how Vitest failures are normalized and rendered in the test-engine reports, and (2) refactoring integration tests to use shared assertion helpers that produce clearer, more actionable failure output.

Changes:

  • Enhanced scripts/test-engine.mjs to normalize/sanitize failure messages and include compacted “reason” plus additional “detail” lines in Markdown/console output, and a compacted reason in JUnit output.
  • Introduced src/integration-tests/fixtures/assertionHelpers.ts and refactored multiple integration tests to use assertApiResult, assertApiFailure, and assertApiFailureCode for clearer intent and better error messages.
  • Reduced duplicated per-test-file assertion boilerplate in repository integration tests.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/integration-tests/submodelService.integration.test.ts Swaps expect(...success) checks for shared API result assertions.
src/integration-tests/submodelRepo.integration.test.ts Replaces local assertion helpers with shared helpers; adds explicit status checks for failure-code cases.
src/integration-tests/submodelRegistry.integration.test.ts Refactors success/failure assertions to shared helpers for clearer failures.
src/integration-tests/fixtures/assertionHelpers.ts Adds reusable assertion utilities that format API failure context consistently.
src/integration-tests/conceptDescriptionRepo.integration.test.ts Refactors to shared helpers; adds operation/status doc blocks for PUT-by-ID coverage cases.
src/integration-tests/aasxFile.integration.test.ts Uses shared helpers; improves fixture seeding failure message context.
src/integration-tests/aasService.integration.test.ts Refactors service-level integration assertions to shared helpers.
src/integration-tests/aasRepo.integration.test.ts Removes duplicated local helper logic; uses shared helpers and adds explicit status assertions for several cases.
src/integration-tests/aasRegistry.integration.test.ts Refactors registry integration assertions to shared helpers.
src/integration-tests/aasDiscovery.integration.test.ts Refactors to shared helpers; improves fixture seeding failure message context.
scripts/test-engine.mjs Normalizes failure messages and improves failure rendering across Markdown/JUnit/console reports.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aaronzi aaronzi merged commit bd79920 into eclipse-basyx:main May 5, 2026
8 checks passed
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.

2 participants