-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d6b18e
commit 1acba68
Showing
3 changed files
with
94 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -356,6 +356,45 @@ Some things to note: | |
- When using a hostname other than `localhost` for your booking system, it must included at least one `.` to pass the validator. | ||
- `host.docker.internal` must be the host to access your booking system locally if it is not running in another Docker container. This hostname must also be used within `NODE_CONFIG`. | ||
### CI - GitHub Actions | ||
This repository can also be referenced as a GitHub action, which conveniently wraps the Docker container. | ||
The following steps may be used within a GitHub Actions script: | ||
```yaml | ||
steps: | ||
- name: Run OpenActive Test Suite | ||
uses: openactive/openactive-test-suite@master | ||
with: | ||
config_file: ./test-suite-config.json | ||
NODE_CONFIG: | | ||
{"ci": true, "broker": {"outputPath": "/github/workspace/test-suite/output/", "datasetSiteUrl": "http://host.docker.internal/openactive"}, "integrationTests": { "outputPath": "/github/workspace/test-suite/output/", "conformanceCertificatePath": "/github/workspace/test-suite/conformance/", "conformanceCertificateId": "https://certificates.example.com/openactive/" }, "sellers": {"primary": { "@id": "http://host.docker.internal/api/identifiers/sellers/1","secondary": { "@id": "http://host.docker.internal/api/identifiers/sellers/2"}}}} | ||
- name: Upload test output as artifact | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ success() || failure() }} | ||
with: | ||
name: openactive-test-suite | ||
path: ./test-suite/output/ | ||
- name: Deploy conformance certificate to Azure Blob Storage (master branch only) | ||
uses: bacongobbler/[email protected] | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
with: | ||
source_dir: ./test-suite/conformance/ | ||
container_name: '$web' | ||
connection_string: ${{ secrets.CONFORMANCE_CERTIFICATE_BLOB_STORAGE_CONNECTION_STRING }} | ||
sync: false | ||
``` | ||
And as in the parent section, `NODE_CONFIG` must include `"ci": true`. | ||
Note that `outputPath` and `conformanceCertificatePath` must start with `/github/workspace/` to ensure these outputs are accessible in subsequent steps. | ||
As in the previous section, `host.docker.internal` must be the host to access your booking system locally to the GitHub action if it is not running in another Docker container. This hostname must also be used within `NODE_CONFIG` for `datasetSiteUrl` and Seller `@id`s. | ||
The Test Suite Certificate should be updated upon each successfull CI run. | ||
## Test Data Requirements | ||
In order to run the tests in random mode, the target Open Booking API implementation will need to have some Opportunity data pre-loaded. Use [Test Data Generator](./packages/openactive-integration-tests/test-data-generator/) to find out how much data is needed and in what configuration. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: 'OpenActive Test Suite' | ||
description: 'Test suite for OpenActive implementations' | ||
inputs: | ||
args: | ||
description: 'Arguments to pass to `npm start` of OpenActive Test Suite' | ||
required: false | ||
default: '' | ||
config_dir: | ||
description: 'The path of a config directory to copy into ./config/ of OpenActive Test Suite' | ||
required: false | ||
default: '' | ||
config_file: | ||
description: 'The path of a config file to copy into ./config/ of OpenActive Test Suite. This will also set NODE_CONFIG and NODE_APP_INSTANCE to ensure that the test suite uses this file.' | ||
required: false | ||
default: '' | ||
NODE_CONFIG: | ||
description: 'JSON configuration string to pass into OpenActive Test Suite' | ||
required: true | ||
default: '{ "ci": true }' | ||
NODE_ENV: | ||
description: 'Value of NODE_ENV environment variable to pass into OpenActive Test Suite' | ||
required: false | ||
default: '' | ||
NODE_APP_INSTANCE: | ||
description: 'Value of NODE_APP_INSTANCE environment variable to pass into OpenActive Test Suite' | ||
required: false | ||
default: '' | ||
runs: | ||
using: 'docker' | ||
image: 'docker://ghcr.io/openactive/test-suite:latest' | ||
args: | ||
- ${{ inputs.args }} | ||
env: | ||
FORCE_COLOR: 1 | ||
NODE_CONFIG: ${{ inputs.NODE_CONFIG }} | ||
NODE_ENV: ${{ inputs.NODE_ENV }} | ||
NODE_APP_INSTANCE: ${{ inputs.NODE_APP_INSTANCE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters