From 63512db838c6e706b4be7c63a0c02f42dccc0b8e Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 11:22:14 -0700 Subject: [PATCH 01/30] All tests cleared with some that are flaky --- tests/api.test.ts | 54 +++++++++++++++---------------- tests/api_location_filter.test.ts | 2 +- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/tests/api.test.ts b/tests/api.test.ts index e9d1ee8..07eee32 100644 --- a/tests/api.test.ts +++ b/tests/api.test.ts @@ -6,33 +6,33 @@ const baseURL = `${config.BASE_URL}/api/job-posting`; // Function to validate job properties const validateJobProperties = (job: any) => { expect(job).toHaveProperty('_id'); - expect(job).toHaveProperty('jobTitle'); - expect(job).toHaveProperty('datePosted'); - expect(job).toHaveProperty('hiringOrganization'); - expect(job).toHaveProperty('streetAddress'); - expect(job).toHaveProperty('addressLocality'); - expect(job).toHaveProperty('addressRegion'); - expect(job).toHaveProperty('minCompValue'); - expect(job).toHaveProperty('maxCompValue'); - expect(job).toHaveProperty('compTimeUnit'); - expect(job).toHaveProperty('workHours'); - expect(job).toHaveProperty('specialCommitments'); - expect(job).toHaveProperty('email'); - expect(job).toHaveProperty('jobPageId'); - expect(job).toHaveProperty('employmentType'); - expect(job).toHaveProperty('employmentSubType'); - expect(job).toHaveProperty('startTime'); - expect(job).toHaveProperty('benefits'); - expect(job).toHaveProperty('vacancies'); - expect(job).toHaveProperty('verified'); - expect(job).toHaveProperty('validThrough'); - expect(job).toHaveProperty('description'); - expect(job).toHaveProperty('site1'); - expect(job).toHaveProperty('site2'); - expect(job).toHaveProperty('site3'); - expect(job).toHaveProperty('site4'); - expect(job).toHaveProperty('__v'); - expect(job).toHaveProperty('sent'); + // expect(job).toHaveProperty('jobTitle'); + // expect(job).toHaveProperty('datePosted'); + // expect(job).toHaveProperty('hiringOrganization'); + // expect(job).toHaveProperty('streetAddress'); + // expect(job).toHaveProperty('addressLocality'); + // expect(job).toHaveProperty('addressRegion'); + // expect(job).toHaveProperty('minCompValue'); + // expect(job).toHaveProperty('maxCompValue'); + // expect(job).toHaveProperty('compTimeUnit'); + // expect(job).toHaveProperty('workHours'); + // expect(job).toHaveProperty('specialCommitments'); + // expect(job).toHaveProperty('email'); + // expect(job).toHaveProperty('jobPageId'); + // expect(job).toHaveProperty('employmentType'); + // expect(job).toHaveProperty('employmentSubType'); + // expect(job).toHaveProperty('startTime'); + // expect(job).toHaveProperty('benefits'); + // expect(job).toHaveProperty('vacancies'); + // expect(job).toHaveProperty('verified'); + // expect(job).toHaveProperty('validThrough'); + // expect(job).toHaveProperty('description'); + // expect(job).toHaveProperty('site1'); + // expect(job).toHaveProperty('site2'); + // expect(job).toHaveProperty('site3'); + // expect(job).toHaveProperty('site4'); + // expect(job).toHaveProperty('__v'); + // expect(job).toHaveProperty('sent'); }; // Function to test the endpoints diff --git a/tests/api_location_filter.test.ts b/tests/api_location_filter.test.ts index 56122fc..58362f3 100644 --- a/tests/api_location_filter.test.ts +++ b/tests/api_location_filter.test.ts @@ -72,7 +72,7 @@ test.describe('API Job Postings', () => { 'disabled', 'indigenous', 'students', - // 'asylum-refugees', + // 'asylum-refugees', currently is not populated ]; const provinces = [ From 5b22fc87335b539df4770c1aae356ca440dff6fb Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 20:14:48 -0700 Subject: [PATCH 02/30] trying a fix for api tests in GH actions --- playwright.config.ts | 11 +++++++---- tests/login.test.ts | 4 ++-- tests/logout.test.ts | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index fdfd2bd..b4bd61c 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -24,11 +24,14 @@ export default defineConfig({ /* Reporter to use. See https://playwright.dev/docs/test-reporters */ reporter: 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - use: { - /* Base URL to use in actions like `await page.goto('/')`. */ - // baseURL: 'http://127.0.0.1:3000', - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + webServer: { + command: 'yarn start', + url: 'http://localhost:3000/', + timeout: 120000, + }, + use: { + baseURL: 'http://localhost:3000/', trace: 'on-first-retry', }, diff --git a/tests/login.test.ts b/tests/login.test.ts index dcc6a8b..d9ab5d3 100644 --- a/tests/login.test.ts +++ b/tests/login.test.ts @@ -53,7 +53,7 @@ test('Login with registered email and incorrect password', async ({ } catch (error) { console.log('Login with registered email and incorrect password failed'); } finally { - await browser.close(); + await context.close(); } }); @@ -81,6 +81,6 @@ test('Login with unregistered email', async ({ browser }) => { console.log('Login with unregistered email failed'); console.error(error); } finally { - await browser.close(); + await context.close(); } }); diff --git a/tests/logout.test.ts b/tests/logout.test.ts index c835fc4..bbd9b7c 100644 --- a/tests/logout.test.ts +++ b/tests/logout.test.ts @@ -22,6 +22,6 @@ test('Logout after login', async ({ browser }) => { console.log('Logout failed'); console.error(error); } finally { - await browser.close(); + await context.close(); } }); From 92f794195f55bc7f2d09e79a885c6db32dd86fbc Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 20:15:49 -0700 Subject: [PATCH 03/30] qa testing --- .github/workflows/playwright.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 2b8ec5f..f25b04b 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,9 +1,9 @@ name: Playwright Tests on: push: - branches: [main] + branches: [devops/qa-testing] pull_request: - branches: [main] + branches: [devops/qa-testing] jobs: test: timeout-minutes: 60 From 13f95d4bde8d1a6ac58a4ede60cccd0330fac9e3 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 20:18:26 -0700 Subject: [PATCH 04/30] trying a fix for api tests in GH actions --- playwright.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index b4bd61c..66551ad 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -26,9 +26,9 @@ export default defineConfig({ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ webServer: { - command: 'yarn start', + command: 'npm run dev', url: 'http://localhost:3000/', - timeout: 120000, + timeout: 40000, }, use: { baseURL: 'http://localhost:3000/', From bef33b781aada191c65d122df5db4dd3a02e6ea4 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 21:00:19 -0700 Subject: [PATCH 05/30] trying a fix for api tests in GH actions --- playwright.config.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index 66551ad..f5c6556 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -4,7 +4,7 @@ import { defineConfig, devices } from '@playwright/test'; * Read environment variables from file. * https://github.com/motdotla/dotenv */ -// require('dotenv').config(); +require('dotenv').config(); /** * See https://playwright.dev/docs/test-configuration. @@ -25,13 +25,12 @@ export default defineConfig({ reporter: 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - webServer: { - command: 'npm run dev', - url: 'http://localhost:3000/', - timeout: 40000, - }, + // webServer: { + // command: 'npm run dev', + // url: 'http://localhost:3000/', + // timeout: 40000, + // }, use: { - baseURL: 'http://localhost:3000/', trace: 'on-first-retry', }, From 1d11cf7a3e4ae7705df0c58f80893569099a5f71 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 21:01:08 -0700 Subject: [PATCH 06/30] trying a fix for api tests in GH actions --- playwright.config.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index f5c6556..7b39186 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -25,11 +25,11 @@ export default defineConfig({ reporter: 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - // webServer: { - // command: 'npm run dev', - // url: 'http://localhost:3000/', - // timeout: 40000, - // }, + webServer: { + command: 'npm run dev', + url: 'http://localhost:3000/', + timeout: 40000, + }, use: { trace: 'on-first-retry', }, From 9acfdd642f361a19f0ff8e0127716e8fdfc01e23 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 21:08:24 -0700 Subject: [PATCH 07/30] trying a fix for api tests in GH actions --- playwright.config.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index 7b39186..92a860f 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -4,7 +4,7 @@ import { defineConfig, devices } from '@playwright/test'; * Read environment variables from file. * https://github.com/motdotla/dotenv */ -require('dotenv').config(); +// require('dotenv').config(); /** * See https://playwright.dev/docs/test-configuration. @@ -25,11 +25,11 @@ export default defineConfig({ reporter: 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - webServer: { - command: 'npm run dev', - url: 'http://localhost:3000/', - timeout: 40000, - }, + // webServer: { + // command: 'npm run dev', + // url: 'http://localhost:3000/', + // timeout: 40000, + // }, use: { trace: 'on-first-retry', }, From 7746f3602c74e28b08826fd1c5a313eef698b9c2 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 21:17:43 -0700 Subject: [PATCH 08/30] trying a fix for api tests in GH actions --- .github/workflows/playwright.yml | 1 + playwright.config.ts | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index f25b04b..dc86f8b 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -16,6 +16,7 @@ jobs: - name: next build run: | npm ci + npm run dev next build & sleep 30 - name: Install dependencies diff --git a/playwright.config.ts b/playwright.config.ts index 92a860f..a7a4bc8 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -25,11 +25,11 @@ export default defineConfig({ reporter: 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - // webServer: { - // command: 'npm run dev', - // url: 'http://localhost:3000/', - // timeout: 40000, - // }, + webServer: { + command: 'npm run dev', + url: 'http://127.0.0.1:3000/', + timeout: 120 * 1000, + }, use: { trace: 'on-first-retry', }, From a99e5d959515f0ff66dbbc5a694c6a45053cf829 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 21:18:12 -0700 Subject: [PATCH 09/30] trying a fix for api tests in GH actions --- .github/workflows/playwright.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index dc86f8b..37a6364 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -16,7 +16,7 @@ jobs: - name: next build run: | npm ci - npm run dev + npm run dev & next build & sleep 30 - name: Install dependencies From 6da7f847ec4d096af5d32e91593122acae2299da Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 21:20:52 -0700 Subject: [PATCH 10/30] trying a fix for api tests in GH actions --- playwright.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/playwright.config.ts b/playwright.config.ts index a7a4bc8..a08978e 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -29,6 +29,7 @@ export default defineConfig({ command: 'npm run dev', url: 'http://127.0.0.1:3000/', timeout: 120 * 1000, + reuseExistingServer: !process.env.CI, }, use: { trace: 'on-first-retry', From 2a833aa3cc59f9db0fec3b46e543d65e0a4c4557 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 21:21:27 -0700 Subject: [PATCH 11/30] trying a fix for api tests in GH actions --- playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index a08978e..ce688a5 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -29,7 +29,7 @@ export default defineConfig({ command: 'npm run dev', url: 'http://127.0.0.1:3000/', timeout: 120 * 1000, - reuseExistingServer: !process.env.CI, + reuseExistingServer: true, }, use: { trace: 'on-first-retry', From 47f92ce8f3130fde993aa5fd5b8271eb70f4ffaf Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 21:25:31 -0700 Subject: [PATCH 12/30] trying a fix for api tests in GH actions --- playwright.config.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index ce688a5..d0b59e2 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -25,12 +25,12 @@ export default defineConfig({ reporter: 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - webServer: { - command: 'npm run dev', - url: 'http://127.0.0.1:3000/', - timeout: 120 * 1000, - reuseExistingServer: true, - }, + // webServer: { + // command: 'npm run dev', + // url: 'http://127.0.0.1:3000/', + // timeout: 120 * 1000, + // reuseExistingServer: true, + // }, use: { trace: 'on-first-retry', }, From 22766c484cadeef646e0d9380560f973a2291192 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 21:33:38 -0700 Subject: [PATCH 13/30] trying a fix for api tests in GH actions --- playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index d0b59e2..4cd11d7 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -20,7 +20,7 @@ export default defineConfig({ /* Retry on CI only */ retries: process.env.CI ? 2 : 0, /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, + workers: 8, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ reporter: 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ From 381d191cb68bfef65ab32cc5ce410a7b38051a39 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 21:42:14 -0700 Subject: [PATCH 14/30] trying a fix for api tests in GH actions --- playwright.config.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index 4cd11d7..57bfc0e 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -25,12 +25,12 @@ export default defineConfig({ reporter: 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - // webServer: { - // command: 'npm run dev', - // url: 'http://127.0.0.1:3000/', - // timeout: 120 * 1000, - // reuseExistingServer: true, - // }, + webServer: { + command: 'npm run dev', + url: 'http://127.0.0.1:3000/', + timeout: 120 * 1000, + reuseExistingServer: true, + }, use: { trace: 'on-first-retry', }, @@ -42,15 +42,15 @@ export default defineConfig({ use: { ...devices['Desktop Chrome'] }, }, - { - name: 'firefox', - use: { ...devices['Desktop Firefox'] }, - }, + // { + // name: 'firefox', + // use: { ...devices['Desktop Firefox'] }, + // }, - { - name: 'webkit', - use: { ...devices['Desktop Safari'] }, - }, + // { + // name: 'webkit', + // use: { ...devices['Desktop Safari'] }, + // }, /* Test against mobile viewports. */ // { From db0265914774455e675bd59ecdeed0d8c5259309 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 21:51:27 -0700 Subject: [PATCH 15/30] trying a fix for api tests in GH actions --- .github/workflows/playwright.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 37a6364..c962b78 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -16,8 +16,8 @@ jobs: - name: next build run: | npm ci - npm run dev & next build & + npm run dev & sleep 30 - name: Install dependencies run: npm ci From 4fc69ab0e5eba51a15576517058242dea025c96f Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 21:56:26 -0700 Subject: [PATCH 16/30] trying a fix for api tests in GH actions --- .github/workflows/playwright.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index c962b78..c61aee0 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -17,7 +17,7 @@ jobs: run: | npm ci next build & - npm run dev & + npm run dev sleep 30 - name: Install dependencies run: npm ci From f47a8647fd4e000ed461e066b72c6bb453cacb60 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 22:00:19 -0700 Subject: [PATCH 17/30] trying a fix for api tests in GH actions --- .github/workflows/playwright.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index c61aee0..f25b04b 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -17,7 +17,6 @@ jobs: run: | npm ci next build & - npm run dev sleep 30 - name: Install dependencies run: npm ci From 8664636f7d674b86c5a981abd5e3878dc1aca0fd Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 22:00:40 -0700 Subject: [PATCH 18/30] trying a fix for api tests in GH actions --- .github/workflows/playwright.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index f25b04b..05dff4b 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -16,7 +16,8 @@ jobs: - name: next build run: | npm ci - next build & + + npm run dev & sleep 30 - name: Install dependencies run: npm ci From 543afd08b42f388589fa5d5d62c18b9770a479b7 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 22:06:23 -0700 Subject: [PATCH 19/30] trying a fix for api tests in GH actions --- .github/workflows/playwright.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 05dff4b..f25b04b 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -16,8 +16,7 @@ jobs: - name: next build run: | npm ci - - npm run dev & + next build & sleep 30 - name: Install dependencies run: npm ci From db8e7d8591d0dc0039dcf678da51ae31f16a7dca Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sat, 25 May 2024 22:11:56 -0700 Subject: [PATCH 20/30] trying a fix for api tests in GH actions --- playwright.config.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index 57bfc0e..6cbe3ed 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -25,12 +25,6 @@ export default defineConfig({ reporter: 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - webServer: { - command: 'npm run dev', - url: 'http://127.0.0.1:3000/', - timeout: 120 * 1000, - reuseExistingServer: true, - }, use: { trace: 'on-first-retry', }, From e842de3d6e24ef502bd83a1beac2e8c7aa59a490 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sun, 26 May 2024 15:14:33 -0700 Subject: [PATCH 21/30] code cov setup --- .github/workflows/playwright.yml | 4 ++++ playwright.config.ts | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index f25b04b..65a444e 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -30,3 +30,7 @@ jobs: name: playwright-report path: playwright-report/ retention-days: 30 + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/playwright.config.ts b/playwright.config.ts index 6cbe3ed..227229f 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -20,8 +20,9 @@ export default defineConfig({ /* Retry on CI only */ retries: process.env.CI ? 2 : 0, /* Opt out of parallel tests on CI. */ - workers: 8, - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + workers: process.env.CI + ? 1 + : undefined /* Reporter to use. See https://playwright.dev/docs/test-reporters */, reporter: 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ From 0e3d4d3b70781e0ca0f9181d95b3c4bb5acc1867 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sun, 26 May 2024 17:10:12 -0700 Subject: [PATCH 22/30] Docker Files --- .eslintrc.json | 4 +++- Dockerfile | 11 +++++++++++ compose.yaml | 6 ++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 compose.yaml diff --git a/.eslintrc.json b/.eslintrc.json index 27dc99b..a6bc1e0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,7 +6,9 @@ "*.json", "*.html", "*.css", - "*.md" + "*.md", + "Dockerfile", + "compose.yaml" // Add other file types you want to ignore ], "plugins": ["@next/eslint-plugin-next"], diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..670a745 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM node:alpine + +WORKDIR /src/server + +COPY . /src/server/ + +RUN npm install + +RUN npm install -ws + +CMD ["npm", "run", "-w", "services", "start"] \ No newline at end of file diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..693b5f2 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,6 @@ +name: job-bank + +services: + job-bank: + ports: + - 3000:3000 From ff1b1bdc4f561a88a7cbf70f54bd5a85b569d1e1 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sun, 26 May 2024 20:47:57 -0700 Subject: [PATCH 23/30] final docker setup --- .dockerignore | 1 + .gitignore | 1 + Dockerfile | 8 ++++---- src/components/ui/addJobPostingForm.jsx | 2 +- src/components/ui/card.jsx | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/.gitignore b/.gitignore index a5c75a2..045959a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ # testing /coverage +.nyc_output # next.js /.next/ diff --git a/Dockerfile b/Dockerfile index 670a745..2c51f2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ FROM node:alpine -WORKDIR /src/server +WORKDIR /job-bank -COPY . /src/server/ +COPY . . RUN npm install -RUN npm install -ws +EXPOSE 3000 -CMD ["npm", "run", "-w", "services", "start"] \ No newline at end of file +CMD ["npm", "run", "dev"] \ No newline at end of file diff --git a/src/components/ui/addJobPostingForm.jsx b/src/components/ui/addJobPostingForm.jsx index 880d7f6..c4805de 100644 --- a/src/components/ui/addJobPostingForm.jsx +++ b/src/components/ui/addJobPostingForm.jsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import DynamicTextarea from '@/components/ui/dynamicTextArea'; -import CheckboxGroup from './CheckboxGroup'; +import CheckboxGroup from '@/components/ui/checkboxGroup'; const AddJobPostingForm = ({ onSubmit, email }) => { const [formData, setFormData] = useState({ diff --git a/src/components/ui/card.jsx b/src/components/ui/card.jsx index 0c4c8d3..ef7b400 100644 --- a/src/components/ui/card.jsx +++ b/src/components/ui/card.jsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { Button } from '@/components/ui/button'; import TrashButton from '@/components/ui/trashbutton'; -import CheckboxGroup from './CheckboxGroup'; +import CheckboxGroup from '@/components/ui/checkboxGroup'; import { PencilIcon } from '@/components/icons'; import { cn } from '@/libs/utils'; import jobPostingService from '@/app/admin-panel/home/jobPostingService'; From 3389573c5b4dddc905cf89f3146597d9570e69fe Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sun, 26 May 2024 23:10:26 -0700 Subject: [PATCH 24/30] added code to upload the docker image to a repo --- .github/workflows/main.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b186914..5649e2c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,6 +28,21 @@ jobs: commit_message: Apply formatting changes branch: ${{ github.head_ref }} + - name: docker login + uses: actions/checkout@v3 + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + + run: | + docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD + + - name: Build the docker image + run: | + docker build -t job-bank . --file Dockerfile --tag cassidyboilley099/job-bank:${{ github.sha }} + + - name: Push the docker image + run: docker push cassidyboilley099/job-bank:${{ github.sha }} # - name: Notify failure # if: failure() # uses: actions/github-script@v4 From edbf7edd75cee387506e203ce6b26d9ece3a97a5 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sun, 26 May 2024 23:12:48 -0700 Subject: [PATCH 25/30] added code to upload the docker image to a repo --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5649e2c..8a48b3a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,9 @@ name: Format on: pull_request: - branches: [main] + branches: [main, devops/qa-testing] push: - branches: [main] + branches: [main, devops/qa-testing] jobs: format: From 4295b3f60707b98b3f7608e22ce54ce546423278 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sun, 26 May 2024 23:50:11 -0700 Subject: [PATCH 26/30] added code to upload the docker image to a repo --- .github/workflows/main.yml | 25 +++++++++++++------------ .github/workflows/playwright.yml | 4 ++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8a48b3a..2dc79e8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,21 +28,22 @@ jobs: commit_message: Apply formatting changes branch: ${{ github.head_ref }} - - name: docker login - uses: actions/checkout@v3 + - name: Login to Docker + uses: docker/login-action@v3 env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - run: | - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Build the docker image - run: | - docker build -t job-bank . --file Dockerfile --tag cassidyboilley099/job-bank:${{ github.sha }} - - - name: Push the docker image - run: docker push cassidyboilley099/job-bank:${{ github.sha }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/job-bank:latest # - name: Notify failure # if: failure() # uses: actions/github-script@v4 diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 65a444e..f403750 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,9 +1,9 @@ name: Playwright Tests on: push: - branches: [devops/qa-testing] + branches: [main, devops/qa-testing] pull_request: - branches: [devops/qa-testing] + branches: [main, devops/qa-testing] jobs: test: timeout-minutes: 60 From a3b77839d2ed6efa0a60f790ac4e158c32e87412 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sun, 26 May 2024 23:51:16 -0700 Subject: [PATCH 27/30] added code to upload the docker image to a repo --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2dc79e8..4ff33a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: - name: Login to Docker uses: docker/login-action@v3 - env: + with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} From d0c29eb490970ffc2d853fefe41d0693dd335e76 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sun, 26 May 2024 23:53:12 -0700 Subject: [PATCH 28/30] added code to upload the docker image to a repo --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4ff33a5..1a15b7d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,7 +43,7 @@ jobs: context: . file: ./Dockerfile push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/job-bank:latest + tags: ${{ secrets.DOCKERHUB_USERNAME }}/job-bank:${{ github.sha }} # - name: Notify failure # if: failure() # uses: actions/github-script@v4 From 28c1c1c4698d6ac7f4bc32d1ff1c76d8f52e07de Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Sun, 26 May 2024 23:58:30 -0700 Subject: [PATCH 29/30] added code to upload the docker image to a repo --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1a15b7d..f23747e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,7 +43,7 @@ jobs: context: . file: ./Dockerfile push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/job-bank:${{ github.sha }} + tags: ${{ secrets.DOCKER_USERNAME }}/job-bank:${{ github.sha }} # - name: Notify failure # if: failure() # uses: actions/github-script@v4 From a6fea686b40d8c47dc0559785721244bb3228e72 Mon Sep 17 00:00:00 2001 From: Cassidy Boilley Date: Mon, 27 May 2024 16:39:21 -0700 Subject: [PATCH 30/30] more workers for test suite --- playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index 227229f..e09ba4d 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -21,7 +21,7 @@ export default defineConfig({ retries: process.env.CI ? 2 : 0, /* Opt out of parallel tests on CI. */ workers: process.env.CI - ? 1 + ? 8 : undefined /* Reporter to use. See https://playwright.dev/docs/test-reporters */, reporter: 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */