Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/e2e-tests-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
- run: pnpm install
- name: Pull/Build Docker Containers Necessary for Running E2E Tests
run: docker compose --env-file ./config/env.development up -d ${{ env.DOCKER_CONTAINERS }}
- name: Wait for Postgres and Login containers to become fully ready
run: pnpx -y wait-on -t 60000 tcp:5432 http://localhost:8081/simplesaml
- name: Apply database migrations
run: pnpm db:migrate
- run: pnpm jest:e2e
119 changes: 6 additions & 113 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/api/feed-discovery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
},
"devDependencies": {
"@senecacdot/eslint-config-telescope": "1.1.0",
"eslint": "7.32.0",
"nock": "13.2.4",
"nodemon": "2.0.15",
"supertest": "6.1.6"
Expand Down
44 changes: 12 additions & 32 deletions src/api/sso/jest.config.e2e.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,14 @@
// eslint-disable-next-line
const { waitForPostgres } = require('@jcoreio/wait-for-postgres');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this dependency now then?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I did


const baseConfig = require('../../../jest.config.base');

module.exports = async () => {
try {
console.log('Waiting for Supabase postgres container to become ready...');
await waitForPostgres({
host: 'localhost',
user: 'postgres',
password: process.env.POSTGRES_PASSWORD,
database: 'postgres',
timeout: 60 * 1000,
});
} catch (err) {
console.warn('Unable to connect to postgres container');
throw err;
}

console.log('Supabase postgres container ready.');
return {
...baseConfig,
rootDir: '../../..',
testMatch: ['<rootDir>/src/api/sso/test/e2e/**/*.test.js'],
collectCoverageFrom: ['<rootDir>/src/api/sso/src/**/*.js'],
// We use jest-playwright to do browser tests, https://github.com/playwright-community/jest-playwright
// See the jest-playwright config in the Telescope root ./jest-playwright.config.js
preset: 'jest-playwright-preset',
// Try reducing the number of tests that can run at once down to 1
maxConcurrency: 1,
maxWorkers: 1,
};
};
module.exports = () => ({
...baseConfig,
rootDir: '../../..',
testMatch: ['<rootDir>/src/api/sso/test/e2e/**/*.test.js'],
collectCoverageFrom: ['<rootDir>/src/api/sso/src/**/*.js'],
// We use jest-playwright to do browser tests, https://github.com/playwright-community/jest-playwright
// See the jest-playwright config in the Telescope root ./jest-playwright.config.js
preset: 'jest-playwright-preset',
// Try reducing the number of tests that can run at once down to 1
maxConcurrency: 1,
maxWorkers: 1,
});
1 change: 0 additions & 1 deletion src/api/sso/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"node": ">=12.0.0"
},
"devDependencies": {
"@jcoreio/wait-for-postgres": "2.0.0",
"@senecacdot/eslint-config-telescope": "1.1.0",
"env-cmd": "10.1.0",
"eslint": "7.32.0",
Expand Down