Skip to content

[Visual Test] Label preflight prevents screenshot capture on run #26 #942

Description

@MichaelFisher1997

Workflow run

https://github.com/OpenStaticFish/ZigCraft/actions/runs/29478947848

Scheduled visual-test run #26 on commit 8e8eee20390193f2d4d8ecfb62f7144fdd54f8de.

Failure evidence

The requested build-output.log is not present in the workspace. The GitHub run is still in progress in the failure-diagnosis step, so the raw job log is not yet downloadable; however, the job step metadata identifies the failure boundary:

Ensure visual-test label exists  failure
Setup Lavapipe Vulkan            skipped
Run menu screenshot capture      skipped
Check screenshot exists          success (screenshot_exists=false)
Check build log exists           success (exists=false)
Upload build log artifact        skipped

The same unchanged shell path has previously emitted this duplicate-label error:

label with name "run-visual-test" already exists; use `--force` to update its color and description
##[error]Process completed with exit code 1.

The local Weston log confirms the compositor started normally and was stopped by cleanup after the preflight failure:

[07:12:39.203] Command line: weston --socket=headless --backend=headless-backend.so --width=1280 --height=720
[07:12:39.209] Output 'headless' enabled with head(s) headless
[07:12:42.484] caught signal 15

There are no Vulkan instance/device, swapchain, shader, staging-buffer, fence, image-write, panic, or segfault errors for this run because the game command never started.

Diagnosis

The failure originates in the Ensure visual-test label exists shell step in .github/workflows/visual-test.yml:55-69, specifically the second guard at lines 62-65:

if ! gh label list --json name --jq '.[].name' | grep -q '^run-visual-test$'; then
  gh label create "run-visual-test" \
    --description "Run deterministic visual regression workflow on a PR" \
    --color "E06C75"
fi

The repository currently has 41 labels. Running the exact unbounded check returns only 30 labels and does not include the existing run-visual-test label, while the same command with --limit 100 returns all 41 and does include it. The guard therefore treats an existing label as absent and gh label create exits non-zero on the duplicate. Since the step fails, all subsequent non-always() steps—including Lavapipe setup and screenshot capture—are skipped.

build-output.log is correctly absent: .github/actions/run-with-log/action.yml:22-34 creates it only when the skipped screenshot step runs. This is a CI workflow failure, not an engine failure.

The inspected engine paths are downstream and were not exercised:

  • modules/engine-graphics/src/vulkan/rhi_init_deinit.zig:26-43 initializes Vulkan and the swapchain.
  • modules/engine-graphics/src/vulkan_swapchain.zig:127-174 creates the headless offscreen transfer-source image.
  • src/game/app.zig:268-276 selects the menu screenshot mode, and src/game/app.zig:492-565 counts frames and requests capture.
  • modules/game-ui/src/screens/home.zig:33-41 initializes the HomeScreen preview.
  • modules/engine-graphics/src/rhi_vulkan.zig:415-420 forwards capture to the Vulkan screenshot implementation.
  • modules/engine-graphics/src/vulkan/screenshot.zig:24-86 validates and queues the readback.

None of these functions ran in this workflow attempt.

There is also a stale prompt/workflow inconsistency: .github/prompts/visual-test-diagnose.md:7-9 describes screenshot.ppm, while .github/workflows/visual-test.yml:73-81 currently requests screenshot.png. The screenshot implementation accepts PNG but not PPM (modules/engine-graphics/src/vulkan/screenshot.zig:39-40 and :262-267); that is a separate issue and was not reached here.

Suggested fix

Fetch enough labels before testing for existence:

- name: Ensure visual-test label exists
  run: |
    if ! gh label list --limit 100 --json name --jq '.[].name' | grep -q '^visual-test$'; then
      gh label create "visual-test" \
        --description "Issues from automated visual regression tests" \
        --color "E06C75"
    fi
    if ! gh label list --limit 100 --json name --jq '.[].name' | grep -q '^run-visual-test$'; then
      gh label create "run-visual-test" \
        --description "Run deterministic visual regression workflow on a PR" \
        --color "E06C75"
    fi

Alternatively, make label maintenance idempotent with gh label create ... --force, or remove this setup step because both labels already exist. After fixing the preflight, rerun the workflow to obtain a meaningful Vulkan/screenshot result.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghotfixquestionFurther information is requestedstalevisual-testIssues from automated visual regression tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions