Skip to content

Use containsOnce for metadata e2e expected files#13815

Merged
wu-sheng merged 1 commit intomasterfrom
feat/containsOnce-metadata
Apr 13, 2026
Merged

Use containsOnce for metadata e2e expected files#13815
wu-sheng merged 1 commit intomasterfrom
feat/containsOnce-metadata

Conversation

@wu-sheng
Copy link
Copy Markdown
Member

Use containsOnce for stricter metadata verification in e2e tests

Migrate outer-level contains to containsOnce in 101 expected files:

  • 57 service.yml — exact service names and IDs
  • 15 instance.yml — known service instances
  • 5 endpoint.yml — exact endpoint names
  • 24 topology files — aggregated nodes and calls (no duplicates)

containsOnce uses backtracking for optimal 1:1 assignment between expected and actual entries, ensuring each actual item matches exactly one expected entry. This is more precise than greedy contains for metadata where we know exactly which entries should exist.

Inner nested contains (.layers, .tags, etc.) are left unchanged.

Verified locally with the locally-built infra-e2e binary against mock data for service, instance, and topology patterns.

Migrate outer-level contains to containsOnce in service, instance,
endpoint, and topology expected files (101 files). containsOnce uses
backtracking for optimal 1:1 assignment between expected and actual
entries, which is more precise for metadata where we know exactly
which entries should exist.

Inner nested contains (layers, tags, etc.) are left unchanged.
@wu-sheng wu-sheng added test Test requirements about performance, feature or before release. enhancement Enhancement on performance or codes labels Apr 13, 2026
@wu-sheng wu-sheng merged commit 42c613b into master Apr 13, 2026
413 of 418 checks passed
@wu-sheng wu-sheng deleted the feat/containsOnce-metadata branch April 13, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement on performance or codes test Test requirements about performance, feature or before release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants