Skip to content

Commit 7c255d0

Browse files
authored
test: add backwards compatibility test setup [WIP] (#1065)
1 parent 22fa6b3 commit 7c255d0

File tree

15 files changed

+4255
-0
lines changed

15 files changed

+4255
-0
lines changed

.github/workflows/upgrade.yml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release-*
8+
workflow_dispatch: {}
9+
pull_request:
10+
branches:
11+
- main
12+
- release-*
13+
paths-ignore: [docs/**, "**.md", "**.mdx", "**.png", "**.jpg"]
14+
15+
env:
16+
GO_VERSION: '1.22.12'
17+
18+
jobs:
19+
detect-noop:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
noop: ${{ steps.noop.outputs.should_skip }}
23+
steps:
24+
- name: Detect No-op Changes
25+
id: noop
26+
uses: fkirc/skip-duplicate-actions@v5.3.1
27+
with:
28+
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
30+
concurrent_skipping: false
31+
32+
hub-agent-backward-compatibility:
33+
runs-on: ubuntu-latest
34+
needs: detect-noop
35+
if: needs.detect-noop.outputs.noop != 'true'
36+
steps:
37+
- name: Set up Go
38+
uses: actions/setup-go@v5
39+
with:
40+
go-version: ${{ env.GO_VERSION }}
41+
42+
- name: Check out code into the Go module directory
43+
uses: actions/checkout@v4
44+
45+
- name: Set up Ginkgo CLI
46+
run: |
47+
go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.1
48+
49+
- name: Prepare the fleet
50+
run: cd test/upgrade && chmod +x setup.sh && ./setup.sh 3 && cd -
51+
env:
52+
KUBECONFIG: '/home/runner/.kube/config'
53+
HUB_SERVER_URL: 'https://172.19.0.2:6443'
54+
55+
- name: Run the Before suite
56+
run: cd test/upgrade/before && ginkgo -v -p . && cd -
57+
env:
58+
KUBECONFIG: '/home/runner/.kube/config'
59+
60+
- name: Upgrade the Fleet hub agent
61+
run: cd test/upgrade && chmod +x upgrade.sh && UPGRADE_HUB_SIDE=true ./upgrade.sh 3 && cd -
62+
env:
63+
KUBECONFIG: '/home/runner/.kube/config'
64+
65+
- name: Run the After suite
66+
run: cd test/upgrade/after && ginkgo -v -p . && cd -
67+
env:
68+
KUBECONFIG: '/home/runner/.kube/config'
69+
70+
member-agent-backward-compatibility:
71+
runs-on: ubuntu-latest
72+
needs: detect-noop
73+
if: needs.detect-noop.outputs.noop != 'true'
74+
steps:
75+
- name: Set up Go
76+
uses: actions/setup-go@v5
77+
with:
78+
go-version: ${{ env.GO_VERSION }}
79+
80+
- name: Check out code into the Go module directory
81+
uses: actions/checkout@v4
82+
83+
- name: Set up Ginkgo CLI
84+
run: |
85+
go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.1
86+
87+
- name: Prepare the fleet
88+
run: cd test/upgrade && chmod +x setup.sh && ./setup.sh 3 && cd -
89+
env:
90+
KUBECONFIG: '/home/runner/.kube/config'
91+
HUB_SERVER_URL: 'https://172.19.0.2:6443'
92+
93+
- name: Run the Before suite
94+
run: cd test/upgrade/before && ginkgo -v -p . && cd -
95+
env:
96+
KUBECONFIG: '/home/runner/.kube/config'
97+
98+
- name: Upgrade the Fleet member agent
99+
run: cd test/upgrade && chmod +x upgrade.sh && UPGRADE_MEMBER_SIDE=true ./upgrade.sh 3 && cd -
100+
env:
101+
KUBECONFIG: '/home/runner/.kube/config'
102+
103+
- name: Run the After suite
104+
run: cd test/upgrade/after && ginkgo -v -p . && cd -
105+
env:
106+
KUBECONFIG: '/home/runner/.kube/config'
107+
108+
full-backward-compatibility:
109+
runs-on: ubuntu-latest
110+
needs: detect-noop
111+
if: needs.detect-noop.outputs.noop != 'true'
112+
steps:
113+
- name: Set up Go
114+
uses: actions/setup-go@v5
115+
with:
116+
go-version: ${{ env.GO_VERSION }}
117+
118+
- name: Check out code into the Go module directory
119+
uses: actions/checkout@v4
120+
121+
- name: Set up Ginkgo CLI
122+
run: |
123+
go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.1
124+
125+
- name: Prepare the fleet
126+
run: cd test/upgrade && chmod +x setup.sh && ./setup.sh 3 && cd -
127+
env:
128+
KUBECONFIG: '/home/runner/.kube/config'
129+
HUB_SERVER_URL: 'https://172.19.0.2:6443'
130+
131+
- name: Run the Before suite
132+
run: cd test/upgrade/before && ginkgo -v -p . && cd -
133+
env:
134+
KUBECONFIG: '/home/runner/.kube/config'
135+
136+
- name: Upgrade all Fleet agents
137+
run: cd test/upgrade && chmod +x upgrade.sh && UPGRADE_HUB_SIDE=true UPGRADE_MEMBER_SIDE=true ./upgrade.sh 3 && cd -
138+
env:
139+
KUBECONFIG: '/home/runner/.kube/config'
140+
141+
- name: Run the After suite
142+
run: cd test/upgrade/after && ginkgo -v -p . && cd -
143+
env:
144+
KUBECONFIG: '/home/runner/.kube/config'
145+

test/scripts/snippets.sh

Whitespace-only changes.

0 commit comments

Comments
 (0)