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

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 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
85 changes: 85 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# 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 }}
GO_VERSION: "1.22.7"

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
branches:
- main
- 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 ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: "${{ env.GO_VERSION }}"

- 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: Test cluster connection
run: |
kubectl get no

- name: e2e
run: |
echo "Install"
curl -fsSL -o d8-install.sh https://raw.githubusercontent.com/deckhouse/deckhouse-cli/main/d8-install.sh
bash d8-install.sh
echo "----"

export E2E_CLUSTERTRANSPORT_KUBECONFIG=$KUBECONFIG
cd ./tests/e2e/

echo "Show tasks"
task || true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
task || true
task -l

echo "--"

echo "Run task local"
task run_local -vvvvv
14 changes: 13 additions & 1 deletion tests/e2e/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ tasks:
cp -a testdata/vm-migration /tmp/testdata/vm-migration
cp -a testdata/vm-disk-attachment /tmp/testdata/vm-disk-attachment
cp -a testdata/sshkeys /tmp/testdata/sshkeys

ginkgo:
cmds:
- |
echo "Run ginkgo install"
v=($(ginkgo version 2>/dev/null))
if [ "${v[2]}" != "{{ .GINKGO_VERSION }}" ]; then
go install github.com/onsi/ginkgo/v2/ginkgo@v"{{ .GINKGO_VERSION }}" ;
fi
ginkgo version

run:
desc: "Run e2e tests"
deps:
Expand All @@ -40,9 +44,17 @@ tasks:
desc: "Run locally e2e tests"
deps:
- copy
- ginkgo
# - ginkgo
cmds:
- |
echo "Install d8"
curl -fsSL -o d8-install.sh https://raw.githubusercontent.com/deckhouse/deckhouse-cli/main/d8-install.sh
bash d8-install.sh

echo "Install ginkgo"
go install github.com/onsi/ginkgo/v2/ginkgo@v"{{ .GINKGO_VERSION }}"

echo "Run run_local"
export E2E_CLUSTERTRANSPORT_KUBECONFIG={{.E2E_CLUSTERTRANSPORT_KUBECONFIG}}
ginkgo \
--skip-file vm_test.go \
Expand Down
Loading