Skip to content

Stack controller tests #671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 20, 2024
Merged

Stack controller tests #671

merged 8 commits into from
Sep 20, 2024

Conversation

EronWright
Copy link
Contributor

@EronWright EronWright commented Sep 19, 2024

Proposed changes

Implements a test suite for the new stack controller.

Closes #654

Related issues (optional)

@EronWright EronWright requested a review from blampe September 19, 2024 22:42
@EronWright EronWright added the impact/no-changelog-required This issue doesn't require a CHANGELOG update label Sep 20, 2024
Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 59.09091% with 9 lines in your changes missing coverage. Please review.

Project coverage is 33.24%. Comparing base (3cb8900) to head (cea8bdc).
Report is 1 commits behind head on v2.

Files with missing lines Patch % Lines
...tor/internal/controller/pulumi/stack_controller.go 50.00% 8 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               v2     #671      +/-   ##
==========================================
+ Coverage   26.17%   33.24%   +7.07%     
==========================================
  Files          25       25              
  Lines        3947     3949       +2     
==========================================
+ Hits         1033     1313     +280     
+ Misses       2772     2474     -298     
- Partials      142      162      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@blampe blampe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable.

@@ -64,7 +69,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
fmt.Sprintf("1.29.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why downgrade?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suite for the workspace controller uses 1.28.3 and I think the CI script knows that. I guess I used a slightly different scaffolder for the stack controller.

Comment on lines 521 to 537
// annotate the out of date stack so that it'll be queued. The value is arbitrary; this
// value gives a bit of context which might be helpful when troubleshooting.
v := fmt.Sprintf("update prerequisite of %s at %s", instance.Name, time.Now().Format(time.RFC3339))
prereqStack1 := prereqStack.DeepCopy()
a := prereqStack1.GetAnnotations()
if a == nil {
a = map[string]string{}
}
a[shared.ReconcileRequestAnnotation] = v
prereqStack1.SetAnnotations(a)
log.Info("requesting requeue of prerequisite", "name", prereqStack1.Name, "cause", requireErr.Error())
if err := r.Client.Patch(ctx, prereqStack1, client.MergeFrom(&prereqStack)); err != nil {
// A conflict here may mean the prerequisite has been changed, or it's just been
// run. In any case, requeueing this object means we'll see the new state of the
// world next time around.
return reconcile.Result{}, fmt.Errorf("annotating prerequisite to force requeue: %w", err)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm reverting this change and doing a follow-up: #672

@EronWright EronWright merged commit ab6c570 into v2 Sep 20, 2024
7 checks passed
@EronWright EronWright deleted the stack-tests branch September 20, 2024 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/no-changelog-required This issue doesn't require a CHANGELOG update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants