Skip to content

Commit d88b572

Browse files
authored
Add script to run Rollouts tests against gitops-operator repo (#723)
Signed-off-by: Jonathan West <[email protected]>
1 parent 6a4fc0a commit d88b572

File tree

2 files changed

+38
-5
lines changed

2 files changed

+38
-5
lines changed

hack/upgrade-rollouts-manager/main.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,9 @@ func createNewCommitAndBranch(latestRolloutsManagerCommitId string, newBranchNam
152152
return false, err
153153
}
154154

155-
// TODO: Uncomment this once we have argo-rollouts test integration with gitops-oeprator
156-
// if err := regenerateE2ETestScript(latestRolloutsManagerCommitId, pathToGitOpsOperatorGitRepo); err != nil {
157-
// return false, err
158-
// }
155+
if err := regenerateE2ETestScript(latestRolloutsManagerCommitId, pathToGitOpsOperatorGitRepo); err != nil {
156+
return false, err
157+
}
159158

160159
if err := copyCRDsFromRolloutsManagerRepo(pathToArgoRolloutsManagerRepo, pathToGitOpsOperatorGitRepo); err != nil {
161160
return false, fmt.Errorf("unable to copy rollouts CRDs: %w", err)
@@ -247,7 +246,7 @@ func regenerateE2ETestScript(commitID string, pathToGitRepo string) error {
247246
// Format of string to modify:
248247
// TARGET_ROLLOUT_MANAGER_COMMIT=(commit id)
249248

250-
path := filepath.Join(pathToGitRepo, "scripts/openshiftci-presubmit-all-tests.sh")
249+
path := filepath.Join(pathToGitRepo, "scripts/run-rollouts-e2e-tests.sh")
251250

252251
fileBytes, err := os.ReadFile(path)
253252
if err != nil {

scripts/run-rollouts-e2e-tests.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# The goal of this script is to run the Argo Rollouts operator tests from the argo-rollouts-manager repo against gitops-operator:
4+
# - Runs the (cluster-scoped) E2E tests of the Argo Rollouts operator
5+
# - Runs the upstream E2E tests from the argo-rollouts repo
6+
7+
ROLLOUTS_TMP_DIR=$(mktemp -d)
8+
9+
cd $ROLLOUTS_TMP_DIR
10+
11+
git clone https://github.com/argoproj-labs/argo-rollouts-manager
12+
13+
cd "$ROLLOUTS_TMP_DIR/argo-rollouts-manager"
14+
15+
# This commit value will be automatically updated by calling 'hack/upgrade-rollouts-manager/go-run.sh':
16+
# - It should always point to the same argo-rollouts-manager commit that is referenced in go.mod of gitops-operator (which will usually be the most recent argo-rollouts-manager commit)
17+
TARGET_ROLLOUT_MANAGER_COMMIT=b3e573f0e6ea3a5ec3eeba70ebb5d90e58efcd68
18+
19+
git checkout $TARGET_ROLLOUT_MANAGER_COMMIT
20+
21+
# 1) Run E2E tests from argo-rollouts-manager repo
22+
23+
make test-e2e
24+
25+
# Clean up old namespaces created by test
26+
# NOTE: remove this once this is handled by 'make test-e2e' in argo-rollouts-manager repo
27+
kubectl delete rolloutmanagers --all -n test-rom-ns-1
28+
29+
cd "$ROLLOUTS_TMP_DIR/argo-rollouts-manager"
30+
31+
32+
# 2) Run E2E tests from argoproj/argo-rollouts repo
33+
34+
SKIP_RUN_STEP=true hack/run-upstream-argo-rollouts-e2e-tests.sh

0 commit comments

Comments
 (0)