Skip to content

Commit 751b560

Browse files
authored
App centric config e2e test (#1278)
* test: fix e2e * test: add e2e for apps Signed-off-by: Tiexin Guo <[email protected]>
1 parent 6495a11 commit 751b560

File tree

3 files changed

+59
-14
lines changed

3 files changed

+59
-14
lines changed

.github/workflows/e2e-test.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ env:
1818
# see https://github.com/devstream-io/devstream/pull/414 for more info
1919
GITHUB_TOKEN: ${{ secrets.E2E_GITHUB_TOKEN }}
2020
DOCKERHUB_USERNAME: ${{ secrets.E2E_DOCKERHUB_USERNAME }}
21+
# for github actions
2122
DOCKERHUB_TOKEN: ${{ secrets.E2E_DOCKERHUB_TOKEN }}
22-
TRELLO_API_KEY: ${{ secrets.E2E_TRELLO_API_KEY }}
23-
TRELLO_TOKEN: ${{ secrets.E2E_TRELLO_TOKEN }}
23+
# for apps
24+
IMAGE_REPO_PASSWORD: ${{ secrets.E2E_DOCKERHUB_TOKEN }}
2425

2526
concurrency:
2627
group: ${{ github.workflow }}
@@ -65,24 +66,33 @@ jobs:
6566
- name: Configure EKS credentials
6667
run: |
6768
aws eks update-kubeconfig --region ap-southeast-1 --name dtm-test
68-
- name: copy config files
69-
run: cp ./test/e2e/yaml/e2e-*.yaml ./
70-
- name: install kubectl
69+
- name: Install kubectl
7170
run: |
7271
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/linux/amd64/kubectl
7372
chmod +x ./kubectl
7473
sudo mv ./kubectl /usr/local/bin/kubectl
75-
- name: apply git-ops
76-
run: ./dtm apply -f e2e-config.yaml -y
77-
- name: apply twice git-ops
78-
run: ./dtm apply -f e2e-config.yaml -y
79-
- name: check if pod is ready
74+
- name: copy config files
75+
run: cp ./test/e2e/yaml/e2e-*.yaml ./
76+
- name: test 1 - apply git-ops (tools only)
77+
run: ./dtm apply -f e2e-tools.yaml -y
78+
- name: test 1 - apply git-ops (tools only) again
79+
run: ./dtm apply -f e2e-tools.yaml -y
80+
- name: test 1 - check if pod is ready
81+
run: while [[ $(kubectl get pods -l app=dtm-e2e-python -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "pod not ready yet..."; sleep 3; done
82+
timeout-minutes: 10
83+
- name: test 1 - verify
84+
run: ./dtm verify -f e2e-tools.yaml
85+
- name: test 1 - clean
86+
run: ./dtm delete -f e2e-tools.yaml -y
87+
- name: test 2 - apply (apps)
88+
run: ./dtm apply -f e2e-apps.yaml -y
89+
- name: test 2 - apply (apps) again
90+
run: ./dtm apply -f e2e-apps.yaml -y
91+
- name: test 2 - check if pod is ready
8092
run: while [[ $(kubectl get pods -l app=dtm-e2e-go -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "pod not ready yet..."; sleep 3; done
8193
timeout-minutes: 10
82-
- name: verify
83-
run: ./dtm verify -f e2e-config.yaml
84-
- name: clean
85-
run: ./dtm delete -f e2e-config.yaml -y
94+
- name: test 2 - clean
95+
run: ./dtm delete -f e2e-apps.yaml -y
8696
- name: test e2e success or not
8797
if: failure()
8898
run: |

test/e2e/yaml/e2e-apps.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
config:
2+
state:
3+
backend: local
4+
options:
5+
stateFile: devstream.state
6+
7+
vars:
8+
defaultBranch: main
9+
repoOwner: devstream-io
10+
repoName: dtm-e2e-go
11+
dockerRegistryUserName: dtme2etest
12+
13+
tools:
14+
- name: helm-installer
15+
instanceID: argocd
16+
17+
apps:
18+
- name: dtm-e2e-go
19+
spec:
20+
framework: gin
21+
language: golang
22+
repo:
23+
owner: [[ repoOwner ]]
24+
scmType: github
25+
repoTemplate:
26+
url: [[ repoTemplateBaseURL ]]/dtm-scaffolding-golang
27+
vars:
28+
imageRepo: [[ imageRepoOwner ]]/dtm-e2e-go
29+
ci:
30+
- type: github-actions
31+
options:
32+
imageRepo:
33+
user: [[ imageRepoOwner ]]
34+
cd:
35+
- type: argocdapp

0 commit comments

Comments
 (0)