Skip to content

Commit

Permalink
Rework for Jenkins testing
Browse files Browse the repository at this point in the history
- Move venv creation back to Jenkinsfile, and create it inside the
  workspace
- Remove native.ini for Linux and use it on MacOS only
- Update Jenkins install step to use setup-flags.sh.
  • Loading branch information
bmerry committed Dec 4, 2024
1 parent 2bf3f2e commit a1fe8cf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
4 changes: 0 additions & 4 deletions .ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,3 @@ COPY install-sys-pkgs.sh .
# jq and iproute2 are used to find the interface IPv4 address
RUN apt-get update && apt-get -y --no-install-recommends install libpython3-dev python3-venv jq iproute2
RUN ./install-sys-pkgs.sh

RUN python3 -m venv /venv
RUN chown -R +1000:+1000 /venv
ENV PATH=/venv/bin:$PATH
5 changes: 1 addition & 4 deletions .ci/install-sys-pkgs.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/bin/bash
set -e

# Create this just for consistency with the MacOS native file
mkdir -p $HOME/.local/share/meson/native
touch $HOME/.local/share/meson/native/ci.ini

if [ "$(uname -s)" = "Linux" ]; then
SUDO=sudo
if [ `id -u` -eq 0 ]; then
Expand All @@ -31,6 +27,7 @@ else
# On Apple Silicon, homebrew is installed in /opt/homebrew, but the
# toolchains are not configured to find things there.
prefix="$(brew --prefix)"
mkdir -p $HOME/.local/share/meson/native
cat > $HOME/.local/share/meson/native/ci.ini <<EOF
[properties]
boost_root = '$prefix'
Expand Down
3 changes: 2 additions & 1 deletion .ci/setup-flags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# include them because the detection code is broken.

flags=(
"--native-file=ci.ini"
"-Dwerror=true"
"-Dtools=enabled"
"-Dpcap=enabled"
Expand All @@ -27,6 +26,8 @@ if [ "$(uname)" = "Linux" ]; then
"-Dposix_semaphores=enabled"
"-Deventfd=enabled"
)
else
flags+=("--native-file=ci.ini")
fi

case "$(arch)" in
Expand Down
15 changes: 5 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,20 @@ pipeline {
stages {
stage('Install dependencies') {
steps {
sh '.ci/py-requirements.sh'

sh 'python3 -m venv ./.venv'
sh 'PATH="$PWD/.venv/bin:$PATH" .ci/py-requirements.sh'
}
}
stage('Install Python package') {
steps {
sh '''PATH="/venv/bin:$PATH" pip install -v \
--config-settings=setup-args=--native-file=ci.ini \
--config-settings=setup-args=-Dibv=enabled \
--config-settings=setup-args=-Dibv_hw_rate_limit=enabled \
--config-settings=setup-args=-Dmlx5dv=enabled \
.'''
sh 'PATH="$PWD/.venv/bin:$PATH" pip install -v $(.ci/setup-flags.sh --python) .'
}
}
stage('Run tests') {
steps {
sh 'PATH="/venv/bin:$PATH" .ci/py-tests-jenkins.sh'
sh 'PATH="$PWD/.venv/bin:$PATH" .ci/py-tests-jenkins.sh'
junit 'results.xml'
sh 'PATH="/venv/bin:$PATH" .ci/py-tests-shutdown.sh'
sh 'PATH="$PWD/.venv/bin:$PATH" .ci/py-tests-shutdown.sh'
}
}
}
Expand Down

0 comments on commit a1fe8cf

Please sign in to comment.