Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): add e2e tests workflow #61

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: e2e

env:
CI_COMMIT_REF_NAME: ${{ github.ref_name }}

on:
workflow_dispatch:
pull_request:
branches:
- ci/tests/e2e-workflow
push:
branches:
- ci/tests/e2e-workflow

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

jobs:
show_dev_manifest:
runs-on: ubuntu-latest
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

- uses: azure/setup-kubectl@v3
# default is latest stable
id: install

- uses: actions/checkout@v4

- uses: azure/k8s-set-context@v4
with:
method: service-account
k8s-url: https://api.e2e.virtlab.flant.com
k8s-secret: ${{ secrets.E2E_VIRTUALIZATION_SA_SECRET }}

- name: e2e
run: |
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
Loading