Skip to content

Commit

Permalink
chore: Switch to Lost Pixel OSS to allow smoke testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nickevansuk committed Aug 9, 2024
1 parent 509120a commit 6501b9f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,18 @@ jobs:
run: npm test
- name: Start server (in background)
run: npm run start &
# Within a PR, Lost Pixel Platform generates separate GitHub Status Checks (which are set to 'required' in the Branch protection rule),
# so we don't need to also fail the build. For a build on the master branch, we do want to fail the build if there are differences.
- name: ${{ github.event_name != 'pull_request' && 'Test with' || 'Capture images for' }} Lost Pixel

- name: Test with Lost Pixel
id: lp
uses: lost-pixel/lost-pixel@v3.16.0
env:
LOST_PIXEL_API_KEY: ${{ secrets.LOST_PIXEL_API_KEY }}
LOST_PIXEL_FAIL_ON_DIFFERENCE: ${{ github.event_name != 'pull_request' }}


- name: Upload Lost Pixel artefacts
uses: actions/upload-artifact@v3
if: ${{ failure() && steps.lp.conclusion == 'failure' }}
with:
name: lost-pixel-artefacts
path: .lostpixel

deploy-site:
needs: [test-site, test-models, test-data-model-validator, test-rpde-validator]
if: ${{ github.ref == 'refs/heads/master' }}
Expand Down Expand Up @@ -112,11 +116,17 @@ jobs:
git push heroku master -f
- name: Smoke test with Lost Pixel
id: lp
uses: lost-pixel/lost-pixel@v3.16.0
env:
LOST_PIXEL_API_KEY: ${{ secrets.LOST_PIXEL_API_KEY }}
LOST_PIXEL_BASE_URL: https://validator-staging.openactive.io
LOST_PIXEL_FAIL_ON_DIFFERENCE: true

- name: Upload Lost Pixel artefacts
uses: actions/upload-artifact@v3
if: ${{ failure() && steps.lp.conclusion == 'failure' }}
with:
name: lost-pixel-artefacts
path: .lostpixel

promote-site:
needs: deploy-site
Expand Down
4 changes: 1 addition & 3 deletions lostpixel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ module.exports = {
baseUrl: process.env.LOST_PIXEL_BASE_URL || 'http://172.17.0.1:8080',
},
lostPixelProjectId: 'clzitt4s52b6dlcoguswodrsj',
failOnDifference: process.env.LOST_PIXEL_FAIL_ON_DIFFERENCE === 'true' || false,
failOnDifference: true,
threshold: 0,
setPendingStatusCheck: process.env.LOST_PIXEL_FAIL_ON_DIFFERENCE !== 'true',
apiKey: process.env.LOST_PIXEL_API_KEY,
};

0 comments on commit 6501b9f

Please sign in to comment.