From 159d94d8726317c40a1b675d0adefa0984968aad Mon Sep 17 00:00:00 2001 From: Marius Andra Date: Wed, 18 Oct 2023 17:44:21 +0200 Subject: [PATCH] =?UTF-8?q?chore(storybook):=20run=20a=20few=20times=20?= =?UTF-8?q?=C2=AF\=5F(=E3=83=84)=5F/=C2=AF=20(#18066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/storybook-chromatic.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/storybook-chromatic.yml b/.github/workflows/storybook-chromatic.yml index 19b153aa0bfda..ace0ae3e79349 100644 --- a/.github/workflows/storybook-chromatic.yml +++ b/.github/workflows/storybook-chromatic.yml @@ -129,8 +129,15 @@ jobs: - name: Serve Storybook in the background run: | - pnpm exec http-server storybook-static --port 6006 --silent & - pnpm wait-on http://127.0.0.1:6006 --timeout 60 # Wait for the server to be ready + retries=3 + while [ $retries -gt 0 ]; do + pnpm exec http-server storybook-static --port 6006 --silent & + if pnpm wait-on http://127.0.0.1:6006 --timeout 60; then + break + fi + retries=$((retries-1)) + echo "Failed to serve Storybook, retrying... ($retries retries left)" + done - name: Run @storybook/test-runner env: @@ -139,7 +146,14 @@ jobs: # Update snapshots for PRs on the main repo, verify on forks, which don't have access to PostHog Bot VARIANT: ${{ github.event.pull_request.head.repo.full_name == github.repository && 'update' || 'verify' }} run: | - pnpm test:visual-regression:stories:ci:$VARIANT --browsers ${{ matrix.browser }} --shard ${{ matrix.shard }}/$SHARD_COUNT + retries=3 + while [ $retries -gt 0 ]; do + if pnpm test:visual-regression:stories:ci:$VARIANT --browsers ${{ matrix.browser }} --shard ${{ matrix.shard }}/$SHARD_COUNT; then + break + fi + retries=$((retries-1)) + echo "Failed @storybook/test-runner, retrying... ($retries retries left)" + done - name: Run @playwright/test (legacy, Chromium-only) if: matrix.browser == 'chromium' && matrix.shard == 1