Skip to content

Commit 74b1571

Browse files
anarazeldutow
authored andcommitted
meson: ci: ensure tests are built before running them
Meson 1.7 stopped building all the dependencies of tests as part of the default build target. But it does breaks CI because we only built the default target before running the test, and ran the tests with --no-rebuild. The simplest fix would be to remove --no-rebuild from MTEST_ARGS, but it seems better to explicitly build the test dependencies, so compiler warnings / errors are visible as part of the build step. Discussion: https://postgr.es/m/CAGECzQSvM3iSDmjF+=Kof5an6jN8UbkP_4cKKT9w6GZavmb5yQ@mail.gmail.com Backpatch: 16-, where meson was added
1 parent c0f8e77 commit 74b1571

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

.cirrus.tasks.yml

+10-7
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ env:
1717
CHECK: check-world PROVE_FLAGS=$PROVE_FLAGS
1818
CHECKFLAGS: -Otarget
1919
PROVE_FLAGS: --timer
20+
# Build test dependencies as part of the build step, to see compiler
21+
# errors/warnings in one place.
22+
MBUILD_TARGET: all testprep
2023
MTEST_ARGS: --print-errorlogs --no-rebuild -C build
2124
PGCTLTIMEOUT: 120 # avoids spurious failures during parallel tests
2225
TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
@@ -99,7 +102,7 @@ task:
99102
EOF
100103
build_script: |
101104
su postgres <<-EOF
102-
ninja -C build -j${BUILD_JOBS}
105+
ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
103106
EOF
104107
upload_caches: ccache
105108

@@ -178,7 +181,7 @@ task:
178181
-Dextra_lib_dirs=/usr/local/lib -Dextra_include_dirs=/usr/local/include/ \
179182
build
180183
EOF
181-
build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS}'
184+
build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}'
182185
upload_caches: ccache
183186

184187
test_world_script: |
@@ -380,8 +383,8 @@ task:
380383
build-32
381384
EOF
382385
383-
build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS}'
384-
build_32_script: su postgres -c 'ninja -C build-32 -j${BUILD_JOBS}'
386+
build_script: su postgres -c 'ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}'
387+
build_32_script: su postgres -c 'ninja -C build-32 -j${BUILD_JOBS} ${MBUILD_TARGET}'
385388

386389
upload_caches: ccache
387390

@@ -502,7 +505,7 @@ task:
502505
-DPG_TEST_EXTRA="$PG_TEST_EXTRA" \
503506
build
504507
505-
build_script: ninja -C build -j${BUILD_JOBS}
508+
build_script: ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
506509
upload_caches: ccache
507510

508511
test_world_script: |
@@ -575,7 +578,7 @@ task:
575578
576579
build_script: |
577580
vcvarsall x64
578-
ninja -C build
581+
ninja -C build %MBUILD_TARGET%
579582
580583
check_world_script: |
581584
vcvarsall x64
@@ -633,7 +636,7 @@ task:
633636
%BASH% -c "meson setup -Ddebug=true -Doptimization=g -Dcassert=true -Dinjection_points=true -Db_pch=true -Dnls=disabled -DTAR=%TAR% build"
634637
635638
build_script: |
636-
%BASH% -c "ninja -C build"
639+
%BASH% -c "ninja -C build ${MBUILD_TARGET}"
637640
638641
upload_caches: ccache
639642

0 commit comments

Comments
 (0)