util/testing: Allow jenkins builders to skip testing areas

With the addition of the clang tests, the jenkins builds are taking a
really long time to run the tests.  This change allows the
"what-jenkins-does" build to be split into separate builds on jenkins.

Additionally, some jenkins builds like coverity don't need (or want)
to build clang or even the linters.

Update help with the variables.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: I0f8ac68c1bc8f8ff9be62d80db850355e742ee74
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69495
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Martin Roth 2022-11-12 21:40:04 -07:00 committed by Martin L Roth
parent b5e9946227
commit 6202fbbe90
1 changed files with 18 additions and 8 deletions

View File

@ -3,13 +3,15 @@
test-help help:: test-help help::
@echo '*** coreboot test targets ***' @echo '*** coreboot test targets ***'
@echo ' what-jenkins-does - Run platform build tests with junit output' @echo ' what-jenkins-does - Run platform build tests with junit output'
@echo ' lint / lint-stable - run coreboot lint tools (all / minimal)' @echo ' Skip tests by setting env vars JENKINS_SKIP_x_TESTS'
@echo ' test-basic - Run stardard build tests. All expected to pass.' @echo ' to 'y' where x is: CLANG, GCC, LINT, TOOL, or UNIT'
@echo ' test-lint - basic: Run stable and extended lint tests.' @echo ' lint / lint-stable - Run coreboot lint tools (all / minimal)'
@echo ' test-tools - basic: Tests a basic list of tools.' @echo ' test-basic - Run standard build tests. All expected to pass.'
@echo ' test-abuild - basic: Builds all platforms' @echo ' test-lint - Basic: Run stable and extended lint tests.'
@echo ' test-payloads - basic: Builds internal payloads' @echo ' test-tools - Basic: Tests a basic list of tools.'
@echo ' test-cleanup - basic: Cleans coreboot directories' @echo ' test-abuild - Basic: Builds all platforms'
@echo ' test-payloads - Basic: Builds internal payloads'
@echo ' test-cleanup - Basic: Cleans coreboot directories'
@echo @echo
# junit.xml is a helper target to wrap builds that don't create junit.xml output # junit.xml is a helper target to wrap builds that don't create junit.xml output
@ -95,12 +97,16 @@ endif
cd 3rdparty/intel-sec-tools/ ; go mod vendor cd 3rdparty/intel-sec-tools/ ; go mod vendor
cd util/goswid ; go mod vendor cd util/goswid ; go mod vendor
$(MAKE) test-abuild $(MAKE) test-abuild
ifneq ($(JENKINS_SKIP_TOOL_TESTS),y)
$(MAKE) test-tools $(MAKE) test-tools
endif
ifneq ($(JENKINS_SKIP_UNIT_TESTS),y)
+$(MAKE) junit.xml-unit-tests COV=1 +$(MAKE) junit.xml-unit-tests COV=1
+(cd payloads/libpayload; unset COREBOOT_BUILD_DIR; $(MAKE) junit.xml-unit-tests COV=1) +(cd payloads/libpayload; unset COREBOOT_BUILD_DIR; $(MAKE) junit.xml-unit-tests COV=1)
+(cd payloads/libpayload; unset COREBOOT_BUILD_DIR; $(MAKE) coverage-report COV=1) +(cd payloads/libpayload; unset COREBOOT_BUILD_DIR; $(MAKE) coverage-report COV=1)
+$(MAKE) coverage-report JUNIT_OUTPUT=y COV=1 +$(MAKE) coverage-report JUNIT_OUTPUT=y COV=1
find . -name 'tests.info' -exec cat {} + >$(COREBOOT_BUILD_DIR)/coverage.info find . -name 'tests.info' -exec cat {} + >$(COREBOOT_BUILD_DIR)/coverage.info
endif
test-basic: test-lint test-tools test-abuild test-payloads test-cleanup test-basic: test-lint test-tools test-abuild test-payloads test-cleanup
@ -110,10 +116,14 @@ test-lint:
test-abuild: test-abuild:
NAME=scanbuild; SCANBUILD_ARGS='-k -plist-html -maxloop 10' util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) -scan-build --target EMULATION_QEMU_X86_Q35 --exitcode --name $${NAME} NAME=scanbuild; SCANBUILD_ARGS='-k -plist-html -maxloop 10' util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) -scan-build --target EMULATION_QEMU_X86_Q35 --exitcode --name $${NAME}
ifneq ($(JENKINS_SKIP_GCC_TESTS),y)
NAME=gcc-chromeos; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) -x --name $${NAME} NAME=gcc-chromeos; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) -x --name $${NAME}
NAME=gcc; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) --name $${NAME} NAME=gcc; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) --name $${NAME}
endif
ifneq ($(JENKINS_SKIP_CLANG_TESTS),y)
NAME=clang-chromeos; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) -L -x --name $${NAME} NAME=clang-chromeos; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) -L -x --name $${NAME}
NAME=clang; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) -L --name $${NAME} NAME=clang; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) -L --name $${NAME}
endif
test-payloads: test-payloads:
$(MAKE) -C payloads/libpayload test-configs -j $(CPUS) V=$(V) Q=$(Q) MFLAGS= MAKEFLAGS= $(if $(TEST_NOCCACHE),,CONFIG_LP_CCACHE=y) $(MAKE) -C payloads/libpayload test-configs -j $(CPUS) V=$(V) Q=$(Q) MFLAGS= MAKEFLAGS= $(if $(TEST_NOCCACHE),,CONFIG_LP_CCACHE=y)