Skip to content

Commit d80c2cf

Browse files
committed
Fix alma ci target
Signed-off-by: apostasie <[email protected]>
1 parent 34e44e7 commit d80c2cf

File tree

3 files changed

+39
-28
lines changed

3 files changed

+39
-28
lines changed

.github/workflows/test.yml

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,10 @@ jobs:
429429
matrix:
430430
mode: ["rootful", "rootless"]
431431
runs-on: ubuntu-24.04
432+
env:
433+
MODE: ${{ matrix.mode }}
434+
# FIXME: this is only necessary to access the build cache. To remove with build cleanup.
435+
CONTAINERD_VERSION: v2.0.3
432436
steps:
433437
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
434438
with:
@@ -490,20 +494,44 @@ jobs:
490494
echo "DOCKER_HOST=${DOCKER_HOST}" >>$GITHUB_ENV
491495
docker info
492496
docker version
497+
- name: "Expose GitHub Runtime variables for gha"
498+
uses: crazy-max/ghaction-github-runtime@b3a9207c0e1ef41f4cf215303c976869d0c2c1c4 # v3.0.0
493499
- name: "Prepare integration tests"
494-
env:
495-
MODE: ${{ matrix.mode }}
496500
run: |
497501
set -eux
498-
TARGET=test-integration
499-
[ "$MODE" = "rootless" ] && TARGET=test-integration-rootless
500-
docker build -t test-integration --target "${TARGET}" .
501-
# losetup not working as expected on EL8?
502-
# > === FAIL: cmd/nerdctl/container TestRunDevice (0.44s)
503-
# > container_run_cgroup_linux_test.go:236: assertion failed: error is not nil: loopback setup failed ([losetup --find --show /tmp/containerd-test-loopback3931357228]):
504-
# > stdout="", stderr="losetup: /tmp/containerd-test-loopback3931357228: failed to set up loop device: No such file or directory\n": exit status 1
505-
# https://github.com/containerd/nerdctl/pull/3904#issuecomment-2670917820
502+
506503
sudo losetup -Dv
507504
sudo losetup -lv
505+
506+
TARGET=test-integration
507+
[ "$MODE" = "rootless" ] && TARGET=test-integration-rootless
508+
docker buildx create --name with-gha --use
509+
docker buildx build \
510+
--output=type=docker \
511+
--cache-from type=gha,scope=amd64-${CONTAINERD_VERSION} \
512+
-t test-integration --target "${TARGET}" \
513+
.
514+
508515
- name: "Run integration tests"
509-
run: docker run -t --rm --privileged test-integration
516+
# Presumably, something is broken with the way docker exposes /dev to the container, as it appears to only
517+
# randomly work. Mounting /dev does workaround the issue.
518+
# This might be due to the old kernel shipped with Alma (4.18), or something else between centos/docker.
519+
run: |
520+
set -eux
521+
[ "$MODE" = "rootless" ] && {
522+
echo "rootless"
523+
docker run -t -v /dev:/dev --rm --privileged test-integration /test-integration-rootless.sh ./hack/test-integration.sh -test.only-flaky=false
524+
} || {
525+
echo "rootful"
526+
docker run -t -v /dev:/dev --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=false
527+
}
528+
- name: "Run integration tests (flaky)"
529+
run: |
530+
set -eux
531+
[ "$MODE" = "rootless" ] && {
532+
echo "rootless"
533+
docker run -t -v /dev:/dev --rm --privileged test-integration /test-integration-rootless.sh ./hack/test-integration.sh -test.only-flaky=true
534+
} || {
535+
echo "rootful"
536+
docker run -t -v /dev:/dev --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=true
537+
}

cmd/nerdctl/container/container_run_cgroup_linux_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"os"
2424
"path/filepath"
2525
"strconv"
26-
"strings"
2726
"testing"
2827

2928
"gotest.tools/v3/assert"
@@ -37,7 +36,6 @@ import (
3736

3837
"github.com/containerd/nerdctl/v2/pkg/cmd/container"
3938
"github.com/containerd/nerdctl/v2/pkg/idutil/containerwalker"
40-
"github.com/containerd/nerdctl/v2/pkg/infoutil"
4139
"github.com/containerd/nerdctl/v2/pkg/testutil"
4240
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
4341
)
@@ -230,14 +228,6 @@ func TestRunDevice(t *testing.T) {
230228

231229
testCase.Require = nerdtest.Rootful
232230

233-
if unameR := infoutil.UnameR(); strings.Contains(unameR, ".el8") {
234-
t.Logf("Assuming to be running on EL8 (kernel release %q)", unameR)
235-
t.Skip("FIXME: loopback.New fails on EL8 (when the test is executed inside a container) https://github.com/containerd/nerdctl/pull/3904#issuecomment-2670917820")
236-
// > === FAIL: cmd/nerdctl/container TestRunDevice (0.44s)
237-
// > container_run_cgroup_linux_test.go:236: assertion failed: error is not nil: loopback setup failed ([losetup --find --show /tmp/containerd-test-loopback3931357228]):
238-
// > stdout="", stderr="losetup: /tmp/containerd-test-loopback3931357228: failed to set up loop device: No such file or directory\n": exit status 1
239-
}
240-
241231
const n = 3
242232
lo := make([]*loopback.Loopback, n)
243233

cmd/nerdctl/container/container_stats_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ package container
1818

1919
import (
2020
"runtime"
21-
"strings"
2221
"testing"
2322

2423
"github.com/containerd/nerdctl/mod/tigron/expect"
2524
"github.com/containerd/nerdctl/mod/tigron/require"
2625
"github.com/containerd/nerdctl/mod/tigron/test"
2726

28-
"github.com/containerd/nerdctl/v2/pkg/infoutil"
2927
"github.com/containerd/nerdctl/v2/pkg/testutil"
3028
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
3129
)
@@ -45,11 +43,6 @@ func TestStats(t *testing.T) {
4543
)
4644
}
4745

48-
if unameR := infoutil.UnameR(); strings.Contains(unameR, ".el8") {
49-
t.Logf("Assuming to be running on EL8 (kernel release %q)", unameR)
50-
t.Skip("FIXME: the test seems to hang on EL8: https://github.com/containerd/nerdctl/pull/3904#issuecomment-2693931822")
51-
}
52-
5346
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
5447
helpers.Anyhow("rm", "-f", data.Identifier("container"))
5548
helpers.Anyhow("rm", "-f", data.Identifier("memlimited"))

0 commit comments

Comments
 (0)