77 Commits

Author SHA1 Message Date
Tonis Tiigi
95735c4ef9 ci: run compatibility releases via hack/test
Move compatibility-releases to a single job that reuses the
integration test image flow from the main test workflow.

Add hack/test support for injecting a buildkitd binary and add a
dedicated hack/test-compatibility-releases wrapper for the release
sweep.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-04-14 19:16:07 -07:00
CrazyMax
71068191db hack: use bake to build the dockerfile frontend
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-11-25 18:55:48 +01:00
CrazyMax
1c917b4290 test: handle gha cache v2
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-02-18 19:07:45 +01:00
Tonis Tiigi
33088c1a56 hack: allow passing config file to test and shell script
One should not use their regular docker credentials here
but make a special config file with only public readonly
token inside.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-01-30 19:00:29 -08:00
CrazyMax
2a1cc96230 hack: mount docker config on gha
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-01-30 17:17:26 -08:00
Tonis Tiigi
69034c34df test: allow testing frontends from different version
This allows running Dockerfile tests so that the Dockerfile
version and the BuildKit version are from different commits so
that we can test that old Dockerfile releases remain compatible
with the latest BuildKit.

The tests are based on the commit of the Dockerfile frontend as
we can't expect that new test would work on old frontends. In future
we might consider doing it the other way as well but then we need
a way to mark tests that can be ignored if they are not expected to
pass because of a new feature dependency.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-13 20:14:17 -08:00
Tonis Tiigi
54b2474063 hack: track helper process coverage in integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-05-17 19:42:17 -07:00
Brian Goff
a27e9556a7 Fix case where TESTFLAGS may be unset
Found this when executing `hack/test dockerfile`, it complains that
`TESTFLAGS` is unset.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-02-23 20:32:11 +00:00
CrazyMax
1b7981d8f6 hack: fix unbound variable
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-02-16 10:56:46 +01:00
CrazyMax
dff23a7cda test: warn if testing dockerd worker without disabled features
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-02-01 09:44:05 +01:00
Sebastiaan van Stijn
295c899374 hack/test: allow ALPINE_VERSION to be set from env
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-10 13:43:32 +01:00
CrazyMax
a536dea8a6 hack(test): tidy create command and display invoked docker cmds
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-09-15 08:45:35 +02:00
CrazyMax
341d6b300f create integration-tests bake target
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-09-15 08:45:34 +02:00
CrazyMax
01e5c00f0f hack(test): opt to avoid building the integration tests image
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-09-15 08:45:34 +02:00
CrazyMax
bb18da8347 hack: align syntax
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-09-15 08:45:34 +02:00
CrazyMax
9f3c803596 hack(test): use trap to remove cache volume
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-09-15 08:45:33 +02:00
Justin Chadwell
08b7d1b7bb hack: forward CGO_ENABLED into test container
If we try and run the integration tests with `-race` set, `hack/test`
correctly prompts us to also set `CGO_ENABLED`.

However, this value only gets set during build, and not during the
actual test run, which spawns the following error:

	=== Errors
	go: -race requires cgo; enable cgo by setting CGO_ENABLED=1

	DONE 0 tests, 1 error in 0.002s

To resolve this, we need to propogate the value of `CGO_ENABLED` into
the created test containers, so that we can actually run these tests
properly.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-08-17 13:45:57 +01:00
CrazyMax
22178c0ccd integration: missing env var to check feature compat
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-07-24 02:37:14 +02:00
CrazyMax
3e58e1ca34 hack: allow to set GO_VERSION during tests
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-07-12 16:39:02 +02:00
Alex Couture-Beil
9f319c2eed bash lint fix
Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2023-07-07 10:06:50 -07:00
Alex Couture-Beil
104d04335f rename BUILDFLAGS to GOBUILDFLAGS
Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2023-07-07 09:35:07 -07:00
Alex Couture-Beil
6695ae0932 dockerfile: arg for controlling go build flags
This introduces new `BUILDFLAGS`, `VERIFYFLAGS`, and `CGO_ENABLED` build-args,
which can be used to change how buildkitd is compiled.

This, for example, can be used to enable the go data race detector during
integration testing:

    CGO_ENABLED=1 BUILDFLAGS="-race" TESTFLAGS="-v -test.run=TestClientGatewayIntegration/TestClientGatewaySolve" TESTPKGS=./client ./hack/test integration

This additionally introduces a new `make test-race` target, which
simplifies how to run all tests with the race detector.

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2023-07-06 16:34:44 -07:00
Alex Couture-Beil
854fa75df3 dockerfile: arg to enable go race detection
This introduces a new `make test-race` target, which will compile
buildkitd using the `go build -race` flag, which is useful for detecting
data races.

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2023-07-06 15:00:55 -07:00
CrazyMax
2e63e310ff test: set mod vendor
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-03-18 10:43:50 +01:00
CrazyMax
2870e0e91e test: use gotestsum to generate reports
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-03-18 10:43:50 +01:00
CrazyMax
e39c44de24 integration: enforce features compat through env vars
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-03-14 00:49:02 +01:00
CrazyMax
e4c0cd6b41 integration: set custom flags for dockerd worker
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-09 19:12:02 +01:00
Wei Zhang
509e5e0582 test: add proxy build args when existed
Signed-off-by: Wei Zhang <kweizh@gmail.com>
2023-01-30 23:05:35 +08:00
CrazyMax
09b50ad9e5 cache: test gha cache exporter
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-12-12 20:10:15 +01:00
Akihiro Suda
e5516c22a0 integration: add ENTRYPOINT to fix nested cgroup v2
See https://github.com/moby/moby/blob/v20.10.21/hack/dind#L28-L38

Fix issue 3265

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-11-10 10:50:13 +09:00
Yan Song
fa43b9f532 test: add test for nydus compression type
Signed-off-by: Yan Song <imeoer@linux.alibaba.com>
2022-11-01 03:21:51 +00:00
CrazyMax
fd3eeb1e13 chore: fix test dockerd bin perms
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-03-19 18:38:10 +01:00
CrazyMax
e7e6aff66e chore: fix dockerd copy
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-03-18 12:32:10 +01:00
Erik Sipsma
d73e62f878 Add initial MergeOp implementation.
This consists of just the base MergeOp with support for merging LLB
results that include deletions using hardlinks as the efficient path
and copies as fallback.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2021-11-18 11:10:48 -08:00
CrazyMax
ec65f412b6 Use gha cache on CI
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-10-05 10:51:48 +02:00
Tonis Tiigi
19453d5acc test: fix mirror cache handling
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-07 18:59:32 -07:00
CrazyMax
9ed0d25af2 Merge branch 'master' into remove-travis 2020-11-30 10:17:25 +01:00
CrazyMax
1ac6bd4cbc Fix CI cache
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2020-11-29 06:45:39 +01:00
CrazyMax
00570378a8 Remove travis support
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2020-11-26 19:02:04 +01:00
CrazyMax
d56ddccf0a Refactor release for GitHub Actions
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2020-11-24 22:51:57 +01:00
CrazyMax
135782149d Refactor test for GitHub Actions
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2020-11-22 08:36:43 +01:00
CrazyMax
e22c19d77f Refactor test for GitHub Actions
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2020-11-22 04:04:01 +01:00
CrazyMax
a13c69ae8d Fix test
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2020-11-21 05:50:13 +01:00
Tonis Tiigi
81f74a9c89 dockerfile: rename experimental channel to labs
Experimental name confuses users as backwards compatibility
rules are different for other tools called experimental.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-11-17 07:42:50 -08:00
Tonis Tiigi
906e34510d dockerfile: update run mounts to stable channel
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-04 22:22:08 -07:00
Paul "TBBle" Hampson
3132f4d0ed Clarify the gateway 'test' as a build-test
It also doesn't need dockerd added to its container when it builds.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-07-30 23:12:29 +10:00
Tonis Tiigi
8c55320f45 hack: add shfmt
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-24 21:17:54 -07:00
Tonis Tiigi
f4cf0d3918 hack: unbreak testing
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-16 15:26:53 -07:00
Tonis Tiigi
d64e417b1c hack: allow testing with dockerd
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-08 23:27:20 -07:00
Akihiro Suda
5938170b84 hack: rename Dockerfiles
Fix https://github.com/moby/buildkit/issues/1208

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-10-18 17:21:48 +09:00