-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix flaky CI with a complex test case #114
Conversation
We found multiple business logic issues:
|
Makefile
Outdated
@@ -23,7 +23,7 @@ lint: fmt vet | |||
|
|||
# Run tests | |||
test: tools generate fmt vet manifests | |||
ginkgo -r --randomizeAllSpecs --randomizeSuites --failOnPending --cover -coverprofile=../coverage.out --trace --race --progress | |||
ginkgo -reportPassed -r --failOnPending --cover -coverprofile=../coverage.out --trace --race --progress |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to remove `-reportPassed before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We reviewed it together yesterday and the logic seems fine. We still need to verify that it works as expected using the snapshot image. There are a few comments that came up during the review and I left them below.
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
ghcr.io/skyscanner/applicationset-progressive-sync |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're now pushing to Github packages when opening a PR. This allow us to pull a specific docker image for e2e testing before merging it into main.
@@ -23,7 +23,7 @@ lint: fmt vet | |||
|
|||
# Run tests | |||
test: tools generate fmt vet manifests | |||
ginkgo -r --randomizeAllSpecs --randomizeSuites --failOnPending --cover -coverprofile=../coverage.out --trace --race --progress | |||
ginkgo -r --failOnPending --cover -coverprofile=../coverage.out --trace --race --progress |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the randomize options at least until we address #111
Until the controller isn't scoped to a single namespace, the ginkgo random options might cause different objects to pollute the test namespace.
|
||
// Get the Applications to update | ||
scheduledApps := scheduler.Scheduler(apps, stage) | ||
scheduledApps := scheduler.Scheduler(log, apps, stage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scheduler logging as proved to be quite valuable. I propose we keep it in this PR and we fix-forward in #115
@@ -745,10 +1104,10 @@ func TestSync(t *testing.T) { | |||
|
|||
testAppName := "foo-bar" | |||
|
|||
application, error := r.syncApp(ctx, testAppName) | |||
application, err := r.syncApp(ctx, testAppName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IDE was complaining that error
is a built-in package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small comments, overall LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fix #103
We should change this test to better reflect a real case scenario. We've internally used as default the ProgressiveSync reported in #103 so this PR change the test to use that ProgressiveSync.
In addition, I changed a couple of helpers function to be more generic for when we want to add more tests with different combination of clusters.
TODO
Fix MaxTargets to return a percentange of the remaining Out Of Sync apps instead of all the appswe will address this in Support maxTargets and maxParallel with % values #112 because it's a quite big changeThis is a fork of #104 on commit cab8fff