This repository was archived by the owner on Dec 12, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed
Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 6464vet :
6565 go vet ./...
6666
67+ # Run e2e tests locally using go build while also setting up a proxy in the shell to allow
68+ # the test to run as if it were inside the cluster. This enables mongodb connectivity while running locally.
69+ e2e-telepresence : install
70+ telepresence connect; \
71+ telepresence status; \
72+ eval $$(scripts/dev/get_e2e_env_vars.py $(cleanup ) ) ; \
73+ go test -v -timeout=30m -failfast ./test/e2e/$(test); \
74+ telepresence quit
75+
6776# Run e2e test by deploying test image in kubernetes.
6877e2e-k8s : install e2e-image
6978 python scripts/dev/e2e.py --perform-cleanup --test $(test )
@@ -126,3 +135,5 @@ rm -rf $$TMP_DIR ;\
126135}
127136endef
128137
138+ install-prerequisites-macos :
139+ scripts/dev/install_prerequisites.sh
Original file line number Diff line number Diff line change @@ -201,6 +201,19 @@ make e2e-k8s test=<test-name>
201201This will run the ` replica_set ` E2E test which is a simple test which installs a
202202MongoDB Replica Set and asserts that the deployed server can be connected to.
203203
204+
205+ ### Run the test locally with go test & Telepresence
206+ ``` sh
207+ make e2e-telepresence test=< test-name>
208+ ```
209+
210+ This method uses telepresence to allow connectivity as if your local machine is in the kubernetes cluster,
211+ there will be full MongoDB connectivity using ` go test ` locally.
212+
213+ Note: you must install [ telepresence] ( https://www.getambassador.io/docs/telepresence/latest/quick-start/ ) before using this method.
214+
215+ If on MacOS, you can run ` make install-prerequisites-macos ` which will perform the installation.
216+
204217## Troubleshooting
205218When you run a test locally, if the ` e2e-test ` pod is present, you will have to
206219first manually delete it; failing to do so will cause the ` e2e-test ` pod to fail.
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ if ! command -v telepresence & > /dev/null; then \
4+ echo " Telepresence not found, installing now"
5+ sudo curl -fL https://app.getambassador.io/download/tel2/darwin/amd64/latest/telepresence -o /usr/local/bin/telepresence
6+ sudo chmod a+x /usr/local/bin/telepresence
7+ else
8+ echo " Telepresence already installed."
9+ fi
You can’t perform that action at this time.
0 commit comments