CI/makefiles: introduce dedicated test target

Make it easy to use the same set of test flags
throughout all current and future CI builds.

Reviewed-by: Jay Satiro

Follow up to #7690
Closes #7785
This commit is contained in:
Marc Hoersken 2021-09-27 21:17:29 +02:00
parent aceff6088c
commit ab1671cafe
No known key found for this signature in database
GPG Key ID: 61E03CBED7BC859E
9 changed files with 19 additions and 9 deletions

View File

@ -199,8 +199,8 @@ stages:
- script: $(container_cmd) -l -c "cd $(echo '%cd%') && make V=1 install && PATH=/usr/bin:/bin find . -type f -path '*/.libs/*.exe' -print -execdir mv -t .. {} \;" - script: $(container_cmd) -l -c "cd $(echo '%cd%') && make V=1 install && PATH=/usr/bin:/bin find . -type f -path '*/.libs/*.exe' -print -execdir mv -t .. {} \;"
displayName: 'install' displayName: 'install'
- script: $(container_cmd) -l -c "cd $(echo '%cd%') && make V=1 test-nonflaky" - script: $(container_cmd) -l -c "cd $(echo '%cd%') && make V=1 test-ci"
displayName: 'test' displayName: 'test'
env: env:
AZURE_ACCESS_TOKEN: "$(System.AccessToken)" AZURE_ACCESS_TOKEN: "$(System.AccessToken)"
TFLAGS: "-r -rm -u !SCP $(tests)" TFLAGS: "!SCP $(tests)"

View File

@ -37,7 +37,7 @@ commands:
test: test:
steps: steps:
- run: make test-nonflaky - run: make test-ci
executors: executors:
ubuntu: ubuntu:

View File

@ -129,4 +129,4 @@ windows_task:
install_script: | install_script: |
%container_cmd% -l -c "cd $(echo '%cd%') && make V=1 install && PATH=/usr/bin:/bin find . -type f -path '*/.libs/*.exe' -print -execdir mv -t .. {} \;" %container_cmd% -l -c "cd $(echo '%cd%') && make V=1 install && PATH=/usr/bin:/bin find . -type f -path '*/.libs/*.exe' -print -execdir mv -t .. {} \;"
test_script: | test_script: |
%container_cmd% -l -c "cd $(echo '%cd%') && make V=1 TFLAGS='-r -rm -u !SCP %tests%' test-nonflaky" %container_cmd% -l -c "cd $(echo '%cd%') && make V=1 TFLAGS='!SCP %tests%' test-ci"

View File

@ -41,7 +41,7 @@ jobs:
- run: ./buildconf && LDFLAGS="-Wl,-rpath,$HOME/hyper/target/debug" ./configure --enable-warnings --enable-werror ${{ matrix.build.configure }} && make - run: ./buildconf && LDFLAGS="-Wl,-rpath,$HOME/hyper/target/debug" ./configure --enable-warnings --enable-werror ${{ matrix.build.configure }} && make
name: 'configure and build' name: 'configure and build'
- run: make test-nonflaky - run: make test-ci
name: 'test' name: 'test'
env: env:
LD_LIBRARY_PATH: $HOME/hyper/target/debug:/usr/local/lib LD_LIBRARY_PATH: $HOME/hyper/target/debug:/usr/local/lib

View File

@ -84,7 +84,7 @@ jobs:
- run: make - run: make
name: 'make' name: 'make'
- run: make test-nonflaky - run: make test-ci
name: 'test' name: 'test'
env: env:
TFLAGS: "${{ matrix.build.tflags }} ~1452" TFLAGS: "${{ matrix.build.tflags }} ~1452"

View File

@ -248,6 +248,9 @@ test-event:
test-am: test-am:
@(cd tests; $(MAKE) all am-test) @(cd tests; $(MAKE) all am-test)
test-ci:
@(cd tests; $(MAKE) all ci-test)
endif endif
examples: examples:

View File

@ -299,11 +299,11 @@ build_script:
test_script: test_script:
- if %TESTING%==ON ( - if %TESTING%==ON (
if %BUILD_SYSTEM%==CMake ( if %BUILD_SYSTEM%==CMake (
set TFLAGS=-r -rm -u %DISABLED_TESTS% && set TFLAGS=%DISABLED_TESTS% &&
cmake --build . --config %PRJ_CFG% --target test-nonflaky cmake --build . --config %PRJ_CFG% --target test-ci
) else ( ) else (
if %BUILD_SYSTEM%==autotools ( if %BUILD_SYSTEM%==autotools (
bash.exe -e -l -c "cd /c/projects/curl && make V=1 TFLAGS='-r -rm -u %DISABLED_TESTS%' test-nonflaky" bash.exe -e -l -c "cd /c/projects/curl && make V=1 TFLAGS='%DISABLED_TESTS%' test-ci"
) else ( ) else (
bash.exe -e -l -c "cd /c/projects/curl/tests && ./runtests.pl -a -p !flaky -r -rm -u %DISABLED_TESTS%" bash.exe -e -l -c "cd /c/projects/curl/tests && ./runtests.pl -a -p !flaky -r -rm -u %DISABLED_TESTS%"
)) ))

View File

@ -46,5 +46,6 @@ add_runtests(test-am "-a -am")
add_runtests(test-full "-a -p -r") add_runtests(test-full "-a -p -r")
# !flaky means that it'll skip all tests using the flaky keyword # !flaky means that it'll skip all tests using the flaky keyword
add_runtests(test-nonflaky "-a -p !flaky") add_runtests(test-nonflaky "-a -p !flaky")
add_runtests(test-ci "-a -p !flaky -r -rm -u")
add_runtests(test-torture "-a -t") add_runtests(test-torture "-a -t")
add_runtests(test-event "-a -e") add_runtests(test-event "-a -e")

View File

@ -71,6 +71,9 @@ TEST_E = -a -e
# !flaky means that it'll skip all tests using the flaky keyword # !flaky means that it'll skip all tests using the flaky keyword
TEST_NF = -a -p !flaky TEST_NF = -a -p !flaky
# special CI target derived from nonflaky with CI-specific flags
TEST_CI = $(TEST_NF) -r -rm -u
endif endif
# make sure that PERL is pointing to an executable # make sure that PERL is pointing to an executable
@ -86,6 +89,9 @@ quiet-test: perlcheck all
am-test: perlcheck all am-test: perlcheck all
$(TEST) $(TEST_AM) $(TFLAGS) $(TEST) $(TEST_AM) $(TFLAGS)
ci-test: perlcheck all
$(TEST) $(TEST_CI) $(TFLAGS)
full-test: perlcheck all full-test: perlcheck all
$(TEST) $(TEST_F) $(TFLAGS) $(TEST) $(TEST_F) $(TFLAGS)