Skip to content

test(e2e): E2E test improvements - #6804

Merged
hairyhum merged 9 commits into
mainfrom
hairyhum/e2e-test
Aug 25, 2026
Merged

test(e2e): E2E test improvements#6804
hairyhum merged 9 commits into
mainfrom
hairyhum/e2e-test

Conversation

@hairyhum

Copy link
Copy Markdown
Contributor

More test suites

  1. Added generated test suites from https://github.com/akuity/kargo-examples
  • Using git repo and credentials configurable with env files
  • Removed verification templates because they were just noop waiting (for faster tests)
  • Using promotion names instead of stages to prevent idempotent steps like git-commit and git-open-pr from being skipped Not a production-compatible examples, but is good for tests
  1. Added env functions to support creating kind cluster with kargo and argocd installed.

Argocd appsets use placeholder as a default target and ignore override of target.
Kargo steps update target on argocd apps and use promotion for branch names.
Also updated deprecated messageFromSteps to message with expressions.
This allows rerunning the tests without noop steps.
Using e2e-framework tools set up a `kind` cluster, install `argocd` and `kargo` with helm charts
and login using `argocd` and `kargo` CLI.
See `README.md` and `kind_config.yaml` in `hack/test/e2e` for more information.

Signed-off-by: Daniil Fedotov <daniil.fedotov@akuity.io>
@hairyhum
hairyhum requested a review from a team as a code owner August 12, 2026 21:16
@kargo-governance-bot kargo-governance-bot Bot added needs/area Issue or PR needs to be labeled to indicate what parts of the code base are affected needs/kind Issue or PR needs to be labeled to clarify its nature needs/priority Priority has not yet been determined; a good signal that maintainers aren't fully committed labels Aug 12, 2026
@netlify

netlify Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit 28c03b6
🔍 Latest deploy log https://app.netlify.com/projects/docs-kargo-io/deploys/6a8df393759dd90008bc64f2
😎 Deploy Preview https://deploy-preview-6804.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.55%. Comparing base (d30e014) to head (28c03b6).
⚠️ Report is 32 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6804      +/-   ##
==========================================
+ Coverage   30.84%   35.55%   +4.70%     
==========================================
  Files         826      835       +9     
  Lines       80666    68613   -12053     
==========================================
- Hits        24885    24394     -491     
+ Misses      54327    44219   -10108     
+ Partials     1454        0    -1454     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hairyhum hairyhum changed the title E2E test improvements test(e2e): E2E test improvements Aug 18, 2026
@hairyhum

Copy link
Copy Markdown
Contributor Author

Added remaining examples to suites.

  • HTTP example is skipped unless http_endpoint is set
  • 02-git-driven/03-kustomize-driven/01-image-only/02-monorepo example is deliberately not adapted.

Signed-off-by: Daniil Fedotov <daniil.fedotov@akuity.io>
Signed-off-by: Daniil Fedotov <daniil.fedotov@akuity.io>
Comment thread hack/test/e2e/envs/home_config.yaml
Comment thread hack/test/e2e/envs/kind_config.yaml Outdated
kargo_cli:
## Indicate that we need to run `kargo login` to login into a kargo instance in `kind` cluster
kargo_login:
## Uste tmp directory to store kargo config

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit(spelling): s/Uste/Use


fmt.Printf("Port forwarding %s to %d", service, outport)

p := utils.RunCommand(cmd)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Heads up that RunCommand is deprecated in favor of RunCommandContext. Also, does this reap the process on shutdown or does it stay hanging?

Comment on lines +67 to +68
loginConfig, ok := loginConfigVal.(map[string]any)
if ok {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any reason we don't just make this extra config a concrete type? It would avoid a bunch of nesting and I don't think there are a ton of values. If this was being passed verbatim to something else to decode, I think it would be fine, but this seems fairly concrete

If we do keep it this way, one nit is that we can just invert the logic to avoid the huge nested block by doing:

if !ok {
	return ctx, nil, nil
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could, but there's not much in that config at the moment to require that.
I'm trying to avoid typing the test config for now, since it's parsed into a map on the top level.

return nil, err
}

func GetValueOrEnv(ctx context.Context, valueKey ContextKey, path []string) (any, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: I think this would be cleaner if the path argument was variadic (...string) as it would be cleaner to call

@hairyhum hairyhum Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried that, but it looks worse, since I can't read the "path" from there when I scan the code. Plus it makes optionalString signature look weird.

"github.com/akuity/kargo/hack/test/e2e/envfuncs"
)

func GetFuncs() ([]env.Func, []env.Func) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I just noticed this now. Could you give a doc comment documenting which each slice of funcs is for?

Comment on lines +20 to +24
_ "github.com/akuity/kargo/pkg/gitprovider/azure" // Azure provider registration
_ "github.com/akuity/kargo/pkg/gitprovider/bitbucket/cloud" // Bitbucket Cloud provider registration
_ "github.com/akuity/kargo/pkg/gitprovider/gitea" // Gitea provider registration
_ "github.com/akuity/kargo/pkg/gitprovider/github" // GitHub provider registration
_ "github.com/akuity/kargo/pkg/gitprovider/gitlab" // GitLab provider registration

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: Just put a single comment over this saying this are for the provider registrations

Signed-off-by: Daniil Fedotov <daniil.fedotov@akuity.io>
Signed-off-by: Daniil Fedotov <daniil.fedotov@akuity.io>
@hairyhum
hairyhum merged commit 0c85778 into main Aug 25, 2026
20 of 21 checks passed
@hairyhum
hairyhum deleted the hairyhum/e2e-test branch August 25, 2026 20:15
@hairyhum hairyhum mentioned this pull request Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs/area Issue or PR needs to be labeled to indicate what parts of the code base are affected needs/kind Issue or PR needs to be labeled to clarify its nature needs/priority Priority has not yet been determined; a good signal that maintainers aren't fully committed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants