From c2f3ddb1c7c4742756b82e8d7b3572f8f9de5ea8 Mon Sep 17 00:00:00 2001 From: Jingyuan Liang Date: Tue, 27 Feb 2024 19:36:10 +0000 Subject: [PATCH] Split `make test` in `script/` for faster partial testing during dev --- scripts/Makefile | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index a0ee67ccb..ad06311e6 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -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 \ @@ -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: