From 7c2b9b3b3ac1f28f13e4f433fc347117712d7a69 Mon Sep 17 00:00:00 2001 From: Avi Deitcher Date: Mon, 24 Oct 2022 12:50:28 +0300 Subject: [PATCH] move rtf commands from GHA into make test; remove unused artifacts Signed-off-by: Avi Deitcher --- .github/workflows/ci.yml | 20 +++++--------------- Makefile | 8 ++++---- test/Makefile | 20 +++++--------------- 3 files changed, 14 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 589712de3..e6ebfa0ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -174,9 +174,7 @@ jobs: ${{ runner.os }}-linuxkit- - name: Run Tests - run: | - cd test - rtf -l build -v run -x linuxkit.packages + run: make test TEST_SUITE=linuxkit.packages test_kernel: name: Kernel Tests @@ -220,9 +218,7 @@ jobs: /usr/local/bin/linuxkit version - name: Run Tests - run: | - cd test - rtf -l build -v run -x linuxkit.kernel + run: make test TEST_SUITE=linuxkit.kernel test_linuxkit: name: LinuxKit Build Tests @@ -266,9 +262,7 @@ jobs: /usr/local/bin/linuxkit version - name: Run Tests - run: | - cd test - rtf -l build -v run -x linuxkit.build + run: make test TEST_SUITE=linuxkit.build test_platforms: name: Platform Tests @@ -312,9 +306,7 @@ jobs: /usr/local/bin/linuxkit version - name: Run Tests - run: | - cd test - rtf -l build -v run -x linuxkit.platforms + run: make test TEST_SUITE=linuxkit.platforms test_security: name: Security Tests @@ -358,6 +350,4 @@ jobs: /usr/local/bin/linuxkit version - name: Run Tests - run: | - cd test - rtf -l build -v run -x linuxkit.security + run: make test TEST_SUITE=linuxkit.security diff --git a/Makefile b/Makefile index 678f4f309..1f018648b 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ VERSION="v0.8+" +# test suite to run, blank for all +TEST_SUITE ?= + GO_COMPILE=linuxkit/go-compile:7b1f5a37d2a93cd4a9aa2a87db264d8145944006 ifeq ($(OS),Windows_NT) @@ -78,10 +81,7 @@ sign: .PHONY: test test: - $(MAKE) -C test - -.PHONY: collect-artifacts -collect-artifacts: artifacts/test.img.tar.gz artifacts/test-ltp.img.tar.gz + $(MAKE) -C test TEST_SUITE=$(TEST_SUITE) .PHONY: ci ci-tag ci-pr ci: test-cross diff --git a/test/Makefile b/test/Makefile index 96edb2e19..15b206c11 100644 --- a/test/Makefile +++ b/test/Makefile @@ -7,6 +7,8 @@ all: check-deps test-pr ltp LINUXKIT:=$(shell command -v linuxkit 2> /dev/null) RTF:=$(shell command -v rtf 2> /dev/null) +# test suite to run, blank for all +TEST_SUITE ?= .PHONY: check-deps check-deps: @@ -18,17 +20,6 @@ ifndef RTF endif -# TODO: Remove this section once we no longer depend on this in CI -### ------- -# Currently the linuxkit-ci runs GCP tests outside of rtf and expects some -# files in ../artifacts. This hacky target puts them there until -# the CI can use rtf for running GCP tests -gcp-hack: ../artifacts/test.img.tar.gz -../artifacts/test.img.tar.gz: - rm -rf ../artifacts - mkdir -p ../artifacts - $(LINUXKIT) build -format gcp -pull -name ../artifacts/test hack/test.yml - define check_test_log @cat $1 |grep -q 'test suite PASSED' endef @@ -42,8 +33,7 @@ ltp: $(LINUXKIT) test-ltp.img.tar.gz $(call check_test_log, test-ltp.log) ### ------ -test: gcp-hack - @rtf -l build -v run -x +test: + @rtf -l build -v run -x $(TEST_SUITE) -test-pr: gcp-hack - @rtf -l build -v run -x +test-pr: test