Skip to content

Conversation

@AvhiMaz
Copy link
Contributor

@AvhiMaz AvhiMaz commented Oct 26, 2025

Description

This PR adds comprehensive end-to-end tests for the ApplicationSet progressive sync feature, addressing issue #25042.

The implementation includes:

  • 5 e2e test functions covering various progressive sync scenarios
  • 2 new helper functions for progressive sync validation
  • Feature enablement via ConfigMap setting
  • Tests for 2-step, 3-step, and percentage-based rollout strategies
  • Tests for deletion strategies (AllAtOnce and Reverse order)

Related Issues

Fixes #25042

  - Implement 5 e2e test functions covering progressive sync scenarios
  - Add ApplicationSetHasProgressiveStatus() for wave completion validation
  - Add OnlyApplicationsExist() for sequential order verification
  - Enable progressive sync feature via ConfigMap in test init()
  - Test 2-step, 3-step, and percentage-based maxUpdate constraints
  - Test deletion strategies (AllAtOnce and Reverse order)
  - Use Ginkgo BDD pattern with Given/When/Then fixtures

  Fixes argoproj#25042

Signed-off-by: AvhiMaz <[email protected]>
@AvhiMaz AvhiMaz requested a review from a team as a code owner October 26, 2025 16:20
@bunnyshell
Copy link

bunnyshell bot commented Oct 26, 2025

🔴 Preview Environment stopped on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔵 /bns:start to start the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

Comment on lines 235 to 236
var appDependencyList [][]string
var appStepMap map[string]int
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var appDependencyList [][]string
var appStepMap map[string]int
var (
appDependencyList [][]string
appStepMap map[string]int
)

Copy link
Member

Choose a reason for hiding this comment

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

better to put the appSyncMap too.

}

func (r *ApplicationSetReconciler) performProgressiveSyncs(ctx context.Context, logCtx *log.Entry, appset argov1alpha1.ApplicationSet, applications []argov1alpha1.Application, desiredApplications []argov1alpha1.Application) (map[string]bool, error) {
func (r *ApplicationSetReconciler) performProgressiveSyncs(ctx context.Context, logCtx *log.Entry, appset argov1alpha1.ApplicationSet, applications []argov1alpha1.Application, desiredApplications []argov1alpha1.Application) (map[string]bool, [][]string, map[string]int, error) {
Copy link
Member

Choose a reason for hiding this comment

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

can we add a method comment that also states why are we returning specific values like slice of slice of strings etc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it

_, err := r.updateApplicationSetApplicationStatus(ctx, logCtx, &appset, applications, appStepMap)
if err != nil {
return nil, fmt.Errorf("failed to update applicationset app status: %w", err)
return nil, nil, nil, fmt.Errorf("failed to update applicationset app status: %w", err)
Copy link
Member

Choose a reason for hiding this comment

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

i understand why you returned nil here because there's probably no use of appDepList or appStepMap. However, it's better to return those values since we may need them in future. Returning nil simply means either they haven't been built. I'm of mixed opinions here. @ranakan19 wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah makes sense, i’m fine keeping them returned for now in case they’re needed later. we can clean it up once we’re sure they aren’t used anywhere else.


// filterApplicationsByProgressiveStep filters applications to only include those in the current eligible step.
// Applications are only created/updated if all applications in their current step's prerequisite steps are healthy.
func (r *ApplicationSetReconciler) filterApplicationsByProgressiveStep(logCtx *log.Entry, appset *argov1alpha1.ApplicationSet, applications []argov1alpha1.Application, appDependencyList [][]string, appStepMap map[string]int) []argov1alpha1.Application {
Copy link
Member

Choose a reason for hiding this comment

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

please write unit tests for this function.

Copy link
Member

@nitishfy nitishfy left a comment

Choose a reason for hiding this comment

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

Thank you for raising the PR. I don't think the e2e tests have been written so far, do you intend to put this in draft state? Secondly, i would like to hear from @ranakan19 thoughts on this PR especially on the implementation of filterApplicationsByProgressiveStep() and if we actually need it. If everything goes well, please consider writing unit tests too. Thanks!

  - Consolidate variable declarations
  - Add method documentation
  - Fix error return values
  - Add unit tests for filterApplicationsByProgressiveStep

Signed-off-by: AvhiMaz <[email protected]>
@AvhiMaz AvhiMaz requested a review from nitishfy October 27, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

e2e tests for progressive sync

2 participants