Skip to content

Commit

Permalink
chore: run one e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Korolev <[email protected]>
  • Loading branch information
universal-itengineer committed Apr 19, 2024
1 parent 9cf80b9 commit 3937e67
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ env:
CI_COMMIT_REF_NAME: ${{ github.ref_name }}

on:
workflow_dispatch:
pull_request:
branches:
- ci/tests/e2e-workflow
Expand All @@ -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

Expand All @@ -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
9 changes: 4 additions & 5 deletions tests/e2e/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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"
Expand All @@ -47,7 +47,6 @@ tasks:
run_one:
desc: "Run one test or group"
deps:
- virtctl
- ginkgo
cmds:
- |
Expand Down
3 changes: 3 additions & 0 deletions tests/e2e/tests_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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)
}
Expand Down

0 comments on commit 3937e67

Please sign in to comment.