Skip to content

Commit

Permalink
Pass mapbox API key to test and coverage workflow (#24)
Browse files Browse the repository at this point in the history
the issue with coverage test in search-ui-react repo stems from errors caused within the visual tests from storybook due to missing mapbox API key. This is also an issue when running test workflow where mapbox related visual tests failed due to missing mapbox API key (it also failed silently / test github action "passed" when there are tests failed -- that will be address in this [item](https://yexttest.atlassian.net/browse/SLAP-2459)).

J=SLAP-2467
TEST=auto

- see that coverage GH now works as expected in this search-ui-react PR: yext/search-ui-react#339
- see that mapbox errors in test GH in search-ui-react no longer appear in this PR: yext/search-ui-react#339
  • Loading branch information
yen-tt authored Nov 18, 2022
1 parent cced072 commit a597d92
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:
secrets:
NPM_TOKEN:
required: false
MAPBOX_API_KEY:
required: false
caller_github_token:
required: true

Expand All @@ -40,6 +42,8 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm rebuild
- run: ${{ inputs.test_script }}
env:
MAPBOX_API_KEY: ${{ secrets.MAPBOX_API_KEY }}
- uses: yext/slapshot-reusable-workflows/get-coverage-percent@v1
id: parse-coverage
- run: echo base coverage is ${{ steps.parse-coverage.outputs.coverage-percent }}%
Expand All @@ -59,6 +63,8 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm rebuild
- run: ${{ inputs.test_script }}
env:
MAPBOX_API_KEY: ${{ secrets.MAPBOX_API_KEY }}
- uses: yext/slapshot-reusable-workflows/get-coverage-percent@v1
id: parse-coverage
- run: echo current coverage is ${{ steps.parse-coverage.outputs.coverage-percent }}%
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ on:
secrets:
NPM_TOKEN:
required: false

MAPBOX_API_KEY:
required: false
jobs:
tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,3 +55,5 @@ jobs:
- run: npm rebuild
- run: ${{ inputs.build_script }}
- run: ${{ inputs.test_script }}
env:
MAPBOX_API_KEY: ${{ secrets.MAPBOX_API_KEY }}

0 comments on commit a597d92

Please sign in to comment.