Skip to content

Commit

Permalink
Updating test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisAlund committed Feb 15, 2024
1 parent 88e038f commit 76c05c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
- unit
- e2e
timeout-minutes: 30
env:
WEBHOOK_URL_GOOGLE_CHAT: ${{ secrets.WEBHOOK_URL_GOOGLE_CHAT }}
WEBHOOK_URL_SLACK: ${{ secrets.WEBHOOK_URL_SLACK }}
steps:
- uses: actions/checkout@v3
name: Checkout code
Expand Down Expand Up @@ -48,11 +51,6 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-

- name: Replace Webhook URLs in Test File
run: |
sed -i '' 's|WEBHOOK_URL_GOOGLE_CHAT|'"${{ secrets.WEBHOOK_URL_GOOGLE_CHAT }}"'|g' functions/test/e2e/chat.spec.ts
sed -i '' 's|WEBHOOK_URL_SLACK|'"${{ secrets.WEBHOOK_URL_SLACK }}"'|g' functions/test/e2e/chat.spec.ts
- run: yarn --cwd functions install

- run: yarn --cwd functions build
Expand Down
4 changes: 2 additions & 2 deletions functions/test/e2e/chat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { ApiService } from '../../src/services/chat.service';

describe('End to end tests', () => {
const webhooks: {[key: string]: string} = {
['Google Chat']: 'WEBHOOK_URL_GOOGLE_CHAT',
['Slack']: 'WEBHOOK_URL_SLACK',
['Google Chat']: process.env.WEBHOOK_URL_GOOGLE_CHAT ?? 'WEBHOOK_URL_GOOGLE_CHAT_NOT_SET',
['Slack']: process.env.WEBHOOK_URL_SLACK ?? 'WEBHOOK_URL_SLACK_NOT_SET',
};

before(() => {
Expand Down

0 comments on commit 76c05c7

Please sign in to comment.