Skip to content

[CI]: Evergreen / Everred #4129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ jobs:
shell: bash
strategy:
fail-fast: false
# Note: technically, `make lint-go-all` will run the linter for all platforns, and could be called on a single instance.
# The point of running it instead on a matrix here is to verify that the tooling itself is working on the target OS.
matrix:
include:
- os: ubuntu-24.04
goos: linux
- os: ubuntu-24.04
goos: freebsd
- os: ubuntu-24.04
goos: darwin
- os: macos-15
# FIXME: this is currently failing in a non-sensical way, so, running on linux instead...
# - os: windows-2022
- os: ubuntu-24.04
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
# To avoid that, we explicitly list the architectures we do want emulation for.
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
- name: "Run unit tests"
run: go test -v ./pkg/...
- name: "Run integration tests"
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,28 @@ jobs:
# To avoid that, we explicitly list the architectures we do want emulation for.
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
- name: "Install go"
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
# 1.6 does not use the system store?
- name: "Mock services"
run: |
make binaries
CLI=docker ./mod/proofing/spoof.sh server::start ./pkg/testutil/images.env
sudo systemctl restart containerd
sudo -E PATH="_output:$PATH" ./mod/proofing/spoof.sh server::seed ./pkg/testutil/images.env
- name: "Run integration tests"
run: docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=false
run: |
# FIXME: maybe autodetect the IP by parsing /etc/hosts from the container instead?
docker run -t --rm \
--env PROOFING_IP=$(docker inspect proofing-spoofer -f '{{ .NetworkSettings.IPAddress }}') \
--privileged test-integration ./hack/test-integration.sh -test.only-flaky=false
- name: "Run integration tests (flaky)"
run: docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=true
run: |
docker run -t --rm \
--privileged test-integration ./hack/test-integration.sh -test.only-flaky=true

test-integration-ipv6:
needs: build-dependencies
Expand Down Expand Up @@ -196,7 +213,6 @@ jobs:
# To avoid that, we explicitly list the architectures we do want emulation for.
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
- name: "Run integration tests"
# The nested IPv6 network inside docker and qemu is complex and needs a bunch of sysctl config.
# Therefore, it's hard to debug why the IPv6 tests fail in such an isolation layer.
Expand Down Expand Up @@ -271,7 +287,6 @@ jobs:
# To avoid that, we explicitly list the architectures we do want emulation for.
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
- name: "Expose GitHub Runtime variables for gha"
uses: crazy-max/ghaction-github-runtime@3cb05d89e1f492524af3d41a1c98c83bc3025124 # v3.1.0
- name: "Prepare (network driver=slirp4netns, port driver=builtin)"
Expand Down Expand Up @@ -333,7 +348,6 @@ jobs:
# To avoid that, we explicitly list the architectures we do want emulation for.
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
- name: "Prepare integration test environment"
run: |
# FIXME: remove expect when we are done removing unbuffer from tests
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ lint-go-all:
$(call title, $@)
@cd $(MAKEFILE_DIR) \
&& GOOS=linux make lint-go \
&& GOOS=windows make lint-go \
&& GOOS=freebsd make lint-go
&& GOOS=freebsd make lint-go \
&& GOOS=darwin make lint-go \
&& GOOS=windows make lint-go
$(call footer, $@)

lint-yaml:
Expand Down Expand Up @@ -179,6 +180,7 @@ lint-licenses-all:
@cd $(MAKEFILE_DIR) \
&& GOOS=linux make lint-licenses \
&& GOOS=freebsd make lint-licenses \
&& GOOS=darwin make lint-licenses \
&& GOOS=windows make lint-licenses
$(call footer, $@)

Expand All @@ -196,6 +198,7 @@ fix-go-all:
@cd $(MAKEFILE_DIR) \
&& GOOS=linux make fix-go \
&& GOOS=freebsd make fix-go \
&& GOOS=darwin make fix-go \
&& GOOS=windows make fix-go
$(call footer, $@)

Expand Down
4 changes: 2 additions & 2 deletions cmd/nerdctl/builder/builder_build_oci_layout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/require"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"

"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
Expand Down Expand Up @@ -100,14 +101,13 @@ CMD ["echo", "test-nerdctl-build-context-oci-layout"]`
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: func(stdout string, info string, t *testing.T) {
Output: func(stdout string, t tig.T) {
assert.Assert(
t,
strings.Contains(
helpers.Capture("run", "--rm", data.Identifier("child")),
"test-nerdctl-build-context-oci-layout",
),
info,
)
},
}
Expand Down
11 changes: 6 additions & 5 deletions cmd/nerdctl/builder/builder_build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/require"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"

"github.com/containerd/nerdctl/v2/pkg/buildkitutil"
"github.com/containerd/nerdctl/v2/pkg/platformutil"
Expand Down Expand Up @@ -339,7 +340,7 @@ COPY %s /`, testFileName)
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: func(stdout, info string, t *testing.T) {
Output: func(stdout string, t tig.T) {
// Expecting testFileName to exist inside the output target directory
assert.Equal(t, data.Temp().Load(testFileName), testContent, "file content is identical")
},
Expand All @@ -353,7 +354,7 @@ COPY %s /`, testFileName)
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: func(stdout, info string, t *testing.T) {
Output: func(stdout string, t tig.T) {
assert.Equal(t, data.Temp().Load(testFileName), testContent, "file content is identical")
},
}
Expand Down Expand Up @@ -890,7 +891,7 @@ func TestBuildAttestation(t *testing.T) {
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: func(stdout, info string, t *testing.T) {
Output: func(stdout string, t tig.T) {
data.Temp().Exists("dir-for-bom", testSBOMFileName)
},
}
Expand All @@ -912,7 +913,7 @@ func TestBuildAttestation(t *testing.T) {
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: func(stdout, info string, t *testing.T) {
Output: func(stdout string, t tig.T) {
data.Temp().Exists("dir-for-prov", testProvenanceFileName)
},
}
Expand All @@ -935,7 +936,7 @@ func TestBuildAttestation(t *testing.T) {
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: func(stdout, info string, t *testing.T) {
Output: func(stdout string, t tig.T) {
data.Temp().Exists("dir-for-attest", testSBOMFileName)
data.Temp().Exists("dir-for-attest", testProvenanceFileName)
},
Expand Down
14 changes: 10 additions & 4 deletions cmd/nerdctl/builder/builder_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/containerd/nerdctl/mod/tigron/test"

"github.com/containerd/nerdctl/v2/pkg/buildkitutil"
"github.com/containerd/nerdctl/v2/pkg/referenceutil"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
)
Expand Down Expand Up @@ -152,14 +153,19 @@ CMD ["echo", "nerdctl-builder-debug-test-string"]`, testutil.CommonImage)
// FIXME: this test should be rewritten to dynamically retrieve the ids, and use images
// available on all platforms
oldImage := testutil.BusyboxImage
oldImageSha := "7b3ccabffc97de872a30dfd234fd972a66d247c8cfc69b0550f276481852627c"
parsedOldImage, err := referenceutil.Parse(oldImage)
assert.NilError(helpers.T(), err)
oldImageSha := parsedOldImage.Digest.String()

newImage := testutil.AlpineImage
newImageSha := "ec14c7992a97fc11425907e908340c6c3d6ff602f5f13d899e6b7027c9b4133a"
parsedNewImage, err := referenceutil.Parse(newImage)
assert.NilError(helpers.T(), err)
newImageSha := parsedNewImage.Digest.String()

helpers.Ensure("pull", "--quiet", oldImage)
helpers.Ensure("tag", oldImage, newImage)
helpers.Ensure("tag", oldImage, parsedNewImage.Domain+"/"+parsedNewImage.Path+":"+parsedNewImage.Tag)

dockerfile := fmt.Sprintf(`FROM %s`, newImage)
dockerfile := fmt.Sprintf(`FROM %s`, parsedNewImage.Domain+"/"+parsedNewImage.Path+":"+parsedNewImage.Tag)
data.Temp().Save(dockerfile, "Dockerfile")
data.Labels().Set("oldImageSha", oldImageSha)
data.Labels().Set("newImageSha", newImageSha)
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose/compose_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (

"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"

"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
)
Expand Down Expand Up @@ -111,7 +112,7 @@ services:
testCase.Expected = func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
ExitCode: 0,
Output: func(stdout, info string, t *testing.T) {
Output: func(stdout string, t tig.T) {
assert.Assert(t, data.Labels().Get("hash") != stdout, "hash should be different")
},
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/nerdctl/compose/compose_cp_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (

"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"

"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
Expand Down Expand Up @@ -79,7 +80,7 @@ services:
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: func(stdout, info string, t *testing.T) {
Output: func(stdout string, t tig.T) {
copied := data.Temp().Load("test-file2")
assert.Equal(t, copied, testFileContent)
},
Expand Down
7 changes: 4 additions & 3 deletions cmd/nerdctl/compose/compose_create_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"

"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
Expand Down Expand Up @@ -66,7 +67,7 @@ services:
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "ps", "svc0", "-a")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout, info string, t *testing.T) {
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout string, t tig.T) {
assert.Assert(t,
strings.Contains(stdout, "created") || strings.Contains(stdout, "Created"),
"stdout should contain `created`")
Expand Down Expand Up @@ -125,7 +126,7 @@ services:
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "ps", "svc0", "-a")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout, info string, t *testing.T) {
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout string, t tig.T) {
assert.Assert(t,
strings.Contains(stdout, "created") || strings.Contains(stdout, "Created"),
"stdout should contain `created`")
Expand All @@ -137,7 +138,7 @@ services:
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "ps", "svc1", "-a")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout, info string, t *testing.T) {
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout string, t tig.T) {
assert.Assert(t,
strings.Contains(stdout, "created") || strings.Contains(stdout, "Created"),
"stdout should contain `created`")
Expand Down
15 changes: 8 additions & 7 deletions cmd/nerdctl/container/container_attach_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (

"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"

"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
Expand Down Expand Up @@ -64,7 +65,7 @@ func TestAttach(t *testing.T) {
cmd.Run(&test.Expected{
ExitCode: 0,
Errors: []error{errors.New("read detach keys")},
Output: func(stdout string, info string, t *testing.T) {
Output: func(stdout string, t tig.T) {
assert.Assert(t, strings.Contains(helpers.Capture("inspect", "--format", "json", data.Identifier()), "\"Running\":true"))
},
})
Expand Down Expand Up @@ -93,7 +94,7 @@ func TestAttach(t *testing.T) {
Errors: []error{errors.New("read detach keys")},
Output: expect.All(
expect.Contains("markmark"),
func(stdout string, info string, t *testing.T) {
func(stdout string, t tig.T) {
assert.Assert(t, strings.Contains(helpers.Capture("inspect", "--format", "json", data.Identifier()), "\"Running\":true"))
},
),
Expand Down Expand Up @@ -125,7 +126,7 @@ func TestAttachDetachKeys(t *testing.T) {
cmd.Run(&test.Expected{
ExitCode: 0,
Errors: []error{errors.New("read detach keys")},
Output: func(stdout string, info string, t *testing.T) {
Output: func(stdout string, t tig.T) {
assert.Assert(t, strings.Contains(helpers.Capture("inspect", "--format", "json", data.Identifier()), "\"Running\":true"))
},
})
Expand Down Expand Up @@ -153,7 +154,7 @@ func TestAttachDetachKeys(t *testing.T) {
Errors: []error{errors.New("read detach keys")},
Output: expect.All(
expect.Contains("markmark"),
func(stdout string, info string, t *testing.T) {
func(stdout string, t tig.T) {
assert.Assert(t, strings.Contains(helpers.Capture("inspect", "--format", "json", data.Identifier()), "\"Running\":true"))
},
),
Expand Down Expand Up @@ -182,8 +183,8 @@ func TestAttachForAutoRemovedContainer(t *testing.T) {
cmd.Run(&test.Expected{
ExitCode: 0,
Errors: []error{errors.New("read detach keys")},
Output: func(stdout string, info string, t *testing.T) {
assert.Assert(t, strings.Contains(helpers.Capture("inspect", "--format", "json", data.Identifier()), "\"Running\":true"), info)
Output: func(stdout string, t tig.T) {
assert.Assert(t, strings.Contains(helpers.Capture("inspect", "--format", "json", data.Identifier()), "\"Running\":true"))
},
})
}
Expand All @@ -202,7 +203,7 @@ func TestAttachForAutoRemovedContainer(t *testing.T) {
ExitCode: 42,
Output: expect.All(
expect.Contains("markmark"),
func(stdout string, info string, t *testing.T) {
func(stdout string, t tig.T) {
assert.Assert(t, !strings.Contains(helpers.Capture("ps", "-a"), data.Identifier()))
},
),
Expand Down
5 changes: 3 additions & 2 deletions cmd/nerdctl/container/container_commit_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"testing"

"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"

"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
Expand All @@ -41,7 +42,7 @@ func TestKubeCommitSave(t *testing.T) {
nerdtest.KubeCtlCommand(helpers, "wait", "pod", identifier, "--for=condition=ready", "--timeout=1m").Run(&test.Expected{})
nerdtest.KubeCtlCommand(helpers, "exec", identifier, "--", "mkdir", "-p", "/tmp/whatever").Run(&test.Expected{})
nerdtest.KubeCtlCommand(helpers, "get", "pods", identifier, "-o", "jsonpath={ .status.containerStatuses[0].containerID }").Run(&test.Expected{
Output: func(stdout string, info string, t *testing.T) {
Output: func(stdout string, t tig.T) {
containerID = strings.TrimPrefix(stdout, "containerd://")
},
})
Expand Down Expand Up @@ -73,7 +74,7 @@ func TestKubeCommitSave(t *testing.T) {

cmd = nerdtest.KubeCtlCommand(helpers, "get", "pods", tID, "-o", "jsonpath={ .status.hostIPs[0].ip }")
cmd.Run(&test.Expected{
Output: func(stdout string, info string, t *testing.T) {
Output: func(stdout string, t tig.T) {
registryIP = stdout
},
})
Expand Down
Loading
Loading