From 3937e674c8c5836b62845a6659e6b47ca9d95833 Mon Sep 17 00:00:00 2001 From: Nikita Korolev Date: Tue, 16 Apr 2024 22:25:02 +0300 Subject: [PATCH] chore: run one e2e test Signed-off-by: Nikita Korolev --- .github/workflows/e2e.yaml | 20 +++++++++++--------- tests/e2e/Taskfile.yaml | 9 ++++----- tests/e2e/tests_suite_test.go | 3 +++ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index d3b31305..0432da32 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -4,6 +4,7 @@ env: CI_COMMIT_REF_NAME: ${{ github.ref_name }} on: + workflow_dispatch: pull_request: branches: - ci/tests/e2e-workflow @@ -22,8 +23,13 @@ concurrency: jobs: show_dev_manifest: runs-on: ubuntu-latest - name: Show manifest + name: Run e2e steps: + - name: Set up Go 1.21 + uses: actions/setup-go@v5 + with: + go-version: "1.21" + - name: Install Task uses: arduino/setup-task@v2 @@ -38,13 +44,9 @@ jobs: method: service-account k8s-url: https://api.e2e.virtlab.flant.com k8s-secret: ${{ secrets.E2E_VIRTUALIZATION_SA_SECRET }} - # token: ${{ secrets.E2E_VIRTUALIZATION_SA_TOKEN }} - - - name: Create Namespace - run: | - kubectl create namespace testgh - - name: Get ns and delete + - name: e2e run: | - kubectl get ns | grep testgh - kubectl delete namespace testgh + export E2E_CLUSTERTRANSPORT_KUBECONFIG=$KUBECONFIG + task run_local + diff --git a/tests/e2e/Taskfile.yaml b/tests/e2e/Taskfile.yaml index 87057e16..625d4088 100644 --- a/tests/e2e/Taskfile.yaml +++ b/tests/e2e/Taskfile.yaml @@ -3,7 +3,7 @@ version: "3" silent: true vars: - E2E_CLUSTERTRANSPORT_KUBECONFIG: '{{default "$HOME/.kube/config" .E2E_CLUSTERTRANSPORT_KUBECONFIG}}' + E2E_CLUSTERTRANSPORT_KUBECONFIG: '{{ .E2E_CLUSTERTRANSPORT_KUBECONFIG | default "$HOME/.kube/config"}}' GINKGO_VERSION: "2.13.2" VERSION: "v1.0.0" @@ -22,9 +22,9 @@ tasks: ginkgo: cmds: - | - v=($(ginkgo version 2>/dev/null)) - if [ "${v[2]}" != "{{ .GINKGO_VERSION }}" ]; then - go install github.com/onsi/ginkgo/v2/ginkgo@v"{{ .GINKGO_VERSION }}" ; + v=($(ginkgo version 2>/dev/null || true)) + if [ "${v[2]}" != "{{ .GINKGO_VERSION }}" ]; then + go install github.com/onsi/ginkgo/v2/ginkgo@v"{{ .GINKGO_VERSION }}" ; fi run: desc: "Run e2e tests" @@ -47,7 +47,6 @@ tasks: run_one: desc: "Run one test or group" deps: - - virtctl - ginkgo cmds: - | diff --git a/tests/e2e/tests_suite_test.go b/tests/e2e/tests_suite_test.go index 136d82bb..f323e77b 100644 --- a/tests/e2e/tests_suite_test.go +++ b/tests/e2e/tests_suite_test.go @@ -7,6 +7,7 @@ import ( virt "github.com/deckhouse/virtualization/tests/e2e/virtctl" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "sigs.k8s.io/yaml" "testing" "time" ) @@ -32,6 +33,8 @@ func init() { if conf, err = config.GetConfig(); err != nil { panic(err) } + b, _ := yaml.Marshal(conf) + fmt.Println(string(b)) if kubectl, err = kc.NewKubectl(kc.KubectlConf(conf.ClusterTransport)); err != nil { panic(err) }