Skip to content

Commit

Permalink
workflow fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thostetler committed Oct 23, 2023
1 parent c0d73b6 commit ab3fae3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 38 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ name: End-to-end

on: [push, pull_request]

env:
BASE_CANONICAL_URL: ${{ vars.BASE_CANONICAL_URL }}
API_HOST_CLIENT: ${{ vars.API_HOST_CLIENT }}
API_HOST_SERVER: ${{ vars.API_HOST_SERVER }}
COOKIE_SECRET: ${{ secrets.COOKIE_SECRET }}
ADS_SESSION_COOKIE_NAME: ${{ vars.ADS_SESSION_COOKIE_NAME }}
SCIX_SESSION_COOKIE_NAME: ${{ vars.SCIX_SESSION_COOKIE_NAME }}

jobs:
unit-tests:
timeout-minutes: 60
Expand Down Expand Up @@ -54,6 +46,12 @@ jobs:
e2e-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
CI: true
BASE_CANONICAL_URL: ${{ vars.BASE_CANONICAL_URL }}
API_HOST_CLIENT: ${{ vars.API_HOST_CLIENT }}
API_HOST_SERVER: ${{ vars.API_HOST_SERVER }}
COOKIE_SECRET: ${{ vars.COOKIE_SECRET }}
strategy:
matrix:
node-version: [ 18 ]
Expand All @@ -78,6 +76,15 @@ jobs:
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps

- name: setup environment variables
run: |
touch .env.local
echo "CI=${{ env.CI }}" >> .env.local
echo "BASE_CANONICAL_URL=${{ env.BASE_CANONICAL_URL }}" >> .env.local
echo "API_HOST_CLIENT=${{ env.API_HOST_CLIENT }}" >> .env.local
echo "API_HOST_SERVER=${{ env.API_HOST_SERVER }}" >> .env.local
echo "COOKIE_SECRET=${{ env.COOKIE_SECRET }}" >> .env.local
- name: Run integration tests
run: pnpm integration

Expand Down
42 changes: 12 additions & 30 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
Expand Down Expand Up @@ -48,32 +42,20 @@ export default defineConfig({
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
webServer: {
command: 'pnpm run dev:mocks',
url: 'http://localhost:8000',
env: {
BASE_CANONICAL_URL: process.env.BASE_CANONICAL_URL || 'https://ui.adsabs.harvard.edu',
API_HOST_CLIENT: process.env.API_HOST_CLIENT || 'https://devapi.adsabs.harvard.edu/v1',
API_HOST_SERVER: process.env.API_HOST_SERVER || 'https://devapi.adsabs.harvard.edu/v1',
COOKIE_SECRET: process.env.COOKIE_SECRET || 'secret',
ADS_SESSION_COOKIE_NAME: process.env.ADS_SESSION_COOKIE_NAME || 'session',
SCIX_SESSION_COOKIE_NAME: process.env.SCIX_SESSION_COOKIE_NAME || 'scix_session',
},
command: 'pnpm run dev',
port: 8000,
// 5 minute timeout
timeout: 300000,
reuseExistingServer: !process.env.CI,
},
});

0 comments on commit ab3fae3

Please sign in to comment.