Skip to content

Commit

Permalink
Merge pull request #279 from jingyuanliang/init-test
Browse files Browse the repository at this point in the history
Split `make test` in `script/` for faster partial testing during dev
  • Loading branch information
google-oss-prow[bot] authored Feb 27, 2024
2 parents 578be24 + c2f3ddb commit 9d0920a
Showing 1 changed file with 17 additions and 11 deletions.
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

0 comments on commit 9d0920a

Please sign in to comment.