skywalking-infra-e2e icon indicating copy to clipboard operation
skywalking-infra-e2e copied to clipboard

[Feature] [e2e-infra] Support duplicate data verification (#12253)

Open Navadeep0007 opened this issue 2 months ago • 5 comments

Summary

This PR adds support for verifying duplicate data in list-type checks within the e2e infrastructure framework.

Changes

  • Added internal/verify/duplicate_check.go — implements CheckForDuplicates() utility to detect duplicate items in a list.
  • Added internal/verify/duplicate_check_test.go — unit tests to validate duplicate detection logic.

Behavior

The CheckForDuplicates() function returns an error when duplicate entries are found in a given list, helping ensure data integrity during verification.

Related Issue

Fixes apache/skywalking#12253

Checklist

  • [x] Implemented duplicate data verification utility
  • [x] Added corresponding unit tests
  • [x] Passed all Go tests locally

Notes

Future improvements may integrate this utility into the existing list verification logic for automated duplicate checking during e2e validation.

Navadeep0007 avatar Oct 27 '25 07:10 Navadeep0007

Hi @wu-sheng , I’ve implemented the duplicate data verification feature as described in issue #12253. The PR adds a CheckForDuplicates() utility along with corresponding unit tests.

It would be great if you could please review it when you have a moment. I’d also be happy to extend this in a follow-up to integrate with the existing list verification flow if needed.

This PR is ready for review and merge. It adds the duplicate data verification utility (CheckForDuplicates) with unit tests as discussed in issue #12253.

All tests have passed locally, and the change is backward-compatible.

Navadeep0007 avatar Oct 27 '25 07:10 Navadeep0007

Hi @kezhenxu94, thanks for the feedback!

I'd be happy to expose this to YAML. Could you clarify the preferred integration approach?

Option A:-Add a noDuplicates: true field to existing list verifications in YAML Option B:- Create a new verification type specifically for duplicate checking

I'm leaning towards Option A for better integration with existing workflows. Would that work, or do you have a different pattern in mind?

Happy to implement whichever approach fits the project best!

Navadeep0007 avatar Oct 30 '25 05:10 Navadeep0007

@Navadeep0007 option A looks good to me, please go ahead, thanks!

kezhenxu94 avatar Oct 30 '25 05:10 kezhenxu94

Hi @kezhenxu94, I’ve implemented the YAML integration for Option A (noDuplicates: true) as discussed. The flag is now supported in list verifications and calls CheckForDuplicates(). Tests and examples have been updated.

Navadeep0007 avatar Nov 13 '25 09:11 Navadeep0007

Added missing Apache License headers to the following files to fix the CI failure reported by license-eye:

examples/list_verification.yaml

internal/verify/config.go

internal/verify/runner.go

The build should now pass successfully. ✅

Navadeep0007 avatar Nov 13 '25 10:11 Navadeep0007