Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a8cba96
update certs so they are valid when running locally on mac
agaudreault Dec 18, 2025
2716801
disable rerun locally
agaudreault Dec 18, 2025
adb6162
fix /tmp/argo-e2e data so it is configurable
agaudreault Dec 18, 2025
ea9013e
ssh handshake issue
agaudreault Dec 19, 2025
ff95ae5
fix when tls changes causing conflicts
agaudreault Dec 19, 2025
8aaddb1
update cert CN hardcoded in test
agaudreault Dec 22, 2025
5d150ff
fix CI using wrong known_host
agaudreault Dec 22, 2025
37a3dc0
docs
agaudreault Dec 22, 2025
7c161de
fix appset e2e failing
agaudreault Dec 22, 2025
6e6396e
add back env vars?
agaudreault Jan 5, 2026
4c8bd12
Revert "add back env vars?"
agaudreault Jan 5, 2026
96afbe3
revert back to tmp mounting to validate CI
agaudreault Jan 5, 2026
615b260
fix namespace name
agaudreault Jan 5, 2026
f561e08
chore(deps): bump renovatebot/github-action from 44.2.0 to 44.2.1 (#2…
dependabot[bot] Dec 23, 2025
0a871ee
chore(deps): update notifications-engine to v0.5.1-0.20251223091026-8…
pasha-codefresh Dec 23, 2025
1ffd484
chore(deps): bump google.golang.org/grpc from 1.77.0 to 1.78.0 (#25789)
dependabot[bot] Dec 24, 2025
7b37b9a
chore(deps): bump ubuntu in gh actions to 24.04 and ubuntu in test/re…
reggie-k Dec 24, 2025
f1a9fb1
docs: Update Linux host IP detection in Toolchain guide - to avoid h…
1Shubham7 Dec 25, 2025
9dadbd3
[Bot] docs: Update Snyk report (#25806)
github-actions[bot] Dec 28, 2025
d9e33d8
docs: link to source hydrator (#25813)
jsoref Dec 29, 2025
1939be0
chore(deps): bump library/golang from `36b4f45` to `31c1e53` in /test…
dependabot[bot] Dec 31, 2025
297a0d8
chore(deps): update docker.io/library/golang:1.25.5 docker digest to …
argoproj-renovate[bot] Dec 31, 2025
75a2340
chore(deps): bump renovatebot/github-action from 44.2.1 to 44.2.2 (#2…
dependabot[bot] Dec 31, 2025
6f7f5e7
chore(deps): bump the otel group with 4 updates (#25553)
dependabot[bot] Jan 1, 2026
067b9b0
chore(deps): update docker.io/library/golang:1.25.5 docker digest to …
argoproj-renovate[bot] Jan 1, 2026
af8b80e
chore(deps): bump qs from 6.11.0 to 6.14.1 in /ui (#25828)
dependabot[bot] Jan 2, 2026
9b402bb
chore(deps): update docker.io/library/golang:1.25.5 docker digest to …
argoproj-renovate[bot] Jan 4, 2026
0f3a51e
[Bot] docs: Update Snyk report (#25843)
github-actions[bot] Jan 4, 2026
68069bb
docs: fix help-wanted label link (#25839)
zeraye Jan 5, 2026
88b05b0
chore(deps): bump library/golang from `31c1e53` to `6cc2338` in /test…
dependabot[bot] Jan 5, 2026
6fca87a
docs: fix typos in documentation (#25844)
ioleksiuk Jan 5, 2026
d4f8b2e
fix(ui): remove excess dot (#25816)
jsoref Jan 5, 2026
9cbbd18
chore: migrate k8s.gcr.io to registry.k8s.io in install manifests (#2…
ayia-hosni Jan 5, 2026
e4badea
ci: test against k8s 1.34.2 (#25856)
reggie-k Jan 5, 2026
d8b1c4d
test(e2e): unstable CMP e2e test when running locally (#25752)
agaudreault Jan 5, 2026
c4ea2ae
duh
agaudreault Jan 5, 2026
e5457f3
always mount tmp
agaudreault Jan 5, 2026
5f2ef03
Merge remote-tracking branch 'upstream/master' into e2e-cert-local
agaudreault Jan 5, 2026
e74693b
Merge branch 'master' into e2e-cert-local
agaudreault Jan 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Create symlink in GOPATH
run: ln -s $(pwd) ~/go/src/github.com/argoproj/argo-cd
run: ln -s $(pwd) ~/go/src/github.com/argoproj/argo-cd
- name: Setup Golang
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
Expand Down Expand Up @@ -271,13 +271,13 @@ jobs:
# We need to vendor go modules for codegen yet
go mod download
go mod vendor -v
# generalizing repo name for forks: ${{ github.event.repository.name }}
working-directory: /home/runner/go/src/github.com/argoproj/${{ github.event.repository.name }}
# generalizing repo name for forks: ${{ github.event.repository.name }}
working-directory: /home/runner/go/src/github.com/argoproj/${{ github.event.repository.name }}
- name: Install toolchain for codegen
run: |
make install-codegen-tools-local
make install-go-tools-local
# generalizing repo name for forks: ${{ github.event.repository.name }}
# generalizing repo name for forks: ${{ github.event.repository.name }}
working-directory: /home/runner/go/src/github.com/argoproj/${{ github.event.repository.name }}
# We install kustomize in the dist directory
- name: Add dist to PATH
Expand Down Expand Up @@ -440,9 +440,6 @@ jobs:
- changes
env:
ARGOCD_FAKE_IN_CLUSTER: 'true'
ARGOCD_SSH_DATA_PATH: '/tmp/argo-e2e/app/config/ssh'
ARGOCD_TLS_DATA_PATH: '/tmp/argo-e2e/app/config/tls'
ARGOCD_E2E_SSH_KNOWN_HOSTS: '../fixture/certs/ssh_known_hosts'
ARGOCD_E2E_K3S: 'true'
ARGOCD_IN_CI: 'true'
ARGOCD_E2E_APISERVER_PORT: '8088'
Expand Down
27 changes: 15 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ ARGOCD_E2E_REDIS_PORT?=6379
ARGOCD_E2E_DEX_PORT?=5556
ARGOCD_E2E_YARN_HOST?=localhost
ARGOCD_E2E_DISABLE_AUTH?=
ARGOCD_E2E_DIR?=/tmp/argo-e2e

ARGOCD_E2E_TEST_TIMEOUT?=90m
ARGOCD_E2E_RERUN_FAILS?=5

ARGOCD_IN_CI?=false
ARGOCD_TEST_E2E?=true
Expand Down Expand Up @@ -467,7 +469,7 @@ test-e2e:
test-e2e-local: cli-local
# NO_PROXY ensures all tests don't go out through a proxy if one is configured on the test system
export GO111MODULE=off
DIST_DIR=${DIST_DIR} RERUN_FAILS=5 PACKAGES="./test/e2e" ARGOCD_E2E_RECORD=${ARGOCD_E2E_RECORD} ARGOCD_CONFIG_DIR=$(HOME)/.config/argocd-e2e ARGOCD_GPG_ENABLED=true NO_PROXY=* ./hack/test.sh -timeout $(ARGOCD_E2E_TEST_TIMEOUT) -v -args -test.gocoverdir="$(PWD)/test-results"
DIST_DIR=${DIST_DIR} RERUN_FAILS=$(ARGOCD_E2E_RERUN_FAILS) PACKAGES="./test/e2e" ARGOCD_E2E_RECORD=${ARGOCD_E2E_RECORD} ARGOCD_CONFIG_DIR=$(HOME)/.config/argocd-e2e ARGOCD_GPG_ENABLED=true NO_PROXY=* ./hack/test.sh -timeout $(ARGOCD_E2E_TEST_TIMEOUT) -v -args -test.gocoverdir="$(PWD)/test-results"

# Spawns a shell in the test server container for debugging purposes
debug-test-server: test-tools-image
Expand All @@ -491,13 +493,13 @@ start-e2e-local: mod-vendor-local dep-ui-local cli-local
kubectl create ns argocd-e2e-external || true
kubectl create ns argocd-e2e-external-2 || true
kubectl config set-context --current --namespace=argocd-e2e
kustomize build test/manifests/base | kubectl apply --server-side -f -
kustomize build test/manifests/base | kubectl apply --server-side --force-conflicts -f -
kubectl apply -f https://raw.githubusercontent.com/open-cluster-management/api/a6845f2ebcb186ec26b832f60c988537a58f3859/cluster/v1alpha1/0000_04_clusters.open-cluster-management.io_placementdecisions.crd.yaml
# Create GPG keys and source directories
if test -d /tmp/argo-e2e/app/config/gpg; then rm -rf /tmp/argo-e2e/app/config/gpg/*; fi
mkdir -p /tmp/argo-e2e/app/config/gpg/keys && chmod 0700 /tmp/argo-e2e/app/config/gpg/keys
mkdir -p /tmp/argo-e2e/app/config/gpg/source && chmod 0700 /tmp/argo-e2e/app/config/gpg/source
mkdir -p /tmp/argo-e2e/app/config/plugin && chmod 0700 /tmp/argo-e2e/app/config/plugin
if test -d $(ARGOCD_E2E_DIR)/app/config/gpg; then rm -rf $(ARGOCD_E2E_DIR)/app/config/gpg/*; fi
mkdir -p $(ARGOCD_E2E_DIR)/app/config/gpg/keys && chmod 0700 $(ARGOCD_E2E_DIR)/app/config/gpg/keys
mkdir -p $(ARGOCD_E2E_DIR)/app/config/gpg/source && chmod 0700 $(ARGOCD_E2E_DIR)/app/config/gpg/source
mkdir -p $(ARGOCD_E2E_DIR)/app/config/plugin && chmod 0700 $(ARGOCD_E2E_DIR)/app/config/plugin
# create folders to hold go coverage results for each component
mkdir -p /tmp/coverage/app-controller
mkdir -p /tmp/coverage/api-server
Expand All @@ -506,13 +508,14 @@ start-e2e-local: mod-vendor-local dep-ui-local cli-local
mkdir -p /tmp/coverage/notification
mkdir -p /tmp/coverage/commit-server
# set paths for locally managed ssh known hosts and tls certs data
ARGOCD_SSH_DATA_PATH=/tmp/argo-e2e/app/config/ssh \
ARGOCD_TLS_DATA_PATH=/tmp/argo-e2e/app/config/tls \
ARGOCD_GPG_DATA_PATH=/tmp/argo-e2e/app/config/gpg/source \
ARGOCD_GNUPGHOME=/tmp/argo-e2e/app/config/gpg/keys \
ARGOCD_E2E_DIR=$(ARGOCD_E2E_DIR) \
ARGOCD_SSH_DATA_PATH=$(ARGOCD_E2E_DIR)/app/config/ssh \
ARGOCD_TLS_DATA_PATH=$(ARGOCD_E2E_DIR)/app/config/tls \
ARGOCD_GPG_DATA_PATH=$(ARGOCD_E2E_DIR)/app/config/gpg/source \
ARGOCD_GNUPGHOME=$(ARGOCD_E2E_DIR)/app/config/gpg/keys \
ARGOCD_GPG_ENABLED=$(ARGOCD_GPG_ENABLED) \
ARGOCD_PLUGINCONFIGFILEPATH=/tmp/argo-e2e/app/config/plugin \
ARGOCD_PLUGINSOCKFILEPATH=/tmp/argo-e2e/app/config/plugin \
ARGOCD_PLUGINCONFIGFILEPATH=$(ARGOCD_E2E_DIR)/app/config/plugin \
ARGOCD_PLUGINSOCKFILEPATH=$(ARGOCD_E2E_DIR)/app/config/plugin \
ARGOCD_GIT_CONFIG=$(PWD)/test/e2e/fixture/gitconfig \
ARGOCD_E2E_DISABLE_AUTH=false \
ARGOCD_ZJWT_FEATURE_FLAG=always \
Expand Down
42 changes: 23 additions & 19 deletions docs/developer-guide/test-e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,33 @@
The test [directory](https://github.com/argoproj/argo-cd/tree/master/test) contains E2E tests and test applications. The tests assume that Argo CD services are installed into `argocd-e2e` namespace or cluster in current context. A throw-away
namespace `argocd-e2e***` is created prior to the execution of the tests. The throw-away namespace is used as a target namespace for test applications.

The [/test/e2e/testdata](https://github.com/argoproj/argo-cd/tree/master/test/e2e/testdata) directory contains various Argo CD applications. Before test execution, the directory is copied into `/tmp/argo-e2e***` temp directory and used in tests as a
The [/test/e2e/testdata](https://github.com/argoproj/argo-cd/tree/master/test/e2e/testdata) directory contains various Argo CD applications. Before test execution, the directory is copied into `/tmp/argo-e2e***` temp directory (configurable by `ARGOCD_E2E_DIR`) and used in tests as a
Git repository via file url: `file:///tmp/argo-e2e***`.

> [!NOTE]
> You might get an error such as `unable to ls-remote HEAD on repository: failed to list refs: repository not found` when querying the local repository exposed through the e2e server running in a container.
> This is often caused by `/tmp` directoring sharing protection. You can configure a different directory with `ARGOCD_E2E_DIR`, or disable the directory sharing protection.
>
> **Rancher Desktop Volume Sharing**
>
> The e2e git server runs in a container. If you are using Rancher Desktop, you will need to enable volume sharing for
> the e2e container to access the testdata directory. To do this, add the following to
> To do enable `/tmp` sharing, add the following to
> `~/Library/Application\ Support/rancher-desktop/lima/_config/override.yaml` and restart Rancher Desktop:
>
> ```yaml
> mounts:
> - location: /private/tmp
> writable: true
> - location: /private/tmp
> writable: true
> ```

## Running Tests Locally

### With virtualized chain

1. Start the e2e version `make start-e2e`
2. Run the tests: `make test-e2e`

### With local chain

1. Start the e2e version `make start-e2e-local`
2. Run the tests: `make test-e2e-local`

Expand All @@ -37,32 +41,32 @@ You can observe the tests by using the UI [http://localhost:4000/applications](h

The Makefile's `start-e2e` target starts instances of ArgoCD on your local machine, of which the most will require a network listener. If, for any reason, your machine already has network services listening on the same ports, then the e2e tests will not run. You can derive from the defaults by setting the following environment variables before you run `make start-e2e`:

* `ARGOCD_E2E_APISERVER_PORT`: Listener port for `argocd-server` (default: `8080`)
* `ARGOCD_E2E_REPOSERVER_PORT`: Listener port for `argocd-reposerver` (default: `8081`)
* `ARGOCD_E2E_DEX_PORT`: Listener port for `dex` (default: `5556`)
* `ARGOCD_E2E_REDIS_PORT`: Listener port for `redis` (default: `6379`)
* `ARGOCD_E2E_YARN_CMD`: Command to use for starting the UI via Yarn (default: `yarn`)
- `ARGOCD_E2E_APISERVER_PORT`: Listener port for `argocd-server` (default: `8080`)
- `ARGOCD_E2E_REPOSERVER_PORT`: Listener port for `argocd-reposerver` (default: `8081`)
- `ARGOCD_E2E_DEX_PORT`: Listener port for `dex` (default: `5556`)
- `ARGOCD_E2E_REDIS_PORT`: Listener port for `redis` (default: `6379`)
- `ARGOCD_E2E_YARN_CMD`: Command to use for starting the UI via Yarn (default: `yarn`)
- `ARGOCD_E2E_DIR`: Local path to the repository to use for ephemeral test data

If you have changed the port for `argocd-server`, be sure to also set `ARGOCD_SERVER` environment variable to point to that port, e.g. `export ARGOCD_SERVER=localhost:8888` before running `make test-e2e` so that the test will communicate to the correct server component.


## Test Isolation

Some effort has been made to balance test isolation with speed. Tests are isolated as follows as each test gets:

* A random 5 character ID.
* A unique Git repository containing the `testdata` in `/tmp/argo-e2e/${id}`.
* A namespace `argocd-e2e-ns-${id}`.
* A primary name for the app `argocd-e2e-${id}`.
- A random 5 character ID.
- A unique Git repository containing the `testdata` in `/tmp/argo-e2e/${id}`.
- A namespace `argocd-e2e-ns-${id}`.
- A primary name for the app `argocd-e2e-${id}`.

## Run only a subset of tests

Running all tests locally is a time-consuming process. To run only a subset of tests, you can set the `TEST_MODULE` environment variable.
For example, to run only the OCI tests, you can set the variable as follows: `make TEST_MODULE=./test/e2e/oci_test.go test-e2e-local`
Running all tests locally is a time-consuming process. To run only a subset of tests, you can set the `TEST_MODULE` environment variable.
For example, to run only the OCI tests, you can set the variable as follows: `make TEST_MODULE=./test/e2e/oci_test.go test-e2e-local`

If you want to get a more fine-grained control over which tests to run, you can also try `make TEST_FLAGS="-run <TEST_METHOD_NAME_REGEXP>" test-e2e-local`
For individual tests you can run them using the IDE run test feature
For individual tests you can run them using the IDE run test feature

## Troubleshooting

**Tests fails to delete `argocd-e2e-ns-*` namespaces.**
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/fixture/app/context_cmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (c *Context) RunningCMPServer(configFile string) *Context {
// It blocks until the socket file is created or times out after 10 seconds.
func startCMPServer(t *testing.T, configDir string) {
t.Helper()
pluginSockFilePath := path.Join(fixture.TmpDir, fixture.PluginSockFilePath)
pluginSockFilePath := path.Join(fixture.TmpDir(), fixture.PluginSockFilePath)
t.Setenv("ARGOCD_BINARY_NAME", "argocd-cmp-server")
// ARGOCD_PLUGINSOCKFILEPATH should be set as the same value as repo server env var
t.Setenv("ARGOCD_PLUGINSOCKFILEPATH", pluginSockFilePath)
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/fixture/applicationsets/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ type Context struct {

func Given(t *testing.T) *Context {
t.Helper()

fixture.EnsureCleanState(t)

// TODO: Appset EnsureCleanState specific logic should be moved to the main EnsureCleanState function (https://github.com/argoproj/argo-cd/issues/24307)
utils.EnsureCleanState(t)
return &Context{t: t}
}
Expand Down
25 changes: 0 additions & 25 deletions test/e2e/fixture/applicationsets/utils/cmd.go

This file was deleted.

8 changes: 0 additions & 8 deletions test/e2e/fixture/applicationsets/utils/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1"
appclientset "github.com/argoproj/argo-cd/v3/pkg/client/clientset/versioned"
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
"github.com/argoproj/argo-cd/v3/util/errors"
)

type ExternalNamespace string
Expand All @@ -49,7 +48,6 @@ const (
// Note: this is NOT the namespace the ApplicationSet controller is deployed to; see ArgoCDNamespace.
ApplicationsResourcesNamespace = "applicationset-e2e"

TmpDir = "/tmp/applicationset-e2e"
TestingLabel = "e2e.argoproj.io"
)

Expand Down Expand Up @@ -209,12 +207,6 @@ func EnsureCleanState(t *testing.T) {

require.NoError(t, waitForExpectedClusterState(t))

// remove tmp dir
require.NoError(t, os.RemoveAll(TmpDir))

// create tmp dir
errors.NewHandler(t).FailOnErr(Run("", "mkdir", "-p", TmpDir))

// We can switch user and as result in previous state we will have non-admin user, this case should be reset
require.NoError(t, fixture.LoginAs("admin"))

Expand Down
6 changes: 3 additions & 3 deletions test/e2e/fixture/certs/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ func AddCustomCACert(t *testing.T) {
errors.NewHandler(t).FailOnErr(fixture.RunCli(args...))
certData, err := os.ReadFile(caCertPath)
require.NoError(t, err)
err = os.WriteFile(fixture.TmpDir+"/app/config/tls/localhost", certData, 0o644)
err = os.WriteFile(fixture.TmpDir()+"/app/config/tls/localhost", certData, 0o644)
require.NoError(t, err)
err = os.WriteFile(fixture.TmpDir+"/app/config/tls/127.0.0.1", certData, 0o644)
err = os.WriteFile(fixture.TmpDir()+"/app/config/tls/127.0.0.1", certData, 0o644)
require.NoError(t, err)
} else {
args := []string{"cert", "add-tls", "argocd-e2e-server", "--upsert", "--from", caCertPath}
Expand All @@ -58,7 +58,7 @@ func AddCustomSSHKnownHostsKeys(t *testing.T) {
if fixture.IsLocal() {
knownHostsData, err := os.ReadFile(knownHostsPath)
require.NoError(t, err)
err = os.WriteFile(fixture.TmpDir+"/app/config/ssh/ssh_known_hosts", knownHostsData, 0o644)
err = os.WriteFile(fixture.TmpDir()+"/app/config/ssh/ssh_known_hosts", knownHostsData, 0o644)
require.NoError(t, err)
} else {
fixture.RestartAPIServer(t)
Expand Down
Loading
Loading