Skip to content

Commit

Permalink
refactor e2e testing - part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Nov 24, 2022
1 parent 1c334c8 commit 65bf47b
Show file tree
Hide file tree
Showing 26 changed files with 3,135 additions and 291 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/cyclonus-netpol-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Cyclonus Network Policy E2E

on:
workflow_dispatch:
schedule:
- cron: "40 16 * * *"

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

env:
GO_VERSION: '1.19'
KIND_VERSION: v0.17.0
HELM_VERSION: v3.10.1

jobs:
e2e:
name: E2E
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
branch:
- master
ip-family:
- ipv4
- ipv6
- dual
mode:
- overlay
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v3
with:
go-version: '${{ env.GO_VERSION }}'
check-latest: true
id: go

- name: Go Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-${{ matrix.branch }}-${{ env.GOVERSION }}-x86-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ env.GOVERSION }}-x86-
- name: Create branch directory
run: mkdir -p test/k8s-network/branches/${{ matrix.branch }}

- name: Check out branch
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
fetch-depth: 1
path: test/k8s-network/branches/${{ matrix.branch }}

- name: Install Kind
run: |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
chmod +x ./kind
sudo mv kind /usr/local/bin
- name: Create cluster
working-directory: test/k8s-network/branches/${{ matrix.branch }}
run: |
sudo pip3 install j2cli
sudo pip3 install "j2cli[yaml]"
sudo PATH=~/.local/bin:$PATH make kind-init-${{ matrix.ip-family }}
- name: Install Kube-OVN
working-directory: test/k8s-network/branches/${{ matrix.branch }}
run: |
docker pull kubeovn/kube-ovn:$(cat VERSION)
sudo make kind-install-${{ matrix.mode }}-${{ matrix.ip-family }}
- name: Run E2E
env:
E2E_BRANCH: ${{ matrix.branch }}
E2E_IP_FAMILY: ${{ matrix.ip-family }}
E2E_NETWORK_MODE: ${{ matrix.mode }}
run: |
sudo cp -r /root/.kube/ ~/.kube/
sudo chmod -R 777 ~/.kube/
KUBECONFIG=~/.kube/config make cyclonus-netpol-e2e
90 changes: 90 additions & 0 deletions .github/workflows/k8s-conformance-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Kubernetes Conformance E2E

on:
workflow_dispatch:
schedule:
- cron: "40 16 * * *"

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

env:
GO_VERSION: '1.19'
KIND_VERSION: v0.17.0
HELM_VERSION: v3.10.1

jobs:
e2e:
name: E2E
runs-on: ubuntu-22.04
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
branch:
- master
ip-family:
- ipv4
- ipv6
- dual
mode:
- overlay
- underlay
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v3
with:
go-version: '${{ env.GO_VERSION }}'
check-latest: true
id: go

- name: Go Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-${{ matrix.branch }}-${{ env.GOVERSION }}-x86-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ env.GOVERSION }}-x86-
- name: Create branch directory
run: mkdir -p test/k8s-network/branches/${{ matrix.branch }}

- name: Check out branch
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
fetch-depth: 1
path: test/k8s-network/branches/${{ matrix.branch }}

- name: Install Kind
run: |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
chmod +x ./kind
sudo mv kind /usr/local/bin
- name: Create cluster
working-directory: test/k8s-network/branches/${{ matrix.branch }}
run: |
sudo pip3 install j2cli
sudo pip3 install "j2cli[yaml]"
sudo PATH=~/.local/bin:$PATH make kind-init-${{ matrix.ip-family }}
- name: Install Kube-OVN
working-directory: test/k8s-network/branches/${{ matrix.branch }}
run: |
docker pull kubeovn/kube-ovn:$(cat VERSION)
sudo make kind-install-${{ matrix.mode }}-${{ matrix.ip-family }}
- name: Run E2E
env:
E2E_BRANCH: ${{ matrix.branch }}
E2E_IP_FAMILY: ${{ matrix.ip-family }}
E2E_NETWORK_MODE: ${{ matrix.mode }}
run: |
sudo cp -r /root/.kube/ ~/.kube/
sudo chmod -R 777 ~/.kube/
KUBECONFIG=~/.kube/config make k8s-conformance-e2e
89 changes: 89 additions & 0 deletions .github/workflows/k8s-netpol-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Kubernetes Network Policy E2E

on:
workflow_dispatch:
schedule:
- cron: "40 16 * * *"

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

env:
GO_VERSION: '1.19'
KIND_VERSION: v0.17.0
HELM_VERSION: v3.10.1

jobs:
e2e:
name: E2E
runs-on: ubuntu-22.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
branch:
- master
ip-family:
- ipv4
- ipv6
- dual
mode:
- overlay
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v3
with:
go-version: '${{ env.GO_VERSION }}'
check-latest: true
id: go

- name: Go Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-${{ matrix.branch }}-${{ env.GOVERSION }}-x86-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ env.GOVERSION }}-x86-
- name: Create branch directory
run: mkdir -p test/k8s-network/branches/${{ matrix.branch }}

- name: Check out branch
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
fetch-depth: 1
path: test/k8s-network/branches/${{ matrix.branch }}

- name: Install Kind
run: |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
chmod +x ./kind
sudo mv kind /usr/local/bin
- name: Create cluster
working-directory: test/k8s-network/branches/${{ matrix.branch }}
run: |
sudo pip3 install j2cli
sudo pip3 install "j2cli[yaml]"
sudo PATH=~/.local/bin:$PATH make kind-init-${{ matrix.ip-family }}
- name: Install Kube-OVN
working-directory: test/k8s-network/branches/${{ matrix.branch }}
run: |
docker pull kubeovn/kube-ovn:$(cat VERSION)
sudo make kind-install-${{ matrix.mode }}-${{ matrix.ip-family }}
- name: Run E2E
env:
E2E_BRANCH: ${{ matrix.branch }}
E2E_IP_FAMILY: ${{ matrix.ip-family }}
E2E_NETWORK_MODE: ${{ matrix.mode }}
run: |
sudo cp -r /root/.kube/ ~/.kube/
sudo chmod -R 777 ~/.kube/
KUBECONFIG=~/.kube/config make k8s-netpol-e2e
90 changes: 90 additions & 0 deletions .github/workflows/kube-ovn-conformance-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Kube-OVN Conformance E2E

on:
workflow_dispatch:
schedule:
- cron: "40 16 * * *"

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

env:
GO_VERSION: '1.19'
KIND_VERSION: v0.17.0
HELM_VERSION: v3.10.1

jobs:
e2e:
name: E2E
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
branch:
- master
ip-family:
- ipv4
- ipv6
- dual
mode:
- overlay
- underlay
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v3
with:
go-version: '${{ env.GO_VERSION }}'
check-latest: true
id: go

- name: Go Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-${{ matrix.branch }}-${{ env.GOVERSION }}-x86-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ env.GOVERSION }}-x86-
- name: Create branch directory
run: mkdir -p test/kube-ovn/branches/${{ matrix.branch }}

- name: Check out branch
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
fetch-depth: 1
path: test/kube-ovn/branches/${{ matrix.branch }}

- name: Install Kind
run: |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
chmod +x ./kind
sudo mv kind /usr/local/bin
- name: Create cluster
working-directory: test/kube-ovn/branches/${{ matrix.branch }}
run: |
sudo pip3 install j2cli
sudo pip3 install "j2cli[yaml]"
sudo PATH=~/.local/bin:$PATH make kind-init-${{ matrix.ip-family }}
- name: Install Kube-OVN
working-directory: test/kube-ovn/branches/${{ matrix.branch }}
run: |
docker pull kubeovn/kube-ovn:$(cat VERSION)
sudo make kind-install-${{ matrix.mode }}-${{ matrix.ip-family }}
- name: Run E2E
env:
E2E_BRANCH: ${{ matrix.branch }}
E2E_IP_FAMILY: ${{ matrix.ip-family }}
E2E_NETWORK_MODE: ${{ matrix.mode }}
run: |
sudo cp -r /root/.kube/ ~/.kube/
sudo chmod -R 777 ~/.kube/
KUBECONFIG=~/.kube/config make kube-ovn-conformance-e2e
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
GO_VERSION = 1.19
SHELL=/bin/bash
SHELL = /bin/bash

include Makefile.e2e

REGISTRY = kubeovn
DEV_TAG = dev
Expand Down
Loading

0 comments on commit 65bf47b

Please sign in to comment.