mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
ci: Add missing "set -e" to scripts run by su.
If any shell command fails, the whole script should fail. To avoid future omissions, add this even for single-command scripts that use su with heredoc syntax, as they might be extended or copied-and-pasted. Extracted from a larger patch that wanted to use #error during compilation, leading to the diagnosis of this problem. Reviewed-by: Tristan Partin <tristan@partin.io> (earlier version) Discussion: https://postgr.es/m/DDZP25P4VZ48.3LWMZBGA1K9RH%40partin.io Backpatch-through: 15
This commit is contained in:
@@ -129,6 +129,7 @@ task:
|
|||||||
|
|
||||||
configure_script: |
|
configure_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
meson setup \
|
meson setup \
|
||||||
--buildtype=debug \
|
--buildtype=debug \
|
||||||
--auto-features=disabled \
|
--auto-features=disabled \
|
||||||
@@ -137,6 +138,7 @@ task:
|
|||||||
EOF
|
EOF
|
||||||
build_script: |
|
build_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
|
ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
|
||||||
EOF
|
EOF
|
||||||
upload_caches: ccache
|
upload_caches: ccache
|
||||||
@@ -146,6 +148,7 @@ task:
|
|||||||
# tap test that exercises both a frontend binary and the backend.
|
# tap test that exercises both a frontend binary and the backend.
|
||||||
test_minimal_script: |
|
test_minimal_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
ulimit -c unlimited
|
ulimit -c unlimited
|
||||||
meson test $MTEST_ARGS --suite setup
|
meson test $MTEST_ARGS --suite setup
|
||||||
meson test $MTEST_ARGS --num-processes ${TEST_JOBS} \
|
meson test $MTEST_ARGS --num-processes ${TEST_JOBS} \
|
||||||
@@ -229,6 +232,7 @@ task:
|
|||||||
# already takes longer than other platforms except for windows.
|
# already takes longer than other platforms except for windows.
|
||||||
configure_script: |
|
configure_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
meson setup \
|
meson setup \
|
||||||
${MESON_COMMON_PG_CONFIG_ARGS} \
|
${MESON_COMMON_PG_CONFIG_ARGS} \
|
||||||
--buildtype=debug \
|
--buildtype=debug \
|
||||||
@@ -241,6 +245,7 @@ task:
|
|||||||
|
|
||||||
test_world_script: |
|
test_world_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
ulimit -c unlimited
|
ulimit -c unlimited
|
||||||
meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
|
meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
|
||||||
EOF
|
EOF
|
||||||
@@ -265,6 +270,7 @@ task:
|
|||||||
# during upload, as it doesn't expect artifacts to change size
|
# during upload, as it doesn't expect artifacts to change size
|
||||||
stop_running_script: |
|
stop_running_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
build/tmp_install/usr/local/pgsql/bin/pg_ctl -D build/runningcheck stop || true
|
build/tmp_install/usr/local/pgsql/bin/pg_ctl -D build/runningcheck stop || true
|
||||||
EOF
|
EOF
|
||||||
<<: *on_failure_meson
|
<<: *on_failure_meson
|
||||||
@@ -361,6 +367,7 @@ task:
|
|||||||
# And other uuid options are not available on NetBSD.
|
# And other uuid options are not available on NetBSD.
|
||||||
configure_script: |
|
configure_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
meson setup \
|
meson setup \
|
||||||
${MESON_COMMON_PG_CONFIG_ARGS} \
|
${MESON_COMMON_PG_CONFIG_ARGS} \
|
||||||
--buildtype=debugoptimized \
|
--buildtype=debugoptimized \
|
||||||
@@ -374,6 +381,7 @@ task:
|
|||||||
|
|
||||||
test_world_script: |
|
test_world_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
ulimit -c unlimited
|
ulimit -c unlimited
|
||||||
# Otherwise tests will fail on OpenBSD, due to inability to start enough
|
# Otherwise tests will fail on OpenBSD, due to inability to start enough
|
||||||
# processes.
|
# processes.
|
||||||
@@ -509,6 +517,7 @@ task:
|
|||||||
# that.
|
# that.
|
||||||
configure_script: |
|
configure_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
./configure \
|
./configure \
|
||||||
--enable-cassert --enable-injection-points --enable-debug \
|
--enable-cassert --enable-injection-points --enable-debug \
|
||||||
--enable-tap-tests --enable-nls \
|
--enable-tap-tests --enable-nls \
|
||||||
@@ -525,6 +534,7 @@ task:
|
|||||||
|
|
||||||
test_world_script: |
|
test_world_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
ulimit -c unlimited # default is 0
|
ulimit -c unlimited # default is 0
|
||||||
make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS}
|
make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS}
|
||||||
EOF
|
EOF
|
||||||
@@ -548,6 +558,7 @@ task:
|
|||||||
|
|
||||||
configure_script: |
|
configure_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
meson setup \
|
meson setup \
|
||||||
${MESON_COMMON_PG_CONFIG_ARGS} \
|
${MESON_COMMON_PG_CONFIG_ARGS} \
|
||||||
--buildtype=debug \
|
--buildtype=debug \
|
||||||
@@ -559,6 +570,7 @@ task:
|
|||||||
# locally.
|
# locally.
|
||||||
configure_32_script: |
|
configure_32_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
export CC='ccache gcc -m32'
|
export CC='ccache gcc -m32'
|
||||||
meson setup \
|
meson setup \
|
||||||
${MESON_COMMON_PG_CONFIG_ARGS} \
|
${MESON_COMMON_PG_CONFIG_ARGS} \
|
||||||
@@ -571,12 +583,14 @@ task:
|
|||||||
|
|
||||||
build_script: |
|
build_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
|
ninja -C build -j${BUILD_JOBS} ${MBUILD_TARGET}
|
||||||
ninja -C build -t missingdeps
|
ninja -C build -t missingdeps
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
build_32_script: |
|
build_32_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
ninja -C build-32 -j${BUILD_JOBS} ${MBUILD_TARGET}
|
ninja -C build-32 -j${BUILD_JOBS} ${MBUILD_TARGET}
|
||||||
ninja -C build -t missingdeps
|
ninja -C build -t missingdeps
|
||||||
EOF
|
EOF
|
||||||
@@ -585,6 +599,7 @@ task:
|
|||||||
|
|
||||||
test_world_script: |
|
test_world_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
ulimit -c unlimited
|
ulimit -c unlimited
|
||||||
meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
|
meson test $MTEST_ARGS --num-processes ${TEST_JOBS}
|
||||||
EOF
|
EOF
|
||||||
@@ -597,6 +612,7 @@ task:
|
|||||||
# from C, prevent that with PYTHONCOERCECLOCALE.
|
# from C, prevent that with PYTHONCOERCECLOCALE.
|
||||||
test_world_32_script: |
|
test_world_32_script: |
|
||||||
su postgres <<-EOF
|
su postgres <<-EOF
|
||||||
|
set -e
|
||||||
ulimit -c unlimited
|
ulimit -c unlimited
|
||||||
PYTHONCOERCECLOCALE=0 LANG=C meson test $MTEST_ARGS -C build-32 --num-processes ${TEST_JOBS}
|
PYTHONCOERCECLOCALE=0 LANG=C meson test $MTEST_ARGS -C build-32 --num-processes ${TEST_JOBS}
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user