Skip to content

Commit

Permalink
Merge branch 'devops/qa-testing' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Cassidy-Boilley authored May 28, 2024
2 parents 4f994f4 + a6fea68 commit 5e24460
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 37 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -28,6 +28,22 @@ jobs:
commit_message: Apply formatting changes
branch: ${{ github.head_ref }}

- name: Login to Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/job-bank:${{ github.sha }}
# - name: Notify failure
# if: failure()
# uses: actions/github-script@v4
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Playwright Tests
on:
push:
branches: [main]
branches: [main, devops/qa-testing]
pull_request:
branches: [main]
branches: [main, devops/qa-testing]
jobs:
test:
timeout-minutes: 60
Expand All @@ -30,3 +30,7 @@ jobs:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

# testing
/coverage
.nyc_output

# next.js
/.next/
Expand Down
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:alpine

WORKDIR /job-bank

COPY . .

RUN npm install

EXPOSE 3000

CMD ["npm", "run", "dev"]
6 changes: 6 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: job-bank

services:
job-bank:
ports:
- 3000:3000
7 changes: 3 additions & 4 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ 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 */

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 */
use: {
trace: 'on-first-retry',
},

Expand Down
54 changes: 27 additions & 27 deletions tests/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/api_location_filter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ test.describe('API Job Postings', () => {
'disabled',
'indigenous',
'students',
// 'asylum-refugees',
// 'asylum-refugees', currently is not populated
];

const provinces = [
Expand Down

0 comments on commit 5e24460

Please sign in to comment.