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 Jul 3, 2024
1 parent 3fec4a0 commit 2e4c9c7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 18 deletions.
42 changes: 29 additions & 13 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
# Copyright 2024 Flant JSC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: e2e

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

on:
workflow_dispatch:
pull_request:
branches:
- ci/tests/e2e-workflow
Expand All @@ -22,13 +37,19 @@ 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

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

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

- uses: actions/checkout@v4
Expand All @@ -38,13 +59,8 @@ 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 @@ -23,6 +23,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 @@ -48,6 +49,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 2e4c9c7

Please sign in to comment.