Skip to content

Commit

Permalink
Separate puppeteer packages and upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
nickevansuk committed Aug 11, 2023
1 parent 57aea05 commit 395cf60
Show file tree
Hide file tree
Showing 57 changed files with 14,104 additions and 22,011 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/code-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Code Tests

on:
push:
branches: [ master2 ]
branches: [ feature/docker-and-package-upgrades ]
pull_request:
branches: [ master2 ]
branches: [ master ]

jobs:
build:
Expand All @@ -14,10 +14,10 @@ jobs:
steps:
- name: Checkout OpenActive Test Suite
uses: actions/checkout@v2
- name: Setup Node.js 14.x
- name: Setup Node.js 18.17.1
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.17.1
- name: Install OpenActive Test Suite
run: npm install
- name: Run Checks on the Code (Test the Tests!)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create-data-model-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
ref: master
path: openactive-test-suite

- name: Setup Node.js 14.x
- name: Setup Node.js 18.17.1
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.17.1

- name: Update openactive-integration-tests with latest data-models and validators
run: npm install @openactive/data-models@latest @openactive/data-model-validator@latest --save
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Reference Implementation

on:
push:
branches: [ feature/docker ]
branches: [ feature/docker-and-package-upgrades ]

jobs:
build-and-push-docker-image:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/reference-implementation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Reference Implementation

on:
push:
branches: [ master2 ]
branches: [ feature/docker-and-package-upgrades ]
pull_request:
branches: [ master2 ]
branches: [ master ]

jobs:
tests:
Expand Down Expand Up @@ -48,10 +48,10 @@ jobs:
with:
dotnet-version: 3.1.419

- name: Setup Node.js 14.x
- name: Setup Node.js 18.17.1
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.17.1

- name: Install OpenActive.Server.NET dependencies
run: dotnet restore ./server/
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
deploy-output:
needs: tests
# Master branch only
if: ${{ github.ref == 'refs/heads/master' }}
# if: ${{ github.ref == 'refs/heads/master' }}

runs-on: ubuntu-latest

Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
COPY --chown=node:node package*.json /openactive-test-suite/
COPY --chown=node:node packages/openactive-broker-microservice/package*.json /openactive-test-suite/packages/openactive-broker-microservice/
COPY --chown=node:node packages/openactive-integration-tests/package*.json /openactive-test-suite/packages/openactive-integration-tests/
COPY --chown=node:node packages/openactive-openid-test-client/package*.json /openactive-test-suite/packages/openactive-openid-test-client/
COPY --chown=node:node packages/openactive-openid-client/package*.json /openactive-test-suite/packages/openactive-openid-client/
COPY --chown=node:node packages/openactive-openid-browser-automation/package*.json /openactive-test-suite/packages/openactive-openid-browser-automation/
COPY --chown=node:node packages/openactive-openid-test-cli/package*.json /openactive-test-suite/packages/openactive-openid-test-cli/
COPY --chown=node:node packages/test-interface-criteria/package*.json /openactive-test-suite/packages/test-interface-criteria/

# Build the app
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ To join the conversation, we're on the [OpenActive Slack](https://slack.openacti
The general aim of this project is to allow end to end testing of the various flows and failure states of the Open Booking API.

Running `npm start` in the root will run the OpenActive Test Suite, which is actually comprised of three packages:
* [OpenID Test Client](./packages/openactive-openid-test-client): this connects to the target Open Booking API's OpenID Provider. This allows the Broker and Integration tests to authorize with the implementation
* [Broker Microservice](./packages/openactive-broker-microservice/): this sits in between the test suite and the target Open Booking API implementation. This allows the integration tests to watch for changes to the various RPDE feeds.
* [Integration Tests](./packages/openactive-integration-tests): this performs automated tests against the API.
* [OpenID Client](./packages/openactive-openid-client), [OpenID Browser Automation](./packages/openactive-openid-browser-automation) and [OpenID Test CLI](./packages/openactive-openid-test-cli): together these connect to the target Open Booking API's OpenID Provider. This allows the Broker and Integration tests to authorize with the implementation

# Usage

Running `npm start` will orchestrate running the [OpenID Test Client](./packages/openactive-openid-test-client/), [Broker Microservice](./packages/openactive-broker-microservice/) and the [Integration Tests](./packages/openactive-integration-tests/) in order to test your Open Booking API implementation.
Running `npm start` will orchestrate running the [OpenID Client](./packages/openactive-openid-client), [OpenID Browser Automation](./packages/openactive-openid-browser-automation), [Broker Microservice](./packages/openactive-broker-microservice/) and the [Integration Tests](./packages/openactive-integration-tests/) in order to test your Open Booking API implementation.

Note that the implementation under test will need to implement the [OpenActive Test Interface](https://openactive.io/test-interface/) to run in controlled mode, and for selected tests.

Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
"start-tests": "cd packages/openactive-integration-tests && npm start",
"install-broker": "cd packages/openactive-broker-microservice && npm install",
"install-interface-criteria": "cd packages/test-interface-criteria && npm install",
"install-openid-client": "cd packages/openactive-openid-test-client && npm install",
"install-openid-client": "cd packages/openactive-openid-client && npm install",
"install-openid-browser-automation": "cd packages/openactive-openid-browser-automation && npm install",
"install-openid-test-cli": "cd packages/openactive-openid-test-cli && npm install",
"install-tests": "cd packages/openactive-integration-tests && npm install",
"install": "npm run install-broker && npm run install-tests && npm run install-interface-criteria && npm run install-openid-client",
"install": "npm run install-interface-criteria && npm run install-openid-client && npm run install-openid-browser-automation && npm run install-openid-test-cli && npm run install-broker && npm run install-tests",
"test-broker": "cd packages/openactive-broker-microservice && npm test",
"test-interface-criteria": "cd packages/test-interface-criteria && npm test",
"test-tests": "cd packages/openactive-integration-tests && npm test",
"test-openid-client": "cd packages/openactive-openid-test-client && npm test",
"test-openid-client": "(cd packages/openactive-openid-client && npm test); (cd packages/openactive-openid-browser-automation && npm test); (cd packages/openactive-openid-test-cli && npm test)",
"test": "npm run test-broker && npm run test-interface-criteria && npm run test-openid-client && npm run test-tests",
"lint-fix-broker": "cd packages/openactive-broker-microservice && npm run lint-fix",
"lint-fix-interface-criteria": "cd packages/test-interface-criteria && npm run lint-fix",
Expand All @@ -33,10 +35,10 @@
"gen-interface-criteria-types": "cd packages/test-interface-criteria && npm run gen-types",
"git-add-newly-generated-interface-criteria-types": "git add packages/test-interface-criteria/built-types",
"test-data-generator": "cd packages/openactive-integration-tests && npm run test-data-generator",
"gen-openid-client-types": "cd packages/openactive-openid-test-client && npm run gen-types",
"git-add-newly-generated-openid-client-types": "git add packages/openactive-openid-test-client/built-types",
"gen-openid-client-types": "(cd packages/openactive-openid-client && npm run gen-types); (cd packages/openactive-openid-browser-automation && npm run gen-types); (cd packages/openactive-openid-test-cli && npm run gen-types)",
"git-add-newly-generated-openid-client-types": "git add packages/openactive-openid-client/built-types; git add packages/openactive-openid-browser-automation/built-types; git add packages/openactive-openid-test-cli/built-types",
"gen-and-git-add-everything": "npm run gen-interface-criteria-types && npm run git-add-newly-generated-interface-criteria-types && npm run gen-openid-client-types && npm run git-add-newly-generated-openid-client-types && npm run doc-gen && npm run git-add-newly-generated-integration-test-docs",
"clean-install": "npx rimraf ./**/node_modules",
"clean-install": "npx rimraf -g ./**/node_modules",
"update-test-suite": "npm run clean-install && git fetch --all && git reset --hard origin/master && git clean -f -d && npm install"
},
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/openactive-broker-microservice/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const path = require('path');
const { performance } = require('perf_hooks');

Check failure on line 10 in packages/openactive-broker-microservice/app.js

View workflow job for this annotation

GitHub Actions / build

`perf_hooks` import should occur before import of `express`

Check failure on line 10 in packages/openactive-broker-microservice/app.js

View workflow job for this annotation

GitHub Actions / build

`perf_hooks` import should occur before import of `express`
const { Base64 } = require('js-base64');
const sleep = require('util').promisify(setTimeout);

Check failure on line 12 in packages/openactive-broker-microservice/app.js

View workflow job for this annotation

GitHub Actions / build

`util` import should occur before import of `express`

Check failure on line 12 in packages/openactive-broker-microservice/app.js

View workflow job for this annotation

GitHub Actions / build

`util` import should occur before import of `express`
const { setupBrowserAutomationRoutes, FatalError } = require('@openactive/openactive-openid-test-client');
const { setupBrowserAutomationRoutes } = require('@openactive/openactive-openid-browser-automation');
const { FatalError } = require('@openactive/openactive-openid-client');
const Handlebars = require('handlebars');
const fs = require('fs').promises;

Check failure on line 16 in packages/openactive-broker-microservice/app.js

View workflow job for this annotation

GitHub Actions / build

`fs` import should occur before import of `express`

Check failure on line 16 in packages/openactive-broker-microservice/app.js

View workflow job for this annotation

GitHub Actions / build

`fs` import should occur before import of `express`
const { Remarkable } = require('remarkable');
Expand Down
Loading

0 comments on commit 395cf60

Please sign in to comment.