Skip to content

Commit

Permalink
build: review broken CI tests (#138)
Browse files Browse the repository at this point in the history
* chore: cleanup

* build: generate screenshots on fails

* WIP: build: generate screenshots on fails

* WIP: build: generate screenshots on fails

* WIP: build: generate screenshots on fails

* build: makes build works

* build: update debug artifcats

* build: update test images for CI

* Update .gitignore to exclude report image files

Added patterns to ignore .webp files alongside .png for reports. This ensures consistency in ignoring generated report files across formats. Helps maintain a cleaner working directory.
  • Loading branch information
pftg authored Dec 20, 2024
1 parent 17c050c commit ac76bb7
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 4 deletions.
9 changes: 8 additions & 1 deletion .github/actions/setup-ruby-and-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@ runs:
bundler-cache: true
cache-version: ${{ inputs.ruby-cache-version }}-v1

- run: sudo apt-get -qq update
shell: bash

- name: Install and cache vips
if: ${{ inputs.cache-apt-packages == 'true' }}
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libvips libglib2.0-0 libglib2.0-dev libwebp-dev libvips42 libpng-dev
version: tests-v1
version: tests-v2

# fallback if cache version is outdated
- run: sudo apt-get -qq install libvips
shell: bash
9 changes: 7 additions & 2 deletions .github/actions/upload-screenshots/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ runs:
using: 'composite'
steps:
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ inputs.name }}
name: ${{ inputs.name }}-diffs
retention-days: 1
path: |
test/fixtures/app/doc/screenshots/
- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}-capybara-fails
retention-days: 1
path: |
tmp/capybara/screenshots-diffs/
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:


- uses: ./.github/actions/upload-screenshots
if: failure()
with:
name: base-screenshots

Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
/tmp/
/vendor/sigs/

# Ignore report files
*.attempt_*.png
*.diff.png
*.base.png

*.attempt_*.webp
*.diff.webp
*.base.webp
2 changes: 1 addition & 1 deletion test/capybara/screenshot/diff_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_screenshot_section_is_prepended

test "screenshot" do
screenshot_group "screenshot"
screenshot "a"
assert_matches_screenshot "a"
end

test "succeed on screenshot diff when fail_on_difference is false" do
Expand Down
Binary file modified test/fixtures/app/doc/screenshots/linux/cuprite/index-cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/app/doc/screenshots/linux/cuprite/index-vips.webp
Binary file not shown.
Binary file modified test/fixtures/app/doc/screenshots/linux/cuprite/index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ac76bb7

Please sign in to comment.