Skip to content

Commit 06e36b4

Browse files
committed
test: add different workflows
1 parent 5f1913c commit 06e36b4

File tree

3 files changed

+127
-77
lines changed

3 files changed

+127
-77
lines changed

.github/workflows/e2e.yaml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: e2e
2+
on:
3+
workflow_call:
4+
inputs:
5+
k8s_version:
6+
type: string
7+
default: "1.34"
8+
suite:
9+
type: string
10+
required: true
11+
jobs:
12+
e2e:
13+
permissions:
14+
issues: write
15+
runs-on: ubuntu-latest
16+
name: suite-${{ inputs.suite }}
17+
steps:
18+
- name: Debug workflow_run trigger
19+
run: |
20+
echo "Event name: ${{ github.event_name }}"
21+
echo "Workflow run conclusion: ${{ github.event.workflow_run.conclusion }}"
22+
echo "Workflow run name: ${{ github.event.workflow_run.name }}"
23+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
24+
- name: Set up Python 3.10
25+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
26+
with:
27+
python-version: "3.10"
28+
- uses: ./.github/actions/install-deps
29+
with:
30+
k8sVersion: ${{ inputs.k8s_version }}
31+
- name: Kind Cluster
32+
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
33+
- name: check kind cluster and taint nodes
34+
shell: bash
35+
run: |
36+
kubectl config current-context
37+
kubectl get nodes
38+
kubectl taint nodes chart-testing-control-plane CriticalAddonsOnly:NoSchedule
39+
- name: install prometheus
40+
uses: ./.github/actions/install-prometheus
41+
- name: install pyroscope
42+
uses: ./.github/actions/install-pyroscope
43+
- name: install kwok and controller
44+
shell: bash
45+
run: |
46+
make install-kwok
47+
export KWOK_REPO=kind.local
48+
export KIND_CLUSTER_NAME=chart-testing
49+
make apply-with-kind
50+
- name: ping cluster
51+
shell: bash
52+
run: |
53+
sleep 15
54+
kubectl get pods -n kube-system | grep karpenter
55+
kubectl get nodepools
56+
kubectl get pods -A
57+
kubectl describe nodes
58+
# TEMPORARILY DISABLED: Karpenter KPI Analysis Package
59+
# This package analyzes key performance indicators (KPIs) for integration tests.
60+
# Currently non-functional due to changes in core Karpenter metrics.
61+
# Disabled due to test flakiness until underlying metric changes are addressed.
62+
# Reference: https://github.com/nathangeology/karpenter_evaluate/blob/main/main.py
63+
# - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
64+
# with:
65+
# repository: nathangeology/karpenter_evaluate
66+
# path: ./karpenter_eval/ # Installs to a folder in the Karpenter repo for the test
67+
# ref: "1130af927302e6913a4947952112f793eeafc564"
68+
# fetch-depth: 0
69+
# - name: install KPI report dependencies
70+
# shell: bash
71+
# run: |
72+
# pip install pandas==2.2.2
73+
# pip install pyarrow==16.1.0
74+
# pip install tabulate==0.9.0
75+
# pip install prometheus-api-client==0.5.5
76+
# pip install ./karpenter_eval/
77+
- name: run the ${{ inputs.suite }} test suite
78+
env:
79+
SUITE: ${{ inputs.suite }}
80+
shell: bash
81+
run: |
82+
OUTPUT_DIR=$(mktemp -d)
83+
export OUTPUT_DIR
84+
echo OUTPUT_DIR="$OUTPUT_DIR" >> "$GITHUB_ENV"
85+
TEST_SUITE="$SUITE" make e2etests
86+
# - name: run test analysis
87+
# shell: bash
88+
# run: |
89+
# OUTPUT_DIR=${{ env.OUTPUT_DIR }} python ./karpenter_eval/main.py
90+
- name: cleanup
91+
shell: bash
92+
run: |
93+
kubectl delete nodepools --all
94+
make delete
95+
make uninstall-kwok
96+

.github/workflows/kind-e2e.yaml

Lines changed: 7 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -10,84 +10,14 @@ on:
1010
workflow_dispatch:
1111
jobs:
1212
kind-e2e:
13-
# if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
14-
# permissions:
15-
# issues: write
16-
runs-on: ubuntu-latest
13+
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
14+
permissions:
15+
issues: write
1716
strategy:
1817
fail-fast: false
1918
matrix:
2019
k8sVersion: ["1.28.x", "1.29.x", "1.30.x", "1.31.x", "1.32.x", "1.33.x", "1.34.x"]
21-
steps:
22-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23-
- name: Set up Python 3.10
24-
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
25-
with:
26-
python-version: "3.10"
27-
- uses: ./.github/actions/install-deps
28-
with:
29-
k8sVersion: ${{ matrix.k8sVersion }}
30-
- name: Kind Cluster
31-
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
32-
- name: check kind cluster and taint nodes
33-
shell: bash
34-
run: |
35-
kubectl config current-context
36-
kubectl get nodes
37-
kubectl taint nodes chart-testing-control-plane CriticalAddonsOnly:NoSchedule
38-
- name: install prometheus
39-
uses: ./.github/actions/install-prometheus
40-
- name: install pyroscope
41-
uses: ./.github/actions/install-pyroscope
42-
- name: install kwok and controller
43-
shell: bash
44-
run: |
45-
make install-kwok
46-
export KWOK_REPO=kind.local
47-
export KIND_CLUSTER_NAME=chart-testing
48-
make apply-with-kind
49-
- name: ping cluster
50-
shell: bash
51-
run: |
52-
sleep 15
53-
kubectl get pods -n kube-system | grep karpenter
54-
kubectl get nodepools
55-
kubectl get pods -A
56-
kubectl describe nodes
57-
# TEMPORARILY DISABLED: Karpenter KPI Analysis Package
58-
# This package analyzes key performance indicators (KPIs) for integration tests.
59-
# Currently non-functional due to changes in core Karpenter metrics.
60-
# Disabled due to test flakiness until underlying metric changes are addressed.
61-
# Reference: https://github.com/nathangeology/karpenter_evaluate/blob/main/main.py
62-
# - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
63-
# with:
64-
# repository: nathangeology/karpenter_evaluate
65-
# path: ./karpenter_eval/ # Installs to a folder in the Karpenter repo for the test
66-
# ref: "1130af927302e6913a4947952112f793eeafc564"
67-
# fetch-depth: 0
68-
# - name: install KPI report dependencies
69-
# shell: bash
70-
# run: |
71-
# pip install pandas==2.2.2
72-
# pip install pyarrow==16.1.0
73-
# pip install tabulate==0.9.0
74-
# pip install prometheus-api-client==0.5.5
75-
# pip install ./karpenter_eval/
76-
- name: run test suites
77-
shell: bash
78-
run: |
79-
OUTPUT_DIR=$(mktemp -d)
80-
export OUTPUT_DIR
81-
echo OUTPUT_DIR="$OUTPUT_DIR" >> "$GITHUB_ENV"
82-
make e2etests
83-
# - name: run test analysis
84-
# shell: bash
85-
# run: |
86-
# OUTPUT_DIR=${{ env.OUTPUT_DIR }} python ./karpenter_eval/main.py
87-
- name: cleanup
88-
shell: bash
89-
run: |
90-
kubectl delete nodepools --all
91-
make delete
92-
make uninstall-kwok
93-
20+
uses: ./.github/workflows/e2e.yaml
21+
with:
22+
k8s_version: ${{ matrix.k8sVersion }}
23+
suite: "Regression"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: kind-perf-e2e
2+
on:
3+
push:
4+
branches: [main]
5+
workflow_run:
6+
workflows:
7+
- ApprovalComment
8+
types:
9+
- completed
10+
workflow_dispatch:
11+
jobs:
12+
kind-perf-e2e:
13+
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
14+
permissions:
15+
issues: write
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
suite:
20+
- name: Performance
21+
- name: Regression
22+
uses: ./.github/workflows/e2e.yaml
23+
with:
24+
suite: ${{ matrix.suite.name }}

0 commit comments

Comments
 (0)