Skip to content

Commit

Permalink
test: break out unit test and run early in GH actions
Browse files Browse the repository at this point in the history
Break out unit tests to separate make target as they don't require all
the built code and infrastructure that the normal tests does.

Run the unit tests early in the Github action stage. They don't
require a full build. This will give early feedback to the users.

Signed-off-by: Richard Alpe <[email protected]>
  • Loading branch information
rical committed Nov 29, 2023
1 parent e1d687a commit 1a561cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'true'

- name: Unit Test
working-directory: ${{ github.workspace }}
run: |
echo "workspace: ${{ github.workspace }} pwd: $PWD"
make test-unit
- name: Set Build Variables
id: vars
run: |
Expand Down
9 changes: 7 additions & 2 deletions board/x86_64/board.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test-dir := $(BR2_EXTERNAL_INFIX_PATH)/test
INFIX_TESTS ?= $(test-dir)/case/all-repo.yaml $(test-dir)/case/all-unit.yaml \
$(test-dir)/case/all.yaml
UNIT_TESTS ?= $(test-dir)/case/all-repo.yaml $(test-dir)/case/all-unit.yaml
INFIX_TESTS ?= $(test-dir)/case/all.yaml

test-env = $(test-dir)/env \
-f $(BINARIES_DIR)/infix-x86_64.img \
Expand All @@ -12,6 +12,11 @@ test-env-run = $(call test-env,-C -t $(BINARIES_DIR)/qemu.dot,$(1))

.PHONY: test-%

test-unit:
$(call test-env-qeneth,\
$(BR2_EXTERNAL_INFIX_PATH)/9pm/9pm.py \
$(UNIT_TESTS))

test-qeneth:
$(call test-env-qeneth,\
$(BR2_EXTERNAL_INFIX_PATH)/9pm/9pm.py \
Expand Down

0 comments on commit 1a561cb

Please sign in to comment.