Skip to content

Conversation

@OutlawAndy
Copy link
Member

@OutlawAndy OutlawAndy commented Jan 22, 2026

Motivation

Ultimately, I just want to able to both use rails tmp:clear to delete local capybara artifacts & also have them accessible to me via download when CI fails. We could accomplish this a number of ways, so feel to propose another if you prefer.

Why

While recent versions of Capybara seem to use tmp/capybara as the directory where they store screenshots, the Rails tmp:clear command will not clear this directory. For that reason, I prefer to configure capybara to save failure screenshots into the traditional directory which rails expects:

Capybara.configure do |config|
  config.test_id = 'data-testid'
  config.automatic_label_click = true
  config.save_path = './tmp/screenshots'
end

Changes

  • Add input for failure-screenshot-dir with default value set to tmp/capybara
  • pass this input as the input into actions/upload-artifact
  • Update README to demo usage of new input
  • General README improvements. see line comments

Screenshots

Code 01 22 2026@10 32 08

@OutlawAndy OutlawAndy self-assigned this Jan 27, 2026
@OutlawAndy OutlawAndy force-pushed the failure-screenshots-path branch from dde4194 to 079e443 Compare January 28, 2026 00:43
runs-on: blacksmith-8vcpu-ubuntu-2204
timeout-minutes: 5
needs: compile_assets
if: always() && (needs.compile_assets.outputs.cache-hit == 'true' || (needs.compile_assets.result == 'success'))
Copy link
Member Author

Choose a reason for hiding this comment

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

  1. use of always() doesn't make sense with a conditional.
  2. checking cache-hit is unnecessary, because the compile_assets action will report 'success' so long as it did not fail, whether it actually compiled or there was a cache hit.
  3. if is redundant because compile_assets is specified as a "need" for the system-test job. i.e. system-test will be skipped if compile_assets fails.

reference: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idneeds

@OutlawAndy OutlawAndy merged commit 6fe5aea into main Jan 28, 2026
@OutlawAndy OutlawAndy deleted the failure-screenshots-path branch January 28, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants