Skip to content

Commit

Permalink
Merge pull request #3858 from deitch/makefile-rtf-tests
Browse files Browse the repository at this point in the history
move rtf commands from GHA into make test; remove unused artifacts
  • Loading branch information
rn committed Oct 24, 2022
2 parents 25c8e68 + 7c2b9b3 commit 5200e52
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 34 deletions.
20 changes: 5 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand Down
20 changes: 5 additions & 15 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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

0 comments on commit 5200e52

Please sign in to comment.