Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .github/workflows/build_container-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ on:
- main
- develop
paths:
- ./Dockerfile.tests
- ./tests/Pipfile.lock
- Dockerfile.tests
- test/Pipfile
- test/Pipfile.lock
- .github/workflows/build_container-tests.yml

workflow_dispatch:

Expand All @@ -27,23 +29,23 @@ jobs:
# used for tagging the container with the current date down to the seconds
# since we have so many changes down to the seconds was required. Example: 2022-09-08T05_42_23-04_00
- id: date
run: echo "::set-output name=date_fmt::$(date -Isec | tr ':' '_' | tr '+' '-' )"
run: echo "date_fmt=$(date -Isec | tr ':' '_' | tr '+' '-' )" >> "$GITHUB_OUTPUT"
# the username for the quay registry, since it can be derived from the quay secret's robot username
- id: registry_user
run: echo "::set-output name=username::$(cut -d '+' -f 1 <<< ${{ secrets.REGISTRY_USER }})"
run: echo "username=$(cut -d '+' -f 1 <<< ${{ secrets.REGISTRY_USER }})" >> "$GITHUB_OUTPUT"
- id: current_branch
run: echo "::set-output name=current_branch::$( [ "${GITHUB_REF_NAME}" != "main" ] && echo "-${GITHUB_REF_NAME:-}" )"
run: echo "current_branch=$( [ "${GITHUB_REF_NAME}" != "main" ] && echo "-${GITHUB_REF_NAME:-}" )" >> "$GITHUB_OUTPUT"

tests:
runs-on: ubuntu-latest
needs: env_setup
# location where the credentials are stored for quay
environment: production_containers
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v7
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
uses: redhat-actions/buildah-build@v3
with:
image: jb_web_container
# tagging with 2 different tags, this will let us have a consistent target of prod-latest or tests_web-latest,
Expand All @@ -55,7 +57,7 @@ jobs:

- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
uses: redhat-actions/push-to-registry@v3
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile.tests
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# using v1.25.2-jammy because it's the only version which has
# python3.10, and is latest version (python verison pinned in the test/Pipfile as well (make sure to change there as well))
FROM mcr.microsoft.com/playwright/python:v1.50.0-jammy
# python version pinned in test/Pipfile as well (noble image ships python3.12)
FROM mcr.microsoft.com/playwright/python:v1.64.1-noble

# Rollback and pin version as there is a bug in the l
RUN pip install pipenv==2023.7.23
# image runs as root by design; silence pip's root and upgrade notices
ENV PIP_ROOT_USER_ACTION=ignore PIP_DISABLE_PIP_VERSION_CHECK=1
RUN pip install pipenv==2026.10.5

CMD [ "--base-url", "http://localhost:1313", "-m", "not periodic" ]
ENTRYPOINT [ "pytest" ]
Expand Down
16 changes: 9 additions & 7 deletions test/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ name = "pypi"

[packages]
# pinning playwright version
pytest-playwright = "0.7.0"
playwright = "1.50.0"
pytest-metadata = "*"
# base-url extra: pytest-playwright's built-in base_url fallback triggers a pytest 9 deprecation warning
pytest-playwright = {version = "==0.10.0", extras = ["base-url"]}
pytest-base-url = "==2.1.0"
playwright = "==1.64.1"
pytest-metadata = "==3.1.1"
# allows parallelism to happen: https://playwright.dev/python/docs/test-runners#parallelism-running-multiple-tests-at-once
pytest-xdist = "*"
pytest-xdist = "==3.8.0"

[dev-packages]
# code formatter
black = "*"
black = "==26.10.1"
# code linter
pylint = "*"
pylint = "==4.1.3"

[requires]
python_version = "3.10"
python_version = "3.12"
Loading
Loading