Scaffold placement shim e2e tests and add entrypoint#712
Scaffold placement shim e2e tests and add entrypoint#712PhilippMatthes merged 3 commits intomainfrom
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 37 minutes and 19 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (16)
📝 WalkthroughWalkthroughThis PR introduces an end-to-end testing framework for the placement shim. It adds a test registry and runner in the placement package, detects a special Changes
Sequence DiagramsequenceDiagram
participant Tilt as Tilt/Operator
participant Main as cmd/shim/main.go
participant Placement as placement package
participant Registry as E2E Registry
participant TestA as Test Handler A
participant TestN as Test Handler N
Tilt->>Main: Execute as "e2e-placement-shim"
Main->>Main: Detect e2e mode (os.Args[1])
Main->>Placement: Call placement.RunE2E(ctx)
Placement->>Registry: Iterate e2eTests slice
Registry->>TestA: Run "allocation_candidates" test
TestA-->>Placement: Complete (log time)
Registry->>TestN: Run "usages" test
TestN-->>Placement: Complete (log time)
Placement-->>Main: Log final completion & total time
Main-->>Tilt: Exit with results
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/test.yaml:
- Around line 55-56: Replace the two-step header+append approach that causes
duplicated "mode:" lines by writing only the first line from profile.cov and
then appending the rest of the file excluding any additional "mode:" headers;
specifically update the commands that create profile_filtered.cov (which
currently use head and grep with profile.cov/profile_filtered.cov) so they emit
NR==1 (the original header) and then append remaining lines that do not match
/^mode:/, ensuring the resulting profile has a single "mode:" line and is valid
for go tool cover.
In `@internal/shim/placement/shim_e2e.go`:
- Around line 13-32: The RunE2E runner currently uses type e2eTest with run
func(ctx context.Context) that cannot return errors, and RunE2E always logs
success, so make failures machine-detectable by changing e2eTest.run to func(ctx
context.Context) error, update all registrations that append to e2eTests (in
handle_*_e2e.go) to return an error, modify RunE2E to collect and return the
first non-nil error (stop on error and log failure with context and duration),
and update cmd/shim/main.go to call RunE2E, exit with non-zero status when
RunE2E returns an error, ensuring unique symbols to edit are e2eTest, e2eTests,
RunE2E and the registration functions in handle_*_e2e.go.
🪄 Autofix (Beta)
❌ Autofix failed (check again to retry)
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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 234a5079-c5a2-4403-9e51-71c7aaf89ac6
📒 Files selected for processing (17)
.github/workflows/test.yamlTiltfilecmd/shim/main.gointernal/shim/placement/handle_allocation_candidates_e2e.gointernal/shim/placement/handle_allocations_e2e.gointernal/shim/placement/handle_reshaper_e2e.gointernal/shim/placement/handle_resource_classes_e2e.gointernal/shim/placement/handle_resource_provider_aggregates_e2e.gointernal/shim/placement/handle_resource_provider_allocations_e2e.gointernal/shim/placement/handle_resource_provider_inventories_e2e.gointernal/shim/placement/handle_resource_provider_traits_e2e.gointernal/shim/placement/handle_resource_provider_usages_e2e.gointernal/shim/placement/handle_resource_providers_e2e.gointernal/shim/placement/handle_root_e2e.gointernal/shim/placement/handle_traits_e2e.gointernal/shim/placement/handle_usages_e2e.gointernal/shim/placement/shim_e2e.go
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. An unexpected error occurred while generating fixes: Resource not accessible by integration - https://docs.github.com/rest/git/trees#create-a-tree |
Test Coverage ReportTest Coverage 📊: 68.7% |
This adds empty e2e test functions for every placement api shim endpoint, and binds them together
shim_e2e.gofrom where it can be executed using thee2e-placement-shimentrypoint. It also excludes any*_e2e.gofiles from our test coverage.