feat(op-acceptor): handle package tests better.#225
Merged
Conversation
teddyknox
approved these changes
Mar 12, 2025
janjakubnanista
suggested changes
Mar 12, 2025
op-acceptor/nat.go
Outdated
Comment on lines
+309
to
+300
| if displayName == "" && test.Metadata.Package != "" { | ||
| // For package names, use a shortened version to avoid wrapping | ||
| pkgParts := strings.Split(test.Metadata.Package, "/") | ||
| if len(pkgParts) > 0 { | ||
| displayName = pkgParts[len(pkgParts)-1] + " (package)" | ||
| } else { | ||
| displayName = test.Metadata.Package | ||
| } | ||
| } | ||
|
|
||
| // Display the test result |
Contributor
There was a problem hiding this comment.
Small nit: these two blocks are identical to the ones above, I'd maybe just DRY into some private function
Contributor
Author
There was a problem hiding this comment.
Good call; I've now fixed all these up into one function. Cheers!
Comment on lines
+574
to
+576
| // Get a display name for the test | ||
| displayName := testName | ||
| if displayName == "" && test.Metadata.Package != "" { | ||
| // For package names, use a shortened version to avoid wrapping | ||
| pkgParts := strings.Split(test.Metadata.Package, "/") | ||
| if len(pkgParts) > 0 { | ||
| displayName = pkgParts[len(pkgParts)-1] + " (package)" | ||
| } else { | ||
| displayName = test.Metadata.Package | ||
| } | ||
| } | ||
|
|
Comment on lines
+619
to
+612
| // Get a display name for the test | ||
| displayName := testName | ||
| if displayName == "" && test.Metadata.Package != "" { | ||
| // For package names, use a shortened version to avoid wrapping | ||
| pkgParts := strings.Split(test.Metadata.Package, "/") | ||
| if len(pkgParts) > 0 { | ||
| displayName = pkgParts[len(pkgParts)-1] + " (package)" | ||
| } else { | ||
| displayName = test.Metadata.Package | ||
| } | ||
| } | ||
|
|
Show the result of each sub-test within a package in the output. Also show the package name.
3845c75 to
4d256fb
Compare
sigma
approved these changes
Mar 13, 2025
janjakubnanista
approved these changes
Mar 13, 2025
This was referenced Mar 17, 2025
raffaele-oplabs
pushed a commit
that referenced
this pull request
Aug 3, 2025
Show the result of each sub-test within a package in the output. Also show the package name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Show the result of each sub-test within a package in the output. Also show the package name.
Test
Added some unit tests. Also made a custom validators.yaml with just a single package which has 4 subtests. The output was as expected (pictured).
Metadata