From 1d8fd6beb0fca37c4eef9b8076ae3653b9129e7f Mon Sep 17 00:00:00 2001 From: Axel Bocciarelli Date: Mon, 15 Jan 2024 14:35:59 +0100 Subject: [PATCH 1/2] Link to artifact URL from PR with visual diffing fails --- .github/workflows/approve-snapshots.yml | 2 +- .github/workflows/lint-test.yml | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/approve-snapshots.yml b/.github/workflows/approve-snapshots.yml index 498840fb2..8b286cb4c 100644 --- a/.github/workflows/approve-snapshots.yml +++ b/.github/workflows/approve-snapshots.yml @@ -60,7 +60,7 @@ jobs: CYPRESS_TAKE_SNAPSHOTS: true - name: Upload debug screenshots and diffs on failure 🖼️ - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: cypress diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 0959b3e4e..891e0ff18 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -157,10 +157,32 @@ jobs: CYPRESS_TAKE_SNAPSHOTS: true - name: Upload debug screenshots and diffs on failure 🖼️ - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() + id: uploadSnapshots with: name: cypress path: | cypress/debug/ cypress/snapshots/**/__diff_output__/ + + outputs: + snapshotsUrl: ${{ steps.uploadSnapshots.outputs.artifact-url }} + + report: + runs-on: ubuntu-latest + needs: e2e + if: github.event_name == 'pull_request' && needs.e2e.outputs.snapshotsUrl + steps: + - name: Provide download link in PR + uses: peter-evans/create-or-update-comment@v3 + with: + issue-number: github.event.pull_request.number + body: | + #### :flags: Visual changes detected! + + Please [download and review the snapshot diffs](${{ needs.e2e.outputs.snapshotsUrl }}). If the changes are expected: + + 1. Comment with `/approve`. + 1. Wait for the CI workflow _Approve snapshots_ to open a PR called _Update Cypress reference snapshots_. + 1. Review and merge the updated snapshots into this PR, ideally with a rebase. From 480b28760d676c37c4838517d4e57fd7c93eeea7 Mon Sep 17 00:00:00 2001 From: Axel Bocciarelli Date: Mon, 15 Jan 2024 14:11:42 +0100 Subject: [PATCH 2/2] Fail visual diffing for testing purposes --- packages/app/src/providers/mock/mock-file.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/providers/mock/mock-file.ts b/packages/app/src/providers/mock/mock-file.ts index a7c02e93b..f879af31b 100644 --- a/packages/app/src/providers/mock/mock-file.ts +++ b/packages/app/src/providers/mock/mock-file.ts @@ -134,7 +134,7 @@ export function makeMockFile(): GroupWithChildren { nxData('nx_data', { signal: array('twoD'), silxStyle: { signalScaleType: ScaleType.SymLog }, - title: scalar('title', 'NeXus 2D'), + title: scalar('title', 'NEXUS 2D'), }), nxGroup('absolute_default_path', 'NXentry', { defaultPath: '/nexus_entry/nx_process/nx_data',