Skip to content
Merged
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
23 changes: 22 additions & 1 deletion .github/workflows/build-notebooks-TEMPLATE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -633,14 +633,35 @@ jobs:
# https://playwright.dev/docs/ci
# https://playwright.dev/docs/docker
# opendatahub-io/notebooks#3965: podman storage is configured to have sufficient disk space
- name: Run Playwright tests
# Build the same image as .github/workflows/build-browser-tests.yaml so codeserver
# Playwright runs use baked-in deps (pnpm + Playwright) from tests/browser/Dockerfile.
# Backport of opendatahub-io/notebooks#4096: playwright-test requires playwright-image;
# without this step PLAYWRIGHT_IMAGE is empty and `podman inspect ''` fails with
# "json: cannot unmarshal array into Go value of type define.InspectContainerData".
- name: Build browser tests image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed: this step's build invocation (podman build --build-arg PLAYWRIGHT_VERSION=... -t localhost/workbench-images-tests:ci -f tests/browser/Dockerfile tests/browser) matches build-browser-tests.yaml and the equivalent step in rhoai-3.5's template byte-for-byte. scripts/get_playwright_version.py and tests/browser/Dockerfile both exist on this branch.

id: browser-tests-image
if: ${{ !cancelled() && contains(inputs.target, 'codeserver') && steps.make-target.outcome == 'success' }}
run: |
set -Eeuxo pipefail
IMAGE="localhost/workbench-images-tests:ci"
PLAYWRIGHT_VERSION=$(python3 scripts/get_playwright_version.py tests/browser/package.json5)
podman build \
--build-arg "PLAYWRIGHT_VERSION=${PLAYWRIGHT_VERSION}" \
-t "${IMAGE}" \
-f tests/browser/Dockerfile \
tests/browser
echo "image=${IMAGE}" >> "$GITHUB_OUTPUT"

- name: Run Playwright tests
if: ${{ !cancelled() && contains(inputs.target, 'codeserver') && steps.make-target.outcome == 'success' && steps.browser-tests-image.outcome == 'success' }}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good belt-and-suspenders guard: gating on steps.browser-tests-image.outcome == 'success' in addition to the existing contains(inputs.target, 'codeserver') check ensures Run Playwright tests never executes with an empty playwright-image — which was the root cause of the podman inspect '' failure this PR fixes.

uses: ./.github/actions/playwright-test
with:
test-target: ${{ steps.calculated_vars.outputs.OUTPUT_IMAGE }}
playwright-image: ${{ steps.browser-tests-image.outputs.image }}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: playwright-image is required: true on .github/actions/playwright-test/action.yml since #2545, so this input was indeed missing before this fix. No other callers of this composite action in the repo were left unpatched (checked).

podman-socket: /var/run/podman/podman.sock
upload-report: ${{ fromJson(inputs.github).event_name == 'pull_request' }}
artifact-name: "${{ inputs.target }}_${{ steps.calculated_vars.outputs.BUILD_TYPE }}_${{ steps.calculated_vars.outputs.SANITIZED_PLATFORM }}_playwright-report"
junit-artifact-file: "${{ inputs.target }}_${{ steps.calculated_vars.outputs.BUILD_TYPE }}_${{ steps.calculated_vars.outputs.SANITIZED_PLATFORM }}_playwright-junit.xml"
grep-pattern: '@codeserver'

# endregion
Expand Down
Loading