Skip to content

Commit

Permalink
test: Get tests running on release branches (argoproj#2767)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed Apr 20, 2020
1 parent 1c8318e commit dedec90
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ $(VERSION_FILE):
touch $(VERSION_FILE)

dist/postgres.yaml: $(MANIFESTS) $(E2E_MANIFESTS) $(VERSION_FILE)
kustomize build --load_restrictor=none test/e2e/manifests/postgres | sed 's/:$(MANIFESTS_VERSION)/:$(VERSION)/' | sed 's/pns/$(E2E_EXECUTOR)/' > dist/postgres.yaml
kustomize build --load_restrictor=none test/e2e/manifests/postgres | sed 's/:$(MANIFESTS_VERSION)/:$(VERSION)/' | sed 's/:E2E_TAG/:$(VERSION)/' | sed 's/pns/$(E2E_EXECUTOR)/' > dist/postgres.yaml

dist/no-db.yaml: $(MANIFESTS) $(E2E_MANIFESTS) $(VERSION_FILE)
# We additionally disable ALWAYS_OFFLOAD_NODE_STATUS
kustomize build --load_restrictor=none test/e2e/manifests/no-db | sed 's/:$(MANIFESTS_VERSION)/:$(VERSION)/' | sed 's/pns/$(E2E_EXECUTOR)/' | sed 's/"true"/"false"/' > dist/no-db.yaml
kustomize build --load_restrictor=none test/e2e/manifests/no-db | sed 's/:$(MANIFESTS_VERSION)/:$(VERSION)/' | sed 's/:E2E_TAG/:$(VERSION)/' | sed 's/pns/$(E2E_EXECUTOR)/' | sed 's/"true"/"false"/' > dist/no-db.yaml

dist/mysql.yaml: $(MANIFESTS) $(E2E_MANIFESTS) $(VERSION_FILE)
kustomize build --load_restrictor=none test/e2e/manifests/mysql | sed 's/:$(MANIFESTS_VERSION)/:$(VERSION)/' | sed 's/pns/$(E2E_EXECUTOR)/' > dist/mysql.yaml
kustomize build --load_restrictor=none test/e2e/manifests/mysql | sed 's/:$(MANIFESTS_VERSION)/:$(VERSION)/' | sed 's/:E2E_TAG/:$(VERSION)/' | sed 's/pns/$(E2E_EXECUTOR)/' > dist/mysql.yaml

.PHONY: install
install: dist/postgres.yaml dist/mysql.yaml dist/no-db.yaml
Expand Down
12 changes: 10 additions & 2 deletions test/e2e/fixtures/e2e_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,22 @@ var imageTag string
var k3d bool

func init() {
output, err := runCli("git", "rev-parse", "--abbrev-ref=loose", "HEAD")
gitBranch, err := runCli("git", "rev-parse", "--abbrev-ref=loose", "HEAD")
if err != nil {
panic(err)
}
imageTag = strings.TrimSpace(output)
imageTag = strings.TrimSpace(gitBranch)
if imageTag == "master" {
imageTag = "latest"
}
if strings.HasPrefix(gitBranch, "release-2") {
tags, err := runCli("git", "tag", "--merged")
if err != nil {
panic(err)
}
parts := strings.Split(tags, "\n")
imageTag = parts[len(parts)-2]
}
context, err := runCli("kubectl", "config", "current-context")
if err != nil {
panic(err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
imagePullPolicy: Never
args:
- --executor-image
- argoproj/argoexec:latest
- argoproj/argoexec:E2E_TAG
- --namespaced
- --loglevel
- debug
Expand Down

0 comments on commit dedec90

Please sign in to comment.