Skip to content
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

Add E2E framework and initial set of simple tests, to run as part of PRs #137

Open
jgwest opened this issue Aug 2, 2024 · 0 comments
Open
Labels
enhancement New feature or request testing
Milestone

Comments

@jgwest
Copy link
Member

jgwest commented Aug 2, 2024

Argocd-agent currently has a set of detailed unit tests across the code base, which work well for white-box testing of individual functions within the packages of the project. We also have a what looks like a simple E2E test of principal code (but from quickly skimming the code it IMHO looks like a slightly more complex unit test?).

What is missing is fully E2E tests (and a framework to support them) that: setup vclusters, run Argo CD, run principal agent, run one or more of managed/autonomous agents, then test the resulting setup.

Criteria:

Initial brainstorm of how the test would be setup and what the test would do:

  • Installs and starts k3s (same as we have done in e.g. Argo CD or Argo CD operator )
  • Setup environment, similar to/based on hack/demo-env:
    • Creates vclusters vcluster-control-plane/vcluster-agent-managed/vcluster-agent-autonomous on that k3s instance
      • K3s appears to include a built-in LoadBalancer already, ServiceLB
    • Installs Argo CD to vclusters
    • Starts principal
    • Starts autonomous/managed agents (do we want to start both, or should we only start one or the other)?
    • Logic for all of this can be borrowed from https://github.com/jannfis/argocd-agent/tree/main/hack/demo-env
  • Runs E2E tests
    • A simple managed-mode E2E test
    • A simple autonomous-mode E2E test
    • I'd imagine these simple E2E test would be something like:
      • Create an Argo CD Application in principal, then verify it is synced/deployed on managed-mode/autonomous agent vcluster
      • Verify the resources exist on those target clusters
    • Cleans up when done
  • E2E tests to be written with testify, similar to the other unit tests already in the codebase.
  • For E2E tests I'm always a fan of using a fixture (fixture implementation), which is a set of packages that contain utility functions that can be reused for writing new E2E tests.
  • GitHub action to run the test for GitHub PRs (can steal this from .github folder of argocd-operator, argo-cd, etc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing
Projects
None yet
Development

No branches or pull requests

2 participants