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

Add git workflow for a test that submits a k8s job #35

Merged
merged 2 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
25 changes: 25 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
branches:
- main

env:
KWOK_REPO: kubernetes-sigs/kwok
KWOK_LATEST_RELEASE: v0.5.2

jobs:
check:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -66,3 +70,24 @@ jobs:

- name: Build
run: make build

test-k8s:
needs: [check, test, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Build
run: make build

- name: Create k8s Kind Cluster
uses: helm/kind-action@v1

- name: Run test scripts
run: |
./tests/ci/test_k8s.sh
16 changes: 16 additions & 0 deletions tests/ci/test_k8s.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /bin/bash -x

REPO_HOME=$(readlink -f $(dirname $(readlink -f "$0"))/../../)

# Install KWOK node simulator
KWOK_REPO=kubernetes-sigs/kwok
KWOK_LATEST_RELEASE=v0.5.2

kubectl apply -f "https://github.com/${KWOK_REPO}/releases/download/${KWOK_LATEST_RELEASE}/kwok.yaml"
kubectl apply -f "https://github.com/${KWOK_REPO}/releases/download/${KWOK_LATEST_RELEASE}/stage-fast.yaml"
kubectl apply -f https://github.com/${KWOK_REPO}/raw/main/kustomize/stage/pod/chaos/pod-init-container-running-failed.yaml
kubectl apply -f https://github.com/${KWOK_REPO}/raw/main/kustomize/stage/pod/chaos/pod-container-running-failed.yaml
kubectl apply -f ${REPO_HOME}/charts/overrides/kwok/pod-complete.yml

# Run knavigator with an example test
${REPO_HOME}/bin/knavigator -tasks ${REPO_HOME}/resources/tests/k8s/test-job.yml
Loading