-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix flaky CI with a complex test case (#114)
* Fix linting errors because of missing variables * Change the progressive sync to be a multi-region object * Sync first stage * Set second stage apps to progressing * Check the stages status while the second stage apps are progressing * Add a test for adding the annotation * Add a check to make sure the PS status is in progress after the first stage * Add a check to make sure the PS status is in progress after the second stage * Fix second stage cluster order * Add setAppHealthStatusProgressing and setAppStatusCompleted helper functions * Refactor second stage with helper functions * Add third stage * Fix failed stage test * WIP: update multi-stage test with syncedAt annotation * Eventual consistency for setting app status in tests * Update IsStageComplete to take into account MaxTargets * Add method to identify annotated apps * WIP: Progress on resolving reconciliation loop bugs * Use single namespace and different application names * Better variable names * Remove duplicate code * Remove ginkgo random stuff * Add more informative log messages * Fix GetAppsName comment * Fix IsStageInProgress by adding a condition on how many apps we still want to sync * Try increasing the timeout * Try increasing the timeout * Always log the progressive sync object * Restore --randomizeAllSpecs --randomizeSuites in ginkgo * More key values in the logs and fix typo * Remove ginkgo randomization * Restore create/delete a namespace after each test * Add namespace to the progressivesync log value * Add a condition to avoid moving to the next stage and exiting the reconciliation loop * Increment timeout to 60 seconds * Always requeue in case of error but with a delay * Increase the timeout to 120s * Add more verbose logging * Add annotations to log * Increase to 5 minutes timeout * Uncomment Remove Annotation * Annotate before syncing * Add more logging * Add a test to make sure we set the app annotation * Avoid deleting all the annotations if syncedAt key is missing * Comment out remove annotation and one test * Increase timeout * Re-add should fail if unable to sync application test * Re-comment out should fail if unable to sync application test * Delete ps object at the end of test * Semplify annotation logic * Add logging to scheduler * Add logic to protect againt more apps synced than maxTargets * Add scheduler unit test * Increase timeout for integration tests * Log when tests pass * Schedule progressing but out-of-sync apps as well * Remove delete annotation logic * Change GetSyncedAppsByStage to match only on sync status and not health status * Switch to GetAppsByAnnotation as more generic function * Fix IsStageFailed by passing a stage as well * Prefer GetSyncedAppsByStage over getting the app by status and then annotation * Prefer GetSyncedAppsByStage over getting the app by status and then annotation * Rename variables to have a more meaningful name * Explicity set Requeu to true and pass nil error * Re-add TestIsStageInProgress * Re-add TestStageComplete * Add nil case for TestStageFailed * Add Requeue: true along when setting RequeueAfter * Build a docker image on every PR * [skip ci] Minor tweaks in comments and remove the word rollout * Remove PS deletion at the end of test * Make sure the previous stages stay completed when starting the last one * Consistenly use Parse to define an intstr as it supports % * Remove reportPassed option from ginkgo * [skip ci] Add Target struct description * Use correct application in logs * Declare requeueDelayOnError as constant * Restore walrus operator Co-authored-by: Matteo Ruina <[email protected]> Co-authored-by: Diogo Campos <[email protected]> Co-authored-by: Dimitar <[email protected]>
- Loading branch information
1 parent
10cfda2
commit 7c57da0
Showing
8 changed files
with
1,074 additions
and
443 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,16 +38,29 @@ jobs: | |
- name: Build | ||
run: make manager | ||
|
||
- name: Login to GitHub Packages Docker Registry | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
ghcr.io/skyscanner/applicationset-progressive-sync | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=ref,event=pr | ||
type=semver,pattern={{raw}} | ||
type=sha | ||
- name: Login to GitHub Packages | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
if: github.event_name != 'pull_request' | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and publish a docker image when merge in main | ||
- name: Build and publish a docker image | ||
uses: docker/[email protected] | ||
with: | ||
push: true | ||
tags: maruina/applicationset-progressive-sync:main | ||
if: github.event_name != 'pull_request' | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains 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
This file contains 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
Oops, something went wrong.