11
11
12
12
env :
13
13
GO_VERSION : 1.23.x
14
+ SHORT_TIMEOUT : 5
15
+ LONG_TIMEOUT : 60
14
16
15
17
jobs :
16
18
test-unit :
19
+ # Supposed to work: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#example-returning-a-json-data-type
20
+ # Apparently does not
21
+ # timeout-minutes: ${{ fromJSON(env.SHORT_TIMEOUT) }}
17
22
timeout-minutes : 5
18
23
name : unit | ${{ matrix.goos }}
19
24
runs-on : " ${{ matrix.os }}"
@@ -48,11 +53,12 @@ jobs:
48
53
working-directory : containerd
49
54
run : GOPATH=$(go env GOPATH) script/setup/install-cni-windows
50
55
- name : " Run unit tests"
51
- run : go test -v ./pkg/...
56
+ run : make test-unit
52
57
53
58
test-integration :
59
+ timeout-minutes : 60
60
+ name : rootful | ${{ matrix.containerd }} | ${{ matrix.runner }}
54
61
runs-on : " ${{ matrix.runner }}"
55
- timeout-minutes : 40
56
62
strategy :
57
63
fail-fast : false
58
64
matrix :
@@ -95,23 +101,21 @@ jobs:
95
101
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
96
102
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
97
103
- name : " Run integration tests"
98
- uses : nick-fields/retry@v3
99
- with :
100
- timeout_minutes : 30
101
- max_attempts : 2
102
- retry_on : error
103
- command : docker run -t --rm --privileged test-integration
104
+ run : docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=false
105
+ - name : " Run integration tests (flaky)"
106
+ run : docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=true
104
107
105
108
test-integration-ipv6 :
109
+ timeout-minutes : 60
110
+ name : ipv6 | ${{ matrix.containerd }} | ${{ matrix.ubuntu }}
106
111
runs-on : " ubuntu-${{ matrix.ubuntu }}"
107
- timeout-minutes : 40
108
112
strategy :
109
113
fail-fast : false
110
114
matrix :
111
115
# ubuntu-20.04: cgroup v1, ubuntu-22.04 and later: cgroup v2
112
116
include :
113
117
- ubuntu : 24.04
114
- containerd : v1.7.23
118
+ containerd : v2.0.0-rc.5
115
119
env :
116
120
UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
117
121
CONTAINERD_VERSION : " ${{ matrix.containerd }}"
@@ -129,7 +133,7 @@ jobs:
129
133
echo '{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "experimental": true, "ip6tables": true}' | sudo tee /etc/docker/daemon.json
130
134
sudo systemctl restart docker
131
135
- name : " Prepare integration test environment"
132
- run : docker build -t test-integration-ipv6 --target test-integration-ipv6 --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
136
+ run : docker build -t test-integration --target test-integration --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
133
137
- name : " Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
134
138
run : |
135
139
sudo systemctl disable --now snapd.service snapd.socket
@@ -147,20 +151,16 @@ jobs:
147
151
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
148
152
- name : " Run integration tests"
149
153
# The nested IPv6 network inside docker and qemu is complex and needs a bunch of sysctl config.
150
- # Therefore it's hard to debug why the IPv6 tests fail in such an isolation layer.
154
+ # Therefore, it's hard to debug why the IPv6 tests fail in such an isolation layer.
151
155
# On the other side, using the host network is easier at configuration.
152
156
# Besides, each job is running on a different instance, which means using host network here
153
157
# is safe and has no side effects on others.
154
- uses : nick-fields/retry@v3
155
- with :
156
- timeout_minutes : 30
157
- max_attempts : 2
158
- retry_on : error
159
- command : docker run --network host -t --rm --privileged test-integration-ipv6
158
+ run : docker run --network host -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-ipv6
160
159
161
160
test-integration-rootless :
162
- runs-on : " ubuntu-${{ matrix.ubuntu }}"
163
161
timeout-minutes : 60
162
+ name : " ${{ matrix.target }} | ${{ matrix.containerd }} | ${{ matrix.rootlesskit }} | ${{ matrix.ubuntu }}"
163
+ runs-on : " ubuntu-${{ matrix.ubuntu }}"
164
164
strategy :
165
165
fail-fast : false
166
166
matrix :
@@ -169,24 +169,24 @@ jobs:
169
169
- ubuntu : 20.04
170
170
containerd : v1.6.36
171
171
rootlesskit : v1.1.1 # Deprecated
172
- target : test-integration- rootless
172
+ target : rootless
173
173
- ubuntu : 22.04
174
174
containerd : v1.7.23
175
175
rootlesskit : v2.3.1
176
- target : test-integration- rootless
176
+ target : rootless
177
177
- ubuntu : 24.04
178
178
containerd : v2.0.0-rc.5
179
179
rootlesskit : v2.3.1
180
- target : test-integration- rootless
180
+ target : rootless
181
181
- ubuntu : 24.04
182
182
containerd : v1.7.23
183
183
rootlesskit : v2.3.1
184
- target : test-integration- rootless-port-slirp4netns
184
+ target : rootless-port-slirp4netns
185
185
env :
186
186
UBUNTU_VERSION : " ${{ matrix.ubuntu }}"
187
187
CONTAINERD_VERSION : " ${{ matrix.containerd }}"
188
188
ROOTLESSKIT_VERSION : " ${{ matrix.rootlesskit }}"
189
- TEST_TARGET : " ${{ matrix.target }}"
189
+ TEST_TARGET : " test-integration- ${{ matrix.target }}"
190
190
steps :
191
191
- name : " Set up AppArmor"
192
192
if : matrix.ubuntu == '24.04'
@@ -226,16 +226,14 @@ jobs:
226
226
fi
227
227
echo "WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622}" >> "$GITHUB_ENV"
228
228
- name : " Test (network driver=slirp4netns, port driver=builtin)"
229
- uses : nick-fields/retry@v3
230
- with :
231
- timeout_minutes : 30
232
- max_attempts : 2
233
- retry_on : error
234
- command : docker run -t --rm --privileged -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622} ${TEST_TARGET}
229
+ run : docker run -t --rm --privileged -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622} ${TEST_TARGET} /test-integration-rootless.sh ./hack/test-integration.sh -test.only-flaky=false
230
+ - name : " Test (network driver=slirp4netns, port driver=builtin) (flaky)"
231
+ run : docker run -t --rm --privileged -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622} ${TEST_TARGET} /test-integration-rootless.sh ./hack/test-integration.sh -test.only-flaky=true
235
232
236
- cross :
233
+ build :
234
+ timeout-minutes : 5
235
+ name : " build | ${{ matrix.go-version }}"
237
236
runs-on : ubuntu-24.04
238
- timeout-minutes : 40
239
237
strategy :
240
238
matrix :
241
239
go-version : ["1.22.x", "1.23.x"]
@@ -248,12 +246,13 @@ jobs:
248
246
go-version : ${{ matrix.go-version }}
249
247
cache : true
250
248
check-latest : true
251
- - name : " Cross "
249
+ - name : " build "
252
250
run : GO_VERSION="$(echo ${{ matrix.go-version }} | sed -e s/.x//)" make binaries
253
251
254
252
test-integration-docker-compatibility :
253
+ timeout-minutes : 60
254
+ name : docker
255
255
runs-on : ubuntu-24.04
256
- timeout-minutes : 45
257
256
steps :
258
257
259
258
with :
@@ -280,26 +279,18 @@ jobs:
280
279
- name : " Prepare integration test environment"
281
280
run : |
282
281
sudo apt-get install -y expect
282
+ go install -v gotest.tools/gotestsum@v1
283
283
- name : " Ensure that the integration test suite is compatible with Docker"
284
- uses : nick-fields/retry@v3
285
- with :
286
- timeout_minutes : 30
287
- max_attempts : 2
288
- retry_on : error
289
- # See https://github.com/containerd/nerdctl/blob/main/docs/testing/README.md#about-parallelization
290
- command : go test -p 1 -timeout 20m -v -exec sudo ./cmd/nerdctl/... -args -test.target=docker -test.allow-kill-daemon
284
+ run : WITH_SUDO=true ./hack/test-integration.sh -test.target=docker
291
285
- name : " Ensure that the IPv6 integration test suite is compatible with Docker"
292
- uses : nick-fields/retry@v3
293
- with :
294
- timeout_minutes : 30
295
- max_attempts : 2
296
- retry_on : error
297
- # See https://github.com/containerd/nerdctl/blob/main/docs/testing/README.md#about-parallelization
298
- command : go test -p 1 -timeout 20m -v -exec sudo ./cmd/nerdctl/... -args -test.target=docker -test.allow-kill-daemon -test.only-ipv6
286
+ run : WITH_SUDO=true ./hack/test-integration.sh -test.target=docker -test.only-ipv6
287
+ - name : " Ensure that the integration test suite is compatible with Docker (flaky only)"
288
+ run : WITH_SUDO=true ./hack/test-integration.sh -test.target=docker -test.only-flaky
299
289
300
290
test-integration-windows :
301
- runs-on : windows-2022
302
291
timeout-minutes : 30
292
+ name : windows
293
+ runs-on : windows-2022
303
294
defaults :
304
295
run :
305
296
shell : bash
@@ -313,6 +304,7 @@ jobs:
313
304
cache : true
314
305
check-latest : true
315
306
- run : go install ./cmd/nerdctl
307
+ - run : go install -v gotest.tools/gotestsum@v1
316
308
317
309
with :
318
310
repository : containerd/containerd
@@ -326,16 +318,16 @@ jobs:
326
318
env :
327
319
ctrdVersion : 1.7.23
328
320
run : powershell hack/configure-windows-ci.ps1
329
- # TODO: Run unit tests
330
321
- name : " Run integration tests"
331
- # See https://github.com/containerd/nerdctl/blob/main/docs/testing/README.md#about-parallelization
332
- run : go test -p 1 -v ./cmd/nerdctl/...
322
+ run : ./hack/test-integration.sh -test.only-flaky=false
323
+ - name : " Run integration tests (flaky)"
324
+ run : ./hack/test-integration.sh -test.only-flaky=true
333
325
334
326
test-integration-freebsd :
327
+ timeout-minutes : 60
335
328
name : FreeBSD
336
329
# ubuntu-24.04 lacks the vagrant package
337
330
runs-on : ubuntu-22.04
338
- timeout-minutes : 20
339
331
340
332
steps :
341
333
0 commit comments