Skip to content

Commit

Permalink
Automate runner install/update #3918
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeauchesne committed Jan 29, 2025
1 parent 85e0541 commit 1beaf32
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
[project]
name = 'system_tests'
version = '0.0.1'
dynamic = ["dependencies"]

[tool.setuptools]
packages = ["tests", "utils", "manifests"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

[tool.pytest.ini_options]
addopts = "--json-report --json-report-indent=2 --color=yes --no-header --junitxml=reportJunit.xml -r Xf"
testpaths = [
Expand Down
5 changes: 5 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,11 @@ function main() {
run_mode='direct'
fi

# check if runner is installed and up to date
if [[ "${run_mode}" == "direct" ]] && ! is_using_nix && ! diff requirements.txt venv/requirements.txt; then
./build.sh -i runner
fi

# ensure environment
if [[ "${run_mode}" == "docker" ]] || is_using_nix; then
: # no venv needed
Expand Down
6 changes: 4 additions & 2 deletions utils/build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,11 @@ build() {
fi
fi
source venv/bin/activate
python -m pip install --upgrade pip wheel
python -m pip install --upgrade pip setuptools==75.8.0
fi
pip install -r requirements.txt
python -m pip install -e .
cp requirements.txt venv/requirements.txt


elif [[ $IMAGE_NAME == runner ]] && [[ $DOCKER_MODE == 1 ]]; then
docker buildx build \
Expand Down
4 changes: 3 additions & 1 deletion utils/build/docker/runner.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ FROM python:3.12
RUN mkdir /app
WORKDIR /app

RUN mkdir tests/ manifests/

COPY utils/build/docker/python/parametric/requirements.txt utils/build/docker/python/parametric/requirements.txt
COPY requirements.txt .
COPY pyproject.toml .
COPY build.sh .
COPY utils/build/build.sh utils/build/build.sh
RUN mkdir -p /app/utils/build/docker && ./build.sh -i runner
Expand All @@ -21,7 +24,6 @@ COPY manifests /app/manifests

# toplevel things
COPY conftest.py /app/
COPY pyproject.toml /app/
COPY run.sh /app/

CMD ./run.sh

0 comments on commit 1beaf32

Please sign in to comment.