Repository navigation
tests(graphql): Add interface-implementation method alignment tests - #21543
Conversation
|
Skipping CI for Draft Pull Request. |
🚀 Build Images ReadyImages are ready for commit c2f6da1. To use with deploy scripts: export MAIN_IMAGE_TAG=4.12.x-424-gc2f6da1ef5 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #21543 +/- ##
==========================================
- Coverage 50.38% 50.33% -0.06%
==========================================
Files 2844 2844
Lines 218476 218476
==========================================
- Hits 110074 109960 -114
- Misses 100422 100512 +90
- Partials 7980 8004 +24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3c9dd40 to
475c4c2
Compare
42ec8bc to
0087ec6
Compare
jschnath
left a comment
There was a problem hiding this comment.
Good test coverage for what the first PR implemented as far as I can see.
0087ec6 to
6194f8a
Compare
6194f8a to
12736e9
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (7)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR adds a shared reflection-based test helper and new GraphQL resolver type-alignment tests for cluster, image, and node resolvers. Several tests are skipped, and the helper verifies method counts and method-name ordering between interfaces and concrete implementations. ChangesResolver Method-Alignment Tests
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@central/graphql/resolvers/test_utils_test.go`:
- Around line 13-16: The assertion message in the NumMethod comparison has a
grammar typo in the string passed to assert.Equalf; update the failure text in
the helper that compares type methods so it reads correctly without the extra
leading “have”. Use the existing type comparison assertion around type1 and
type2 in test_utils_test.go, and keep the rest of the message structure
unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 4f181927-8363-4b25-bf3b-505c819f5f60
📒 Files selected for processing (7)
central/graphql/resolvers/cluster_vulnerabilities_test.gocentral/graphql/resolvers/image_components_test.gocentral/graphql/resolvers/image_resolver_test.gocentral/graphql/resolvers/image_vulnerabilities_test.gocentral/graphql/resolvers/node_components_test.gocentral/graphql/resolvers/node_vulnerabilities_test.gocentral/graphql/resolvers/test_utils_test.go
12736e9 to
65156ce
Compare
|
/retest |
Description
Multiple dependabot pull-requests to upgrade the github.com/graph-gophers/graphql-go failed after the dependency introduced a breaking behaviour change ( see graph-gophers/graphql-go#763 ).
The investigation pointed out that part of the failure was due to the fact that the (reflection) indices of the interface method and the indices of the method in the implementing types are not always aligned.
This PR adds a set of unit-tests (some of them disabled) that validate that the method indices of the graphql resolvers are aligned between interface and implementation (the disabled tests are for the case where the indices are not aligned).
The pull request is part of a stack:
User-facing documentation
is updated ORupdate is not neededis created and is linked above ORis not neededTesting and quality
Automated testing
How I validated my change
Test-only -> CI run