Skip to content

Commit 73e91a1

Browse files
authored
Add temporary metadata update step to Cypress flow (#1173)
* Add temporary metadata update step to Cypress flow Also updates baselines * Run Cypress action as root This allows us to install ExifTool. UID `1001` seemed to be used so Firefox will run, which we're not currently doing. * Run Cypress action as root * Add checkout as safe directory
1 parent 4d1e4a1 commit 73e91a1

7 files changed

+7
-2
lines changed

.github/workflows/cypress.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
container:
1313
# This must stay in sync with the image used by the test-{site}-visual scripts in package.json.
1414
image: cypress/browsers:node-20.14.0-chrome-125.0.6422.141-1-ff-126.0.1-edge-125.0.2535.85-1
15-
options: --user 1001
15+
options: --user 0
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v4
@@ -37,11 +37,16 @@ jobs:
3737
id: cypress-create-branch
3838
if: ${{ failure() }}
3939
run: |
40+
# Temporary hack to mitigate https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/issues/322
41+
apt update && apt install exiftool -y
42+
echo "%Image::ExifTool::UserDefined = ('Image::ExifTool::PNG::TextualData' => {FRSOURCE_CPVRD_V => { }});" > ~/.ExifTool_config
43+
git config --global --add safe.directory $(pwd)
44+
# Create or update VRT branch
4045
target_ref=${{ github.head_ref || github.ref_name }}
4146
update_branch_name=vrt/$target_ref
4247
git config --global user.email "[email protected]"
4348
git config --global user.name "GitHub Actions"
44-
find ./src/test/pages/__image_snapshots__ -type f -name "*.actual.png" -exec bash -c 'mv "$1" "${1/.actual./.}"' shell {} \;
49+
find ./src/test/pages/__image_snapshots__ -type f -name "*.actual.png" -exec bash -c 'exiftool -overwrite_original -FRSOURCE_CPVRD_V="1" "$1"; mv "$1" "${1/.actual./.}"' shell {} \;
4550
git fetch origin $target_ref
4651
git checkout -B $update_branch_name origin/$target_ref
4752
git commit -am "Update VRT baselines"
Loading

0 commit comments

Comments
 (0)