Skip to content
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

Split make test in script/ for faster partial testing during dev #279

Merged
merged 1 commit into from
Feb 27, 2024
Merged
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
28 changes: 17 additions & 11 deletions scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,7 @@ version: # @HELP outputs the version string
version:
echo $(VERSION)

test: # @HELP runs tests
test: container
test-inotify:
echo "Building and testing inotify"
docker run \
-i \
Expand All @@ -355,27 +354,34 @@ test: container
--env HTTPS_PROXY="$(HTTPS_PROXY)" \
alpine:3.16 \
sh -c 'cp -a /src /inotify && cd /inotify && ./build.sh && ./test.sh'
echo "Testing install-cni.sh"

test-shell: container
echo "Running shell-test.sh"
docker run \
-i \
--rm \
-v $$(pwd)/test.out:/host/etc/cni/net.d \
-v $$(pwd)/testdata/token:/var/run/secrets/kubernetes.io/serviceaccount/token \
-v $$(pwd):/src \
--workdir /src \
-v $$(pwd)/shell-test.sh:/test.sh \
--env HTTP_PROXY="$(HTTP_PROXY)" \
--env HTTPS_PROXY="$(HTTPS_PROXY)" \
$(REGISTRY)/$(BINS):$(TAG) \
/src/test-install-cni.sh
echo "Running shell-test.sh"
/test.sh

test-install-cni: container
echo "Testing install-cni.sh"
docker run \
-i \
--rm \
-v $$(pwd)/shell-test.sh:/test.sh \
-v $$(pwd)/test.out:/host/etc/cni/net.d \
-v $$(pwd)/testdata/token:/var/run/secrets/kubernetes.io/serviceaccount/token \
-v $$(pwd):/src \
--workdir /src \
--env HTTP_PROXY="$(HTTP_PROXY)" \
--env HTTPS_PROXY="$(HTTPS_PROXY)" \
$(REGISTRY)/$(BINS):$(TAG) \
/test.sh
/src/test-install-cni.sh

test: # @HELP runs tests
test: test-inotify test-shell test-install-cni

lint: # @HELP runs lint
lint:
Expand Down
Loading