-
Notifications
You must be signed in to change notification settings - Fork 65
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 <[email protected]>
- Loading branch information
Showing
4 changed files
with
1,699 additions
and
30 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 | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
OPENSEARCH_INITIAL_ADMIN_PASSWORD: BobgG7YrtsdKf9M | ||
|
||
jobs: | ||
test: | ||
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 --hookfiles dredd/all.js |
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 @@ | ||
let hooks = require('hooks') | ||
Check failure on line 1 in tools/dredd/all.js GitHub Actions / tools-tests
|
||
|
||
hooks.beforeAll(function (transactions) { | ||
// disable TLS verification, https://github.com/apiaryio/dredd/issues/913#issuecomment-381419699 | ||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0 | ||
}); | ||
Oops, something went wrong.