From 61dd69281987a19aa85c6641bce8e117f16f3ba8 Mon Sep 17 00:00:00 2001 From: Somefive Date: Tue, 18 Apr 2023 14:39:09 +0800 Subject: [PATCH] Chore: refactor e2e test (#5871) Signed-off-by: Somefive --- .github/workflows/back-port.yml | 2 +- .github/workflows/chart.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/commit-lint.yml | 2 +- .github/workflows/core-api-test.yml | 2 +- .github/workflows/definition-lint.yml | 2 +- .github/workflows/e2e-multicluster-test.yml | 10 +++--- .github/workflows/e2e-rollout-test.yml | 36 +++++++++++++-------- .github/workflows/e2e-test.yml | 16 ++++++--- .github/workflows/go.yml | 22 +++++++++---- .github/workflows/issue-commands.yml | 2 +- .github/workflows/license.yml | 2 +- .github/workflows/registry.yml | 6 ++-- .github/workflows/release.yml | 4 +-- .github/workflows/scorecards.yml | 2 +- .github/workflows/sdk-test.yml | 2 +- .github/workflows/sync-api.yml | 2 +- .github/workflows/sync-sdk.yaml | 2 +- .github/workflows/timed-task.yml | 14 -------- .github/workflows/trivy-scan.yml | 2 +- .github/workflows/unit-test.yml | 4 +-- charts/vela-core/README.md | 6 ---- charts/vela-minimal/README.md | 6 ---- 23 files changed, 75 insertions(+), 75 deletions(-) delete mode 100644 .github/workflows/timed-task.yml diff --git a/.github/workflows/back-port.yml b/.github/workflows/back-port.yml index 811448b6d..d963d62c4 100644 --- a/.github/workflows/back-port.yml +++ b/.github/workflows/back-port.yml @@ -10,7 +10,7 @@ permissions: jobs: # align with crossplane's choice https://github.com/crossplane/crossplane/blob/master/.github/workflows/backport.yml open-pr: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 if: github.event.pull_request.merged permissions: contents: write diff --git a/.github/workflows/chart.yml b/.github/workflows/chart.yml index 0f112001c..55dd4ec0c 100644 --- a/.github/workflows/chart.yml +++ b/.github/workflows/chart.yml @@ -29,7 +29,7 @@ jobs: MINIMAL_HELM_CHART_NAME: vela-minimal LEGACY_HELM_CHART_NAME: vela-core-legacy VELA_ROLLOUT_HELM_CHART_NAME: vela-rollout - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f - name: Get git revision diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d049723a4..91af7bbb6 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -10,7 +10,7 @@ permissions: jobs: analyze: name: Analyze - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 permissions: actions: read # for github/codeql-action/init to get workflow details diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index a66039c6c..1099be581 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -13,7 +13,7 @@ permissions: jobs: check: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: thehanimo/pr-title-checker@v1.3.7 with: diff --git a/.github/workflows/core-api-test.yml b/.github/workflows/core-api-test.yml index 3ef9b970a..3cdd13b1c 100644 --- a/.github/workflows/core-api-test.yml +++ b/.github/workflows/core-api-test.yml @@ -14,7 +14,7 @@ permissions: jobs: core-api-test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Set up Go 1.19 uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 diff --git a/.github/workflows/definition-lint.yml b/.github/workflows/definition-lint.yml index 653319b04..5707582d5 100644 --- a/.github/workflows/definition-lint.yml +++ b/.github/workflows/definition-lint.yml @@ -20,7 +20,7 @@ env: jobs: definition-doc: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Setup Go uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 diff --git a/.github/workflows/e2e-multicluster-test.yml b/.github/workflows/e2e-multicluster-test.yml index 0c855c2d6..15b9b4a2e 100644 --- a/.github/workflows/e2e-multicluster-test.yml +++ b/.github/workflows/e2e-multicluster-test.yml @@ -25,7 +25,7 @@ jobs: detect-noop: permissions: actions: write - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 outputs: noop: ${{ steps.noop.outputs.should_skip }} steps: @@ -39,12 +39,12 @@ jobs: continue-on-error: true e2e-multi-cluster-tests: - runs-on: aliyun + runs-on: self-hosted needs: [ detect-noop ] if: needs.detect-noop.outputs.noop != 'true' strategy: matrix: - k8s-version: ["v1.20","v1.26"] + k8s-version: ["v1.26"] concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }} cancel-in-progress: true @@ -130,4 +130,6 @@ jobs: - name: Cleanup image if: ${{ always() }} - run: make image-cleanup + run: | + make image-cleanup + docker image prune -a -f --filter "until=24h" diff --git a/.github/workflows/e2e-rollout-test.yml b/.github/workflows/e2e-rollout-test.yml index 8f2979bda..6ce422d22 100644 --- a/.github/workflows/e2e-rollout-test.yml +++ b/.github/workflows/e2e-rollout-test.yml @@ -1,17 +1,17 @@ name: E2E Rollout Test on: - push: - branches: - - master - - release-* - tags: - - v* +# push: +# branches: +# - master +# - release-* +# tags: +# - v* workflow_dispatch: {} - pull_request: - branches: - - master - - release-* +# pull_request: +# branches: +# - master +# - release-* permissions: contents: read @@ -25,7 +25,7 @@ jobs: detect-noop: permissions: actions: write - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 outputs: noop: ${{ steps.noop.outputs.should_skip }} steps: @@ -39,12 +39,12 @@ jobs: continue-on-error: true e2e-rollout-tests: - runs-on: aliyun + runs-on: self-hosted needs: [ detect-noop ] if: needs.detect-noop.outputs.noop != 'true' strategy: matrix: - k8s-version: ["v1.20","v1.26"] + k8s-version: ["v1.26"] concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }} cancel-in-progress: true @@ -63,6 +63,11 @@ jobs: run: | go get -v -t -d ./... + - name: Get Ginkgo + run: | + go install github.com/onsi/ginkgo/ginkgo + go get github.com/onsi/gomega/... + - name: Tear down K3d if exist run: | k3d cluster delete || true @@ -113,4 +118,7 @@ jobs: - name: Cleanup image if: ${{ always() }} - run: make image-cleanup + run: | + make image-cleanup + docker image prune -a -f --filter "until=24h" + diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index bb64d90fe..9521b5d5e 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -25,7 +25,7 @@ jobs: detect-noop: permissions: actions: write - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 outputs: noop: ${{ steps.noop.outputs.should_skip }} steps: @@ -39,17 +39,16 @@ jobs: continue-on-error: true e2e-tests: - runs-on: aliyun + runs-on: self-hosted needs: [ detect-noop ] if: needs.detect-noop.outputs.noop != 'true' strategy: matrix: - k8s-version: ["v1.20","v1.26"] + k8s-version: ["v1.26"] concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }} cancel-in-progress: true - steps: - name: Check out code into the Go module directory uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f @@ -63,6 +62,11 @@ jobs: run: | go get -v -t -d ./... + - name: Get Ginkgo + run: | + go install github.com/onsi/ginkgo/ginkgo + go get github.com/onsi/gomega/... + - name: Tear down K3d if exist run: | k3d cluster delete || true @@ -120,4 +124,6 @@ jobs: - name: Cleanup image if: ${{ always() }} - run: make image-cleanup + run: | + make image-cleanup + docker image prune -a -f --filter "until=24h" diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9ff2403e8..04bc0d6f7 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -22,7 +22,7 @@ env: jobs: detect-noop: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 outputs: noop: ${{ steps.noop.outputs.should_skip }} permissions: @@ -38,7 +38,7 @@ jobs: continue-on-error: true staticcheck: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: detect-noop if: needs.detect-noop.outputs.noop != 'true' @@ -60,7 +60,7 @@ jobs: run: make check-license-header lint: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: detect-noop if: needs.detect-noop.outputs.noop != 'true' permissions: @@ -88,7 +88,7 @@ jobs: version: ${{ env.GOLANGCI_VERSION }} check-diff: - runs-on: aliyun + runs-on: ubuntu-22.04 needs: detect-noop if: needs.detect-noop.outputs.noop != 'true' @@ -115,6 +115,16 @@ jobs: key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-pkg- + - name: Tear down K3d if exist + run: | + k3d cluster delete || true + + - name: Setup K3d (Hub) + uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96 + with: + version: ${{ matrix.k8s-version }} + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Run cross-build run: make cross-build @@ -159,7 +169,7 @@ jobs: .\bin\vela.exe version check-core-image-build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: detect-noop if: needs.detect-noop.outputs.noop != 'true' steps: @@ -179,7 +189,7 @@ jobs: platforms: linux/amd64,linux/arm64 check-cli-image-build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: detect-noop if: needs.detect-noop.outputs.noop != 'true' steps: diff --git a/.github/workflows/issue-commands.yml b/.github/workflows/issue-commands.yml index 0422e7c19..853a98ba8 100644 --- a/.github/workflows/issue-commands.yml +++ b/.github/workflows/issue-commands.yml @@ -10,7 +10,7 @@ permissions: jobs: bot: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout Actions uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml index 7b0c226d7..0097d496d 100644 --- a/.github/workflows/license.yml +++ b/.github/workflows/license.yml @@ -15,7 +15,7 @@ permissions: jobs: license_check: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 name: Check for unapproved licenses steps: - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f diff --git a/.github/workflows/registry.yml b/.github/workflows/registry.yml index 046547051..77f67bac2 100644 --- a/.github/workflows/registry.yml +++ b/.github/workflows/registry.yml @@ -18,7 +18,7 @@ jobs: publish-core-images: permissions: packages: write - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f - name: Get the version @@ -98,7 +98,7 @@ jobs: publish-addon-images: permissions: packages: write - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f - name: Get the version @@ -161,7 +161,7 @@ jobs: CAPABILITY_BUCKET: kubevela-registry CAPABILITY_DIR: capabilities CAPABILITY_ENDPOINT: oss-cn-beijing.aliyuncs.com - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f - name: Install ossutil diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69ce45ab9..c677362f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: pull-requests: read repository-projects: read statuses: read - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 name: goreleaser steps: - name: Checkout @@ -78,7 +78,7 @@ jobs: repository-projects: read statuses: read needs: build - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 if: ${{ !contains(github.ref, 'alpha') && !contains(github.ref, 'beta') && !contains(github.ref, 'rc') }} name: upload-sha256sums steps: diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 2997c20a4..6d54fdfcb 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -12,7 +12,7 @@ permissions: read-all jobs: analysis: name: Scorecards analysis - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 permissions: # Needed to upload the results to code-scanning dashboard. security-events: write diff --git a/.github/workflows/sdk-test.yml b/.github/workflows/sdk-test.yml index 9cc005554..687ed9fd4 100644 --- a/.github/workflows/sdk-test.yml +++ b/.github/workflows/sdk-test.yml @@ -23,7 +23,7 @@ env: jobs: sdk-tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Check out code into the Go module directory uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f diff --git a/.github/workflows/sync-api.yml b/.github/workflows/sync-api.yml index 248d83c8b..d0f9a217c 100644 --- a/.github/workflows/sync-api.yml +++ b/.github/workflows/sync-api.yml @@ -15,7 +15,7 @@ env: jobs: sync-core-api: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Set up Go uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 diff --git a/.github/workflows/sync-sdk.yaml b/.github/workflows/sync-sdk.yaml index ceef12821..f2489cb7b 100644 --- a/.github/workflows/sync-sdk.yaml +++ b/.github/workflows/sync-sdk.yaml @@ -19,7 +19,7 @@ env: jobs: sync_sdk: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Set up Go uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 diff --git a/.github/workflows/timed-task.yml b/.github/workflows/timed-task.yml deleted file mode 100644 index b309b0777..000000000 --- a/.github/workflows/timed-task.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Timed Task -on: - schedule: - - cron: '* * * * *' - -permissions: - contents: read - -jobs: - clean-image: - runs-on: aliyun - steps: - - name: Cleanup image - run: docker image prune -f \ No newline at end of file diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index 522c2df82..733667efe 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -10,7 +10,7 @@ permissions: jobs: images: name: Image Scan - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index d12a3af14..653a2c6be 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -23,7 +23,7 @@ jobs: detect-noop: permissions: actions: write # for fkirc/skip-duplicate-actions to skip or stop workflow runs - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 outputs: noop: ${{ steps.noop.outputs.should_skip }} steps: @@ -37,7 +37,7 @@ jobs: continue-on-error: true unit-tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: detect-noop if: needs.detect-noop.outputs.noop != 'true' diff --git a/charts/vela-core/README.md b/charts/vela-core/README.md index 92c01e367..9b5b7e4c1 100644 --- a/charts/vela-core/README.md +++ b/charts/vela-core/README.md @@ -49,7 +49,6 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wai | `disableCaps` | Disable capability | `rollout` | | `dependCheckWait` | dependCheckWait is the time to wait for ApplicationConfiguration's dependent-resource ready | `30s` | - ### KubeVela workflow parameters | Name | Description | Value | @@ -59,7 +58,6 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wai | `workflow.backoff.maxTime.failedState` | The max backoff time of workflow in a failed condition | `300` | | `workflow.step.errorRetryTimes` | The max retry times of a failed workflow step | `10` | - ### KubeVela controller parameters | Name | Description | Value | @@ -77,7 +75,6 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wai | `webhookService.port` | KubeVela webhook service port | `9443` | | `healthCheck.port` | KubeVela health check port | `9440` | - ### KubeVela controller optimization parameters | Name | Description | Value | @@ -104,7 +101,6 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wai | `featureGates.sharedDefinitionStorageForApplicationRevision` | use definition cache to reduce duplicated definition storage for application revision, must be used with InformerCacheFilterUnnecessaryFields | `true` | | `featureGates.disableWorkflowContextConfigMapCache` | disable the workflow context's configmap informer cache | `true` | - ### MultiCluster parameters | Name | Description | Value | @@ -125,7 +121,6 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wai | `multicluster.clusterGateway.secureTLS.certPath` | Path to the certificate file | `/etc/k8s-cluster-gateway-certs` | | `multicluster.clusterGateway.secureTLS.certManager.enabled` | Whether to enable cert-manager | `false` | - ### Test parameters | Name | Description | Value | @@ -135,7 +130,6 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-core --wai | `test.k8s.repository` | Test k8s repository | `oamdev/alpine-k8s` | | `test.k8s.tag` | Test k8s tag | `1.18.2` | - ### Common parameters | Name | Description | Value | diff --git a/charts/vela-minimal/README.md b/charts/vela-minimal/README.md index c7b18655a..4a5ece77c 100644 --- a/charts/vela-minimal/README.md +++ b/charts/vela-minimal/README.md @@ -67,7 +67,6 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-minimal -- | `disableCaps` | Disable capability | `envbinding,rollout` | | `dependCheckWait` | dependCheckWait is the time to wait for ApplicationConfiguration's dependent-resource ready | `30s` | - ### KubeVela workflow parameters | Name | Description | Value | @@ -77,7 +76,6 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-minimal -- | `workflow.backoff.maxTime.failedState` | The max backoff time of workflow in a failed condition | `300` | | `workflow.step.errorRetryTimes` | The max retry times of a failed workflow step | `10` | - ### KubeVela controller parameters | Name | Description | Value | @@ -95,14 +93,12 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-minimal -- | `webhookService.port` | KubeVela webhook service port | `9443` | | `healthCheck.port` | KubeVela health check port | `9440` | - ### KubeVela controller optimization parameters | Name | Description | Value | | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | ------- | | `featureGates.applyOnce` | if enabled, the apply-once feature will be applied to all applications, no state-keep and no resource data storage in ResourceTracker | `false` | - ### MultiCluster parameters | Name | Description | Value | @@ -120,7 +116,6 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-minimal -- | `multicluster.clusterGateway.secureTLS.enabled` | Whether to enable secure TLS | `true` | | `multicluster.clusterGateway.secureTLS.certPath` | Path to the certificate file | `/etc/k8s-cluster-gateway-certs` | - ### Test parameters | Name | Description | Value | @@ -130,7 +125,6 @@ helm install --create-namespace -n vela-system kubevela kubevela/vela-minimal -- | `test.k8s.repository` | Test k8s repository | `oamdev/alpine-k8s` | | `test.k8s.tag` | Test k8s tag | `1.18.2` | - ### Common parameters | Name | Description | Value |