Skip to content

Commit d71d69a

Browse files
committed
Separate flaky and non-flaky and minor test cleanups
Signed-off-by: apostasie <[email protected]>
1 parent 6abe279 commit d71d69a

25 files changed

+350
-365
lines changed

.github/workflows/ghcr-image-build-and-publish.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Container Image Build
1+
name: image
22

33
# This workflow uses actions that are not certified by GitHub.
44
# They are provided by a third-party and are governed by
@@ -21,9 +21,8 @@ env:
2121
# github.repository as <account>/<repo>
2222
IMAGE_NAME: ${{ github.repository }}
2323

24-
2524
jobs:
26-
build:
25+
publish:
2726

2827
runs-on: ubuntu-24.04
2928
permissions:

.github/workflows/lint.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'release/**'
8+
pull_request:
9+
10+
env:
11+
GO_VERSION: 1.23.x
12+
13+
jobs:
14+
go:
15+
timeout-minutes: 5
16+
name: "go | ${{ matrix.goos }} | ${{ matrix.gonext }}"
17+
runs-on: "${{ matrix.os }}"
18+
strategy:
19+
matrix:
20+
include:
21+
- os: ubuntu-24.04
22+
goos: linux
23+
- os: ubuntu-24.04
24+
goos: freebsd
25+
# FIXME: this is currently failing in a non-sensical way, so, running on linux instead...
26+
# - os: windows-2022
27+
- os: ubuntu-24.04
28+
goos: windows
29+
- os: ubuntu-24.04
30+
goos: linux
31+
# This allows the canary script to select any upcoming golang alpha/beta/RC
32+
gonext: next
33+
- os: ubuntu-24.04
34+
goos: freebsd
35+
gonext: next
36+
- os: ubuntu-24.04
37+
goos: windows
38+
gonext: next
39+
env:
40+
GOOS: "${{ matrix.goos }}"
41+
steps:
42+
- uses: actions/[email protected]
43+
with:
44+
fetch-depth: 1
45+
- name: Set GO env
46+
run: |
47+
# If gonext is specified, get the latest available golang pre-release instead of the major version
48+
if [ "$gonext" != "" ]; then
49+
. ./hack/build-integration-canary.sh
50+
canary::golang::latest
51+
fi
52+
- uses: actions/setup-go@v5
53+
with:
54+
go-version: ${{ env.GO_VERSION }}
55+
check-latest: true
56+
cache: true
57+
- name: golangci-lint
58+
uses: golangci/golangci-lint-action@v6
59+
with:
60+
args: --verbose
61+
62+
other:
63+
timeout-minutes: 5
64+
name: yaml, shell, import order
65+
runs-on: ubuntu-24.04
66+
steps:
67+
- uses: actions/[email protected]
68+
with:
69+
fetch-depth: 1
70+
- uses: actions/setup-go@v5
71+
with:
72+
go-version: ${{ env.GO_VERSION }}
73+
check-latest: true
74+
cache: true
75+
- name: yaml
76+
run: make lint-yaml
77+
- name: shell
78+
run: make lint-shell
79+
- name: go imports ordering
80+
run: |
81+
go install -v github.com/incu6us/goimports-reviser/v3@latest
82+
make lint-imports

.github/workflows/project.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
project:
12-
name: Project Checks
12+
name: checks
1313
runs-on: ubuntu-24.04
1414
timeout-minutes: 20
1515
steps:

.github/workflows/test-canary.yml

+8-25
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,6 @@ env:
1515
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1616

1717
jobs:
18-
lint:
19-
runs-on: "ubuntu-24.04"
20-
timeout-minutes: 20
21-
steps:
22-
- uses: actions/[email protected]
23-
with:
24-
fetch-depth: 1
25-
- name: Set GO env
26-
run: |
27-
. ./hack/build-integration-canary.sh
28-
canary::golang::latest
29-
- uses: actions/setup-go@v5
30-
with:
31-
go-version: ${{ env.GO_VERSION }}
32-
check-latest: true
33-
cache: true
34-
- name: golangci-lint
35-
uses: golangci/[email protected]
36-
with:
37-
args: --verbose
38-
3918
linux:
4019
runs-on: "ubuntu-24.04"
4120
timeout-minutes: 40
@@ -65,11 +44,13 @@ jobs:
6544
- name: "Run unit tests"
6645
run: go test -v ./pkg/...
6746
- name: "Run integration tests"
68-
run: docker run -t --rm --privileged test-integration
47+
run: docker run -t --rm --privileged test-integration ./hack/test-integration.sh
48+
- name: "Run integration tests (flaky)"
49+
run: docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky
6950

7051
windows:
71-
runs-on: windows-latest
7252
timeout-minutes: 30
53+
runs-on: windows-latest
7354
defaults:
7455
run:
7556
shell: bash
@@ -95,6 +76,7 @@ jobs:
9576
cache: true
9677
check-latest: true
9778
- run: go install ./cmd/nerdctl
79+
- run: go install -v gotest.tools/gotestsum@v1
9880
# This here is solely to get the cni install script, which has not been modified in 3+ years.
9981
# There is little to no reason to update this to latest containerd
10082
- uses: actions/[email protected]
@@ -112,5 +94,6 @@ jobs:
11294
ctrdVersion: ${{ env.CONTAINERD_VERSION }}
11395
run: powershell hack/configure-windows-ci.ps1
11496
- name: "Run integration tests"
115-
# See https://github.com/containerd/nerdctl/blob/main/docs/testing/README.md#about-parallelization
116-
run: go test -p 1 -v ./cmd/nerdctl/...
97+
run: ./hack/test-integration.sh
98+
- name: "Run integration tests (flaky)"
99+
run: ./hack/test-integration.sh -test.only-flaky

.github/workflows/test-kube.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ on:
1010
paths-ignore:
1111
- '**.md'
1212

13-
env:
14-
ROOTFUL: true
15-
1613
jobs:
1714
linux:
1815
runs-on: "ubuntu-24.04"
1916
timeout-minutes: 40
17+
env:
18+
ROOTFUL: true
2019
steps:
2120
- uses: actions/[email protected]
2221
with:

0 commit comments

Comments
 (0)