Skip to content

Commit 2e4c9c7

Browse files
chore: run one e2e test
Signed-off-by: Nikita Korolev <[email protected]>
1 parent 3fec4a0 commit 2e4c9c7

File tree

3 files changed

+36
-18
lines changed

3 files changed

+36
-18
lines changed

Diff for: .github/workflows/e2e.yaml

+29-13
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
1+
# Copyright 2024 Flant JSC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
name: e2e
216

317
env:
418
CI_COMMIT_REF_NAME: ${{ github.ref_name }}
519

620
on:
21+
workflow_dispatch:
722
pull_request:
823
branches:
924
- ci/tests/e2e-workflow
@@ -22,13 +37,19 @@ concurrency:
2237
jobs:
2338
show_dev_manifest:
2439
runs-on: ubuntu-latest
25-
name: Show manifest
40+
name: Run e2e
2641
steps:
42+
- name: Set up Go 1.21
43+
uses: actions/setup-go@v5
44+
with:
45+
go-version: "1.21"
46+
2747
- name: Install Task
2848
uses: arduino/setup-task@v2
29-
30-
- uses: azure/setup-kubectl@v3
31-
# default is latest stable
49+
50+
- uses:
51+
azure/setup-kubectl@v3
52+
# default is latest stable
3253
id: install
3354

3455
- uses: actions/checkout@v4
@@ -38,13 +59,8 @@ jobs:
3859
method: service-account
3960
k8s-url: https://api.e2e.virtlab.flant.com
4061
k8s-secret: ${{ secrets.E2E_VIRTUALIZATION_SA_SECRET }}
41-
# token: ${{ secrets.E2E_VIRTUALIZATION_SA_TOKEN }}
42-
43-
- name: Create Namespace
44-
run: |
45-
kubectl create namespace testgh
46-
47-
- name: Get ns and delete
62+
63+
- name: e2e
4864
run: |
49-
kubectl get ns | grep testgh
50-
kubectl delete namespace testgh
65+
export E2E_CLUSTERTRANSPORT_KUBECONFIG=$KUBECONFIG
66+
task run_local

Diff for: tests/e2e/Taskfile.yaml

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: "3"
33
silent: true
44

55
vars:
6-
E2E_CLUSTERTRANSPORT_KUBECONFIG: '{{default "$HOME/.kube/config" .E2E_CLUSTERTRANSPORT_KUBECONFIG}}'
6+
E2E_CLUSTERTRANSPORT_KUBECONFIG: '{{ .E2E_CLUSTERTRANSPORT_KUBECONFIG | default "$HOME/.kube/config"}}'
77
GINKGO_VERSION: "2.13.2"
88
VERSION: "v1.0.0"
99

@@ -22,9 +22,9 @@ tasks:
2222
ginkgo:
2323
cmds:
2424
- |
25-
v=($(ginkgo version 2>/dev/null))
26-
if [ "${v[2]}" != "{{ .GINKGO_VERSION }}" ]; then
27-
go install github.com/onsi/ginkgo/v2/ginkgo@v"{{ .GINKGO_VERSION }}" ;
25+
v=($(ginkgo version 2>/dev/null || true))
26+
if [ "${v[2]}" != "{{ .GINKGO_VERSION }}" ]; then
27+
go install github.com/onsi/ginkgo/v2/ginkgo@v"{{ .GINKGO_VERSION }}" ;
2828
fi
2929
run:
3030
desc: "Run e2e tests"
@@ -47,7 +47,6 @@ tasks:
4747
run_one:
4848
desc: "Run one test or group"
4949
deps:
50-
- virtctl
5150
- ginkgo
5251
cmds:
5352
- |

Diff for: tests/e2e/tests_suite_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
virt "github.com/deckhouse/virtualization/tests/e2e/virtctl"
2424
. "github.com/onsi/ginkgo/v2"
2525
. "github.com/onsi/gomega"
26+
"sigs.k8s.io/yaml"
2627
"testing"
2728
"time"
2829
)
@@ -48,6 +49,8 @@ func init() {
4849
if conf, err = config.GetConfig(); err != nil {
4950
panic(err)
5051
}
52+
b, _ := yaml.Marshal(conf)
53+
fmt.Println(string(b))
5154
if kubectl, err = kc.NewKubectl(kc.KubectlConf(conf.ClusterTransport)); err != nil {
5255
panic(err)
5356
}

0 commit comments

Comments
 (0)