-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added testing to the generated OpenAPI.
Signed-off-by: dblock <dblock@amazon.com>
- Loading branch information
Showing
5 changed files
with
1,702 additions
and
31 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Test Spec | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
OPENSEARCH_INITIAL_ADMIN_PASSWORD: BobgG7YrtsdKf9M | ||
|
||
jobs: | ||
integ-tests: | ||
name: Build and Test | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
|
||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Build | ||
working-directory: ./tools | ||
run: |- | ||
mkdir -p ../build | ||
npm install | ||
npm run merge -- ../spec ../build/opensearch-openapi.yaml | ||
- name: Build and Run Docker Container | ||
run: | | ||
docker build coverage --tag opensearch-with-api-plugin | ||
docker run -d -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -e OPENSEARCH_INITIAL_ADMIN_PASSWORD="$OPENSEARCH_INITIAL_ADMIN_PASSWORD" opensearch-with-api-plugin | ||
sleep 15 | ||
- name: Display OpenSearch Info | ||
run: | | ||
curl -ks -u "admin:$OPENSEARCH_INITIAL_ADMIN_PASSWORD" https://localhost:9200/ | jq | ||
- name: Test | ||
working-directory: ./tools | ||
run: |- | ||
npm run dredd -- --user "admin:$OPENSEARCH_INITIAL_ADMIN_PASSWORD" ../build/opensearch-openapi.yaml https://localhost:9200 |
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,6 @@ | ||
const hooks = require('hooks') | ||
|
||
hooks.beforeAll(function (transactions) { | ||
// disable TLS verification, https://github.com/apiaryio/dredd/issues/913#issuecomment-381419699 | ||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0 | ||
}) |
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
Oops, something went wrong.