mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 15:51:15 -03:00
docker_run_tests.sh: stop using cmake
Use test_driver directly instead of CMake in the docker tests. Deal with the read-only "/fish-source" by exporting "CARGO_TARGET_DIR=$HOME/fish-build". It seems correct to also inject this environment variable into the interactive debugging shells. Add some logging to make this override more obvious to the user. Adopt "build_tools/check.sh", because that defines the full set of checks that we (eventually) want to run in CI. In particular, this will also run "tests/checks/po-files-up-to-date.fish" which "cargo b && cargo t && tests/test_driver.py" does not, due to the REQUIRES clause. Since most docker images have some lints/warnings today, disable those for now. Use "docker_run_tests.sh --lint" to override. The default may be changed in future.
This commit is contained in:
@@ -7,13 +7,11 @@ ENV LC_ALL=C.UTF-8
|
||||
RUN apk add --no-cache \
|
||||
bash \
|
||||
cargo \
|
||||
cmake \
|
||||
g++ \
|
||||
gettext-dev \
|
||||
git \
|
||||
libintl \
|
||||
musl-dev \
|
||||
ninja \
|
||||
pcre2-dev \
|
||||
py3-pexpect \
|
||||
python3 \
|
||||
@@ -40,4 +38,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
|
||||
@@ -8,17 +8,13 @@ RUN cd /etc/yum.repos.d/ && \
|
||||
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
|
||||
|
||||
|
||||
# install powertools to get ninja-build
|
||||
RUN dnf -y install dnf-plugins-core \
|
||||
&& dnf config-manager --set-enabled powertools \
|
||||
&& yum install --assumeyes epel-release \
|
||||
&& yum install --assumeyes \
|
||||
cargo \
|
||||
cmake \
|
||||
diffutils \
|
||||
gcc-c++ \
|
||||
git \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
openssl \
|
||||
@@ -39,4 +35,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
|
||||
@@ -5,24 +5,32 @@ set -e
|
||||
# This script is copied into the root directory of our Docker tests.
|
||||
# It is the entry point for running Docker-based tests.
|
||||
|
||||
cd ~/fish-build
|
||||
cd /fish-source
|
||||
git config --global --add safe.directory /fish-source
|
||||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug /fish-source "$@"
|
||||
|
||||
export CARGO_TARGET_DIR="$HOME"/fish-build
|
||||
|
||||
interactive_shell() {
|
||||
echo
|
||||
echo "+ export=CARGO_TARGET_DIR=$CARGO_TARGET_DIR"
|
||||
echo
|
||||
bash -i
|
||||
}
|
||||
|
||||
# Spawn a shell if FISH_RUN_SHELL_BEFORE_TESTS is set.
|
||||
if test -n "$FISH_RUN_SHELL_BEFORE_TESTS"
|
||||
then
|
||||
bash -i
|
||||
interactive_shell
|
||||
fi
|
||||
|
||||
set +e
|
||||
ninja && ninja fish_run_tests
|
||||
build_tools/check.sh
|
||||
RES=$?
|
||||
set -e
|
||||
|
||||
# Drop the user into a shell if FISH_RUN_SHELL_AFTER_TESTS is set.
|
||||
if test -n "$FISH_RUN_SHELL_AFTER_TESTS"; then
|
||||
bash -i
|
||||
interactive_shell
|
||||
fi
|
||||
|
||||
exit $RES
|
||||
|
||||
@@ -4,8 +4,9 @@ usage() {
|
||||
cat << EOF
|
||||
Usage: $(basename "$0") [--shell-before] [--shell-after] DOCKERFILE
|
||||
Options:
|
||||
--shell-before Before the tests start, run a bash shell
|
||||
--shell-after After the tests end, run a bash shell
|
||||
--shell-before Before the tests start, run a bash shell
|
||||
--shell-after After the tests end, run a bash shell
|
||||
--lint, --no-lint Enable/disable linting and failure on warnings
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
@@ -29,6 +30,12 @@ while [ $# -gt 1 ]; do
|
||||
--shell-after)
|
||||
DOCKER_EXTRA_ARGS="$DOCKER_EXTRA_ARGS --env FISH_RUN_SHELL_AFTER_TESTS=1"
|
||||
;;
|
||||
--lint)
|
||||
DOCKER_EXTRA_ARGS="$DOCKER_EXTRA_ARGS --env FISH_CHECK_LINT=true"
|
||||
;;
|
||||
--no-lint)
|
||||
DOCKER_EXTRA_ARGS="$DOCKER_EXTRA_ARGS --env FISH_CHECK_LINT=false"
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
|
||||
@@ -2,11 +2,9 @@ FROM fedora:latest
|
||||
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
|
||||
|
||||
RUN dnf install --assumeyes \
|
||||
cmake \
|
||||
diffutils \
|
||||
gcc-c++ \
|
||||
git-core \
|
||||
ninja-build \
|
||||
pcre2-devel \
|
||||
python3 \
|
||||
python3-pip \
|
||||
@@ -28,4 +26,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
|
||||
@@ -3,18 +3,15 @@ LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
|
||||
|
||||
ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV CFLAGS="-m32"
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cmake \
|
||||
g++-multilib \
|
||||
gettext \
|
||||
git \
|
||||
locales \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
@@ -38,6 +35,13 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh \
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV \
|
||||
CFLAGS=-m32 \
|
||||
PCRE2_SYS_STATIC=1 \
|
||||
FISH_CHECK_TARGET_TRIPLE=i686-unknown-linux-gnu
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD . ~/.cargo/env \
|
||||
&& rustup target add i686-unknown-linux-gnu \
|
||||
&& /fish_run_tests.sh -DFISH_USE_SYSTEM_PCRE2=OFF -DRust_CARGO_TARGET=i686-unknown-linux-gnu
|
||||
&& rustup target add ${FISH_CHECK_TARGET_TRIPLE} \
|
||||
&& /fish_run_tests.sh
|
||||
|
||||
@@ -9,13 +9,11 @@ RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cargo \
|
||||
cmake \
|
||||
clang \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
rustc \
|
||||
@@ -36,4 +34,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
|
||||
@@ -9,11 +9,9 @@ RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cargo \
|
||||
cmake \
|
||||
gettext \
|
||||
git \
|
||||
locales \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
@@ -35,4 +33,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
|
||||
@@ -9,14 +9,12 @@ RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cargo \
|
||||
cmake \
|
||||
file \
|
||||
g++ \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
@@ -38,4 +36,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
|
||||
@@ -7,13 +7,11 @@ ENV LC_ALL=C.UTF-8
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cmake \
|
||||
clang \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
sudo \
|
||||
@@ -42,12 +40,17 @@ COPY fish_run_tests.sh /
|
||||
ENV \
|
||||
RUSTFLAGS=-Zsanitizer=address \
|
||||
RUSTDOCFLAGS=-Zsanitizer=address \
|
||||
FISH_CHECK_CARGO_ARGS='-Zbuild-std --features=tsan' \
|
||||
FISH_CHECK_TARGET_TRIPLE=x86_64-unknown-linux-gnu \
|
||||
FISH_CI_SAN=1 \
|
||||
FISH_TEST_MAX_CONCURRENCY=4 \
|
||||
CC=clang \
|
||||
CXX=clang++ \
|
||||
ASAN_OPTIONS=check_initialization_order=1:detect_stack_use_after_return=1:detect_leaks=1 \
|
||||
LSAN_OPTIONS=verbosity=0:log_threads=0:use_tls=1:print_suppressions=0:suppressions=/fish-source/build_tools/lsan_suppressions.txt \
|
||||
FISH_CI_SAN=1
|
||||
LSAN_OPTIONS=verbosity=0:log_threads=0:use_tls=1:print_suppressions=0:suppressions=/fish-source/build_tools/lsan_suppressions.txt
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD . ~/.cargo/env \
|
||||
&& ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-$(cat /.llvm-version) \
|
||||
/fish_run_tests.sh -DASAN=1 -DRust_CARGO_TARGET=x86_64-unknown-linux-gnu
|
||||
&& ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-$(cat /.llvm-version) \
|
||||
&& /fish_run_tests.sh
|
||||
|
||||
@@ -7,13 +7,11 @@ ENV LC_ALL=C.UTF-8
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cmake \
|
||||
clang \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
sudo \
|
||||
@@ -39,7 +37,11 @@ COPY fish_run_tests.sh /
|
||||
ENV \
|
||||
RUSTFLAGS=-Zsanitizer=thread \
|
||||
RUSTDOCFLAGS=-Zsanitizer=thread \
|
||||
FISH_CI_SAN=1
|
||||
FISH_CHECK_CARGO_ARGS='-Zbuild-std --features=tsan' \
|
||||
FISH_CHECK_TARGET_TRIPLE=x86_64-unknown-linux-gnu \
|
||||
FISH_CI_SAN=1 \
|
||||
FISH_TEST_MAX_CONCURRENCY=4
|
||||
|
||||
CMD . ~/.cargo/env \
|
||||
&& /fish_run_tests.sh -DTSAN=1 -DRust_CARGO_TARGET=x86_64-unknown-linux-gnu
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD . ~/.cargo/env && /fish_run_tests.sh
|
||||
|
||||
@@ -8,13 +8,11 @@ RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cargo \
|
||||
cmake \
|
||||
clang \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
rustc \
|
||||
@@ -35,4 +33,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
|
||||
@@ -7,12 +7,10 @@ ENV LC_ALL=C.UTF-8
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cmake \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
tmux \
|
||||
@@ -36,5 +34,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh \
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD . ~/.cargo/env \
|
||||
&& /fish_run_tests.sh
|
||||
|
||||
Reference in New Issue
Block a user