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

refactor e2e testing #2078

Merged
merged 14 commits into from
Dec 29, 2022
Merged
Show file tree
Hide file tree
Changes from 8 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
1,536 changes: 402 additions & 1,134 deletions .github/workflows/build-x86-image.yaml

Large diffs are not rendered by default.

201 changes: 167 additions & 34 deletions .github/workflows/scheduled-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,54 +48,52 @@ jobs:
- name: Export Go full version
run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV"

- name: Go Cache
- name: Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-

- name: Create branch directory
run: mkdir -p test/k8s-network/branches/${{ matrix.branch }}
run: mkdir -p test/e2e/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 }}
path: test/e2e/k8s-network/branches/${{ matrix.branch }}

- name: Install Kind
- 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 }}
- name: Create kind cluster
working-directory: test/e2e/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 }}
sudo cp -r /root/.kube/ ~/.kube/
sudo chown -R $(id -un). ~/.kube/

- name: Install Kube-OVN
working-directory: test/k8s-network/branches/${{ matrix.branch }}
working-directory: test/e2e/k8s-network/branches/${{ matrix.branch }}
run: |
docker pull kubeovn/kube-ovn:$(cat VERSION)
sudo make kind-install-${{ matrix.mode }}-${{ matrix.ip-family }}
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
run: make k8s-conformance-e2e

k8s-netpol-e2e:
name: Kubernetes Network Policy E2E
Expand Down Expand Up @@ -127,50 +125,46 @@ jobs:
- name: Export Go full version
run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV"

- name: Go Cache
- name: Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-

- name: Create branch directory
run: mkdir -p test/k8s-network/branches/${{ matrix.branch }}
run: mkdir -p test/e2e/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 }}
path: test/e2e/k8s-network/branches/${{ matrix.branch }}

- name: Install Kind
- 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 }}
- name: Create kind cluster
working-directory: test/e2e/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 }}
working-directory: test/e2e/k8s-network/branches/${{ matrix.branch }}
run: |
docker pull kubeovn/kube-ovn:$(cat VERSION)
sudo make kind-install-${{ matrix.ip-family }}

- name: Run E2E
run: |
sudo cp -r /root/.kube/ ~/.kube/
sudo chmod -R 777 ~/.kube/
KUBECONFIG=~/.kube/config make k8s-netpol-e2e
run: make k8s-netpol-e2e

cyclonus-netpol-e2e:
name: Cyclonus Network Policy E2E
Expand All @@ -194,36 +188,175 @@ jobs:
sudo systemctl restart docker

- name: Create branch directory
run: mkdir -p test/k8s-network/branches/${{ matrix.branch }}
run: mkdir -p test/e2e/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 }}
path: test/e2e/k8s-network/branches/${{ matrix.branch }}

- name: Install Kind
- 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 }}
- name: Create kind cluster
working-directory: test/e2e/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 }}
working-directory: test/e2e/k8s-network/branches/${{ matrix.branch }}
run: |
docker pull kubeovn/kube-ovn:$(cat VERSION)
sudo make kind-install-${{ matrix.ip-family }}

- name: Run E2E
run: |
sudo cp -r /root/.kube/ ~/.kube/
sudo chmod -R 777 ~/.kube/
sudo chown -R $(id -un). ~/.kube/
make cyclonus-netpol-e2e

kube-ovn-conformance-e2e:
name: Kube-OVN Conformance 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: Export Go full version
run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV"

- name: Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-

- name: Create branch directory
run: mkdir -p test/e2e/kube-ovn/branches/${{ matrix.branch }}

- name: Check out branch
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
fetch-depth: 1
path: test/e2e/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 kind cluster
working-directory: test/e2e/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 }}
sudo cp -r /root/.kube/ ~/.kube/
sudo chown -R $(id -un). ~/.kube/

- name: Install Kube-OVN
working-directory: test/e2e/kube-ovn/branches/${{ matrix.branch }}
run: |
docker pull kubeovn/kube-ovn:$(cat VERSION)
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: make kube-ovn-conformance-e2e

kube-ovn-ic-conformance-e2e:
name: Kube-OVN IC Conformance E2E
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
branch:
- master
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '${{ env.GO_VERSION }}'
check-latest: true
id: go

- name: Export Go full version
run: echo "GO_FULL_VER=$(go version | awk '{print $3}')" >> "$GITHUB_ENV"

- name: Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-

- name: Create branch directory
run: mkdir -p test/e2e/kube-ovn/branches/${{ matrix.branch }}

- name: Check out branch
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
fetch-depth: 1
path: test/e2e/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 kind cluster
working-directory: test/e2e/kube-ovn/branches/${{ matrix.branch }}
run: |
sudo pip3 install j2cli
sudo pip3 install "j2cli[yaml]"
sudo PATH=~/.local/bin:$PATH make kind-init-ovn-ic
sudo cp -r /root/.kube/ ~/.kube/
sudo chown -R $(id -un). ~/.kube/

- name: Install Kube-OVN
working-directory: test/e2e/kube-ovn/branches/${{ matrix.branch }}
run: |
docker pull kubeovn/kube-ovn:$(cat VERSION)
make kind-install-ovn-ic

- name: Run E2E
env:
E2E_BRANCH: ${{ matrix.branch }}
run: make kube-ovn-ic-conformance-e2e
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ vpc-nat-gateway.tar
image-amd64.tar
image-arm64.tar
test/**/*.test
test/**/network.json
Loading