-
Notifications
You must be signed in to change notification settings - Fork 36
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
Cache bincapz-samples repository to speed up subsequent tests #448
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,8 +47,22 @@ fix: $(FIXERS) | |
|
||
# END: lint-install ../bincapz | ||
|
||
SAMPLES_HASH=bdcb8c2e9bf557a0abe3e2b0144f437d456299b7 | ||
out/samples-$(SAMPLES_HASH): | ||
mkdir -p out | ||
git clone https://github.com/chainguard-dev/bincapz-samples.git out/samples-$(SAMPLES_HASH).tmp | ||
git -C out/samples-$(SAMPLES_HASH).tmp checkout $(SAMPLES_HASH) | ||
for file in caddy.xz chezmoi.xz minio_x86_64.xz mongosh.xz neuvector_agent_aarch64.xz opa.xz ; do \ | ||
egibs marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this work to avoid hardcoding filenames?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Implemented a variant of this in |
||
tar -xJvf out/samples-$(SAMPLES_HASH).tmp/linux/clean/$$file -C out/samples-$(SAMPLES_HASH).tmp/linux/clean; \ | ||
done | ||
tar -xJvf out/samples-$(SAMPLES_HASH).tmp/macOS/clean/bincapz.xz -C out/samples-$(SAMPLES_HASH).tmp/macOS/clean | ||
mv out/samples-$(SAMPLES_HASH).tmp out/samples-$(SAMPLES_HASH) | ||
|
||
prepare-samples: out/samples-$(SAMPLES_HASH) | ||
cp -a test_data/. out/samples-$(SAMPLES_HASH) | ||
|
||
.PHONY: test | ||
test: clone-samples | ||
test: prepare-samples | ||
go test $(shell go list ./... | grep -v test_data) | ||
|
||
.PHONY: bench | ||
|
@@ -113,16 +127,7 @@ update-third-party: | |
.PHONY: refresh-sample-testdata out/bincapz | ||
refresh-sample-testdata: clone-samples out/bincapz | ||
cp ./test_data/refresh-testdata.sh samples/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: in a future PR, we can switch to running this script from the |
||
./samples/refresh-testdata.sh ./out/bincapz | ||
|
||
.PHONY: clone-samples | ||
clone-samples: | ||
rm -rf samples; git clone git@github.com:chainguard-dev/bincapz-samples.git samples | ||
cp -a test_data/. samples/ | ||
for file in caddy.xz chezmoi.xz minio_x86_64.xz mongosh.xz neuvector_agent_aarch64.xz opa.xz ; do \ | ||
tar -xJvf samples/linux/clean/$$file -C samples/linux/clean; \ | ||
done | ||
tar -xJvf samples/macOS/clean/bincapz.xz -C samples/macOS/clean | ||
./out/samples/refresh-testdata.sh ./out/bincapz | ||
|
||
ARCH ?= $(shell uname -m) | ||
CRANE_VERSION=v0.20.2 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we run the makefile rule instead of duplicating this logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had some hang up about that mentally but it may just be because I cloned the other repository separately and wasn't sure if our anonymous clone would work.
The make targets should work in CI as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in
4ad123f
(#448).