Skip to content

Commit

Permalink
Updated workflow to continue-on-error on tests for rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
ad956 committed May 26, 2024
1 parent a27fe82 commit d5946c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ jobs:
retention-days: 30
- name: Rollback Deployment on Test Failure
if: ${{ failure() }}
run: vercel rollback ${{ steps.deploy.outputs.vercel-deployment-url }} --token=${{ secrets.VERCEL_TOKEN }}
run: |
DEPLOYMENT_ID=$(vercel list --token=${{ secrets.VERCEL_TOKEN }} --json | jq -r '.[0].uid')
vercel --token=${{ secrets.VERCEL_TOKEN }} rollback $DEPLOYMENT_ID
2 changes: 1 addition & 1 deletion tests/intro.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test("Displays the landing page correctly and triggers rollback on failure", asy
await page.goto(`${baseURL}`);

// Intentionally fail the test by expecting a non-existent element
await expect(page.getByText("NonExistentElement")).toBeVisible(); // This will intentionally fail the test
// await expect(page.getByText("NonExistentElement")).toBeVisible(); // This will intentionally fail the test

// If the test reaches this point, the intentional failure did not occur
// This line should not be reached if the test fails as expected
Expand Down

0 comments on commit d5946c7

Please sign in to comment.