Skip to content

Commit c14140a

Browse files
committed
test: relocate logic for creating test-report.pdf from workflow
It should be possible to create test reports manually, so logically the GitHub workflow should call a make rule in test.mk Untested: branding, or any case where Infix is used as a BR2_EXTERNAL Signed-off-by: Joachim Wiberg <[email protected]>
1 parent 9fe661f commit c14140a

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ env:
3939
jobs:
4040
test:
4141
name: Regression Test ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.name || inputs.name }} ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target || inputs.target }}
42-
runs-on: [ self-hosted, regression ]
42+
runs-on: [self-hosted, regression]
4343
steps:
4444
- name: Checkout infix repo
4545
uses: actions/checkout@v4
@@ -87,7 +87,7 @@ jobs:
8787
fi
8888
make test
8989
90-
- name: Publish Test Result for ${{ env.TARGET }}
90+
- name: Publish Test Result for ${{ env.TARGET }}
9191
# Ensure this runs even if Regression Test fails
9292
if: always()
9393
run: cat $TEST_PATH/.log/last/result-gh.md >> $GITHUB_STEP_SUMMARY
@@ -96,15 +96,10 @@ jobs:
9696
# Ensure this runs even if Regression Test fails
9797
if: always()
9898
run: |
99-
asciidoctor-pdf \
100-
--theme $TEST_PATH/9pm/report/theme.yml \
101-
-a pdf-fontsdir=$TEST_PATH/9pm/report/fonts \
102-
$TEST_PATH/.log/last/report.adoc \
103-
-o $TEST_PATH/.log/last/report.pdf
99+
make test-dir="$(pwd)/$TEST_PATH" test-report
104100
105101
- name: Upload Test Report as Artifact
106102
uses: actions/upload-artifact@v4
107103
with:
108104
name: test-report
109-
path: ${{ env.TEST_PATH }}/.log/last/report.pdf
110-
105+
path: output/images/test-report.pdf

test/test.mk

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
base-dir := $(lastword $(subst :, ,$(BR2_EXTERNAL)))
2-
test-dir := $(BR2_EXTERNAL_INFIX_PATH)/test
2+
test-dir ?= $(BR2_EXTERNAL_INFIX_PATH)/test
33
ninepm := $(BR2_EXTERNAL_INFIX_PATH)/test/9pm/9pm.py
4+
NINEPM_PROJ_CONF ?= $(BR2_EXTERNAL_INFIX_PATH)/test/9pm-proj.yaml
45
spec-dir := $(test-dir)/spec
5-
test-specification := $(O)/images/test-specification.pdf
6-
6+
test-specification := $(BINARIES_DIR)/test-specification.pdf
7+
test-report := $(BINARIES_DIR)/test-report.pdf
78
UNIT_TESTS ?= $(test-dir)/case/all-repo.yaml $(test-dir)/case/all-unit.yaml
89
TESTS ?= $(test-dir)/case/all.yaml
910

@@ -33,9 +34,18 @@ test-sh:
3334

3435
test-spec:
3536
@esc_infix_name="$(echo $(INFIX_NAME) | sed 's/\//\\\//g')"; \
36-
sed 's/{REPLACE}/$(subst ",,$(esc_infix_name)) $(INFIX_VERSION)/' $(spec-dir)/Readme.adoc.in > $(spec-dir)/Readme.adoc
37+
sed 's/{REPLACE}/$(subst ",,$(esc_infix_name)) $(INFIX_VERSION)/' \
38+
$(spec-dir)/Readme.adoc.in > $(spec-dir)/Readme.adoc
3739
@$(spec-dir)/generate_spec.py -s $(test-dir)/case/all.yaml -r $(BR2_EXTERNAL_INFIX_PATH)
38-
@asciidoctor-pdf --failure-level INFO --theme $(spec-dir)/theme.yml -a pdf-fontsdir=$(spec-dir)/fonts -o $(test-specification) $(spec-dir)/Readme.adoc
40+
@asciidoctor-pdf --failure-level INFO --theme $(spec-dir)/theme.yml \
41+
-a pdf-fontsdir=$(spec-dir)/fonts \
42+
-o $(test-specification) $(spec-dir)/Readme.adoc
43+
44+
test-report:
45+
asciidoctor-pdf --theme $(spec-dir)/theme.yml \
46+
-a logo="image:$(LOGO)" \
47+
-a pdf-fontsdir=$(spec-dir)/fonts \
48+
-o $(test-report) $(test-dir)/.log/last/report.adoc
3949

4050
# Unit tests run with random (-r) hostname and container name to
4151
# prevent race conditions when running in CI environments.

0 commit comments

Comments
 (0)