From 2ece193f6ee61e5e8aceb9c410f987c601fff3ce Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Wed, 30 Nov 2022 10:52:03 +0800 Subject: [PATCH 1/6] test: trying to fix e2e Signed-off-by: Tiexin Guo --- test/e2e/yaml/e2e-config.yaml | 43 ++++++++++++----------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/test/e2e/yaml/e2e-config.yaml b/test/e2e/yaml/e2e-config.yaml index b62f7c54b..e4a41ba0e 100644 --- a/test/e2e/yaml/e2e-config.yaml +++ b/test/e2e/yaml/e2e-config.yaml @@ -12,7 +12,7 @@ vars: tools: - name: repo-scaffolding - instanceID: golang-github + instanceID: python-github options: destinationRepo: org: [[ githubOrganization ]] @@ -20,51 +20,38 @@ tools: branch: [[ defaultBranch ]] repoType: github vars: - ImageRepo: "[[ dockerRegistryUserName ]]/[[ repoName ]]" + imageRepo: "[[ dockerRegistryUserName ]]/[[ repoName ]]" sourceRepo: org: devstream-io - repo: dtm-scaffolding-golang + repo: dtm-scaffolding-python repoType: github -- name: githubactions-golang +- name: githubactions-python instanceID: default - dependsOn: ["repo-scaffolding.golang-github"] + dependsOn: ["repo-scaffolding.python-github"] options: - org: ${{repo-scaffolding.golang-github.outputs.org}} - repo: ${{repo-scaffolding.golang-github.outputs.repo}} + org: [[ githubOrganization ]] + repo: [[ repoName ]] language: - name: go - version: "1.18" + name: python branch: [[ defaultBranch ]] - build: - enable: True - test: - enable: True - coverage: - enable: True docker: - enable: True registry: type: dockerhub - username: dtme2etest + username: [[ dockerRegistryUserName ]] + repository: [[ repoName ]] - name: helm-installer - instanceID: argocd-001 - options: - chart: - upgradeCRDs: false - valuesYaml: | - crds: - keep: false + instanceID: argocd - name: argocdapp instanceID: default - dependsOn: ["helm-installer.argocd-001", "repo-scaffolding.golang-github"] + dependsOn: ["helm-installer.argocd", "repo-scaffolding.python-github"] options: app: - name: ${{repo-scaffolding.golang-github.outputs.repo}} + name: [[ repoName ]] namespace: argocd destination: server: https://kubernetes.default.svc namespace: default source: valuefile: values.yaml - path: helm/${{repo-scaffolding.golang-github.outputs.repo}} - repoURL: ${{repo-scaffolding.golang-github.outputs.repoURL}} + path: helm/[[ repoName ]] + repoURL: ${{repo-scaffolding.python-github.outputs.repoURL}} From f25124a3b85f31a9231cd9b9dc889505f5192004 Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Wed, 30 Nov 2022 10:54:51 +0800 Subject: [PATCH 2/6] test: trying to fix e2e Signed-off-by: Tiexin Guo --- test/e2e/yaml/e2e-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/yaml/e2e-config.yaml b/test/e2e/yaml/e2e-config.yaml index e4a41ba0e..b72807f7d 100644 --- a/test/e2e/yaml/e2e-config.yaml +++ b/test/e2e/yaml/e2e-config.yaml @@ -7,7 +7,7 @@ config: vars: defaultBranch: main githubOrganization: devstream-io - repoName: dtm-e2e-go + repoName: dtm-e2e-python dockerRegistryUserName: dtme2etest tools: From c24769d67582a86e3cf405bc9364568b0b6cb4d4 Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Wed, 30 Nov 2022 11:20:32 +0800 Subject: [PATCH 3/6] test: trigger e2e Signed-off-by: Tiexin Guo --- .github/workflows/e2e-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index a15f35e4e..27e8d3bc3 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -67,15 +67,15 @@ jobs: aws eks update-kubeconfig --region ap-southeast-1 --name dtm-test - name: copy config files run: cp ./test/e2e/yaml/e2e-*.yaml ./ - - name: apply git-ops - run: ./dtm apply -f e2e-config.yaml -y - - name: apply twice git-ops - run: ./dtm apply -f e2e-config.yaml -y - name: install kubectl run: | curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/linux/amd64/kubectl chmod +x ./kubectl sudo mv ./kubectl /usr/local/bin/kubectl + - name: apply git-ops + run: ./dtm apply -f e2e-config.yaml -y + - name: apply twice git-ops + run: ./dtm apply -f e2e-config.yaml -y - name: check if pod is ready 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 timeout-minutes: 10 From 5f9b15fb6d8d99a48057751bba6b8bd2694ab534 Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Wed, 30 Nov 2022 14:59:01 +0800 Subject: [PATCH 4/6] test: update e2e with apps Signed-off-by: Tiexin Guo --- .github/workflows/e2e-test.yml | 34 +++++++++++------- test/e2e/yaml/e2e-apps.yaml | 35 +++++++++++++++++++ .../yaml/{e2e-config.yaml => e2e-tools.yaml} | 0 3 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 test/e2e/yaml/e2e-apps.yaml rename test/e2e/yaml/{e2e-config.yaml => e2e-tools.yaml} (100%) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 27e8d3bc3..cbdf8bc26 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -18,9 +18,10 @@ env: # see https://github.com/devstream-io/devstream/pull/414 for more info GITHUB_TOKEN: ${{ secrets.E2E_GITHUB_TOKEN }} DOCKERHUB_USERNAME: ${{ secrets.E2E_DOCKERHUB_USERNAME }} + # for github actions DOCKERHUB_TOKEN: ${{ secrets.E2E_DOCKERHUB_TOKEN }} - TRELLO_API_KEY: ${{ secrets.E2E_TRELLO_API_KEY }} - TRELLO_TOKEN: ${{ secrets.E2E_TRELLO_TOKEN }} + # for apps + IMAGE_REPO_PASSWORD: ${{ secrets.E2E_DOCKERHUB_TOKEN }} concurrency: group: ${{ github.workflow }} @@ -65,24 +66,33 @@ jobs: - name: Configure EKS credentials run: | aws eks update-kubeconfig --region ap-southeast-1 --name dtm-test - - name: copy config files - run: cp ./test/e2e/yaml/e2e-*.yaml ./ - - name: install kubectl + - name: Install kubectl run: | curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/linux/amd64/kubectl chmod +x ./kubectl sudo mv ./kubectl /usr/local/bin/kubectl - - name: apply git-ops - run: ./dtm apply -f e2e-config.yaml -y - - name: apply twice git-ops - run: ./dtm apply -f e2e-config.yaml -y + - name: copy config files + run: cp ./test/e2e/yaml/e2e-*.yaml ./ + - name: test 1 - apply git-ops (tools only) + run: ./dtm apply -f e2e-tools.yaml -y + - name: test 1 - apply git-ops (tools only) again + run: ./dtm apply -f e2e-tools.yaml -y + - name: test 1 - check if pod is ready + 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 + timeout-minutes: 10 + - name: test 1 - verify + run: ./dtm verify -f e2e-tools.yaml + - name: test 1 - clean + run: ./dtm delete -f e2e-tools.yaml -y + - name: test 2 - apply (apps) + run: ./dtm apply -f e2e-apps.yaml -y + - name: test 2 - apply (apps) again + run: ./dtm apply -f e2e-apps.yaml -y - name: check if pod is ready 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 timeout-minutes: 10 - - name: verify - run: ./dtm verify -f e2e-config.yaml - name: clean - run: ./dtm delete -f e2e-config.yaml -y + run: ./dtm delete -f e2e-apps.yaml -y - name: test e2e success or not if: failure() run: | diff --git a/test/e2e/yaml/e2e-apps.yaml b/test/e2e/yaml/e2e-apps.yaml new file mode 100644 index 000000000..73b03f1d0 --- /dev/null +++ b/test/e2e/yaml/e2e-apps.yaml @@ -0,0 +1,35 @@ +config: + state: + backend: local + options: + stateFile: devstream.state + +vars: + defaultBranch: main + repoOwner: devstream-io + repoName: dtm-e2e-go + dockerRegistryUserName: dtme2etest + +tools: +- name: helm-installer + instanceID: argocd + +apps: +- name: dtm-e2e-go + spec: + framework: gin + language: golang + repo: + owner: [[ repoOwner ]] + scmType: github + repoTemplate: + url: [[ repoTemplateBaseURL ]]/dtm-scaffolding-golang + vars: + imageRepo: [[ imageRepoOwner ]]/dtm-e2e-go + ci: + - type: github-actions + options: + imageRepo: + user: [[ imageRepoOwner ]] + cd: + - type: argocdapp diff --git a/test/e2e/yaml/e2e-config.yaml b/test/e2e/yaml/e2e-tools.yaml similarity index 100% rename from test/e2e/yaml/e2e-config.yaml rename to test/e2e/yaml/e2e-tools.yaml From be3dcacd1226d88b8c4977def0ed40dcbee75821 Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Wed, 30 Nov 2022 15:01:29 +0800 Subject: [PATCH 5/6] test: update e2e with apps Signed-off-by: Tiexin Guo --- .github/workflows/e2e-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index cbdf8bc26..593e11a2b 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -88,10 +88,10 @@ jobs: run: ./dtm apply -f e2e-apps.yaml -y - name: test 2 - apply (apps) again run: ./dtm apply -f e2e-apps.yaml -y - - name: check if pod is ready + - name: test 2 - check if pod is ready 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 timeout-minutes: 10 - - name: clean + - name: test 2 - clean run: ./dtm delete -f e2e-apps.yaml -y - name: test e2e success or not if: failure() From 32af388084090a5c15d6792d7e0f8c5b7bc7581f Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Fri, 2 Dec 2022 10:41:04 +0800 Subject: [PATCH 6/6] test: trying to fix e2e Signed-off-by: Tiexin Guo --- .github/workflows/e2e-test.yml | 3 +-- test/e2e/yaml/e2e-tools.yaml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 593e11a2b..4950a5730 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -40,7 +40,6 @@ jobs: runs-on: [self-hosted, linux, X64] name: e2e-test-${{ matrix.os }} steps: - - run: echo "🐧 This job is now running on a ${{ runner.os }}-${{ runner.arch }} server hosted by GitHub!" - name: Checkout uses: actions/checkout@v3 - name: Setup Golang env @@ -78,7 +77,7 @@ jobs: - name: test 1 - apply git-ops (tools only) again run: ./dtm apply -f e2e-tools.yaml -y - name: test 1 - check if pod is ready - 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 + run: while [[ $(kubectl get pods -l app=dtme2epython -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "pod not ready yet..."; sleep 3; done timeout-minutes: 10 - name: test 1 - verify run: ./dtm verify -f e2e-tools.yaml diff --git a/test/e2e/yaml/e2e-tools.yaml b/test/e2e/yaml/e2e-tools.yaml index b72807f7d..ab91ddf1a 100644 --- a/test/e2e/yaml/e2e-tools.yaml +++ b/test/e2e/yaml/e2e-tools.yaml @@ -7,7 +7,7 @@ config: vars: defaultBranch: main githubOrganization: devstream-io - repoName: dtm-e2e-python + repoName: dtme2epython dockerRegistryUserName: dtme2etest tools: