-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Theo Truong <[email protected]>
- Loading branch information
Showing
21 changed files
with
1,693 additions
and
4 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,11 @@ | ||
version: '3' | ||
|
||
services: | ||
opensearch-cluster: | ||
image: opensearchproject/opensearch:${OPENSEARCH_VERSION} | ||
ports: | ||
- "9200:9200" | ||
- "9600:9600" | ||
environment: | ||
- "discovery.type=single-node" | ||
- "OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD}" |
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,45 @@ | ||
name: Test the OS cluster against the OpenSearch Spec | ||
|
||
on: | ||
push: | ||
branches: [ '**' ] | ||
paths: | ||
- 'package*.json' | ||
- 'tsconfig.json' | ||
- 'tools/tester/**' | ||
- 'spec/**' | ||
pull_request: | ||
branches: [ '**' ] | ||
paths: | ||
- 'package*.json' | ||
- 'tsconfig.json' | ||
- 'tools/tester/**' | ||
- 'spec/**' | ||
|
||
jobs: | ||
test-opensearch-spec: | ||
runs-on: ubuntu-latest | ||
env: | ||
OPENSEARCH_VERSION: 2.12.0 | ||
OPENSEARCH_PASSWORD: myStrongPassword123! | ||
OPENSEARCH_URL: https://localhost:9200 | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Run OpenSearch Cluster | ||
working-directory: .github/opensearch-cluster | ||
run: | | ||
docker-compose up -d | ||
sleep 60 | ||
- name: Run Tests | ||
run: npm run test:spec |
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,146 @@ | ||
$schema: http://json-schema.org/draft-07/schema# | ||
|
||
type: object | ||
properties: | ||
$schema: | ||
type: string | ||
skip: | ||
type: boolean | ||
description: If true, the story will be skipped. | ||
default: false | ||
description: | ||
type: string | ||
prologues: | ||
type: array | ||
items: | ||
$ref: '#/definitions/SupplementalChapter' | ||
epilogues: | ||
type: array | ||
items: | ||
$ref: '#/definitions/SupplementalChapter' | ||
chapters: | ||
type: array | ||
items: | ||
$ref: '#/definitions/Chapter' | ||
minItems: 1 | ||
required: [ description, chapters] | ||
additionalProperties: false | ||
|
||
definitions: | ||
Chapter: | ||
type: object | ||
allOf: | ||
- $ref: '#/definitions/ChapterRequest' | ||
- properties: | ||
synopsis: | ||
type: string | ||
description: A brief description of the chapter. | ||
response: | ||
$ref: '#/definitions/ExpectedResponse' | ||
required: [ synopsis ] | ||
additionalProperties: false | ||
|
||
ReadChapter: | ||
allOf: | ||
- $ref: '#/definitions/Chapter' | ||
- type: object | ||
properties: | ||
response: | ||
$ref: '#/definitions/ActualResponse' | ||
required: [ response ] | ||
additionalProperties: false | ||
|
||
SupplementalChapter: | ||
allOf: | ||
- $ref: '#/definitions/ChapterRequest' | ||
- type: object | ||
properties: | ||
status: | ||
description: Array of success HTTP status codes. Default to [200, 201]. | ||
type: array | ||
default: [200, 201] | ||
items: | ||
type: integer | ||
additionalProperties: false | ||
|
||
ChapterRequest: | ||
type: object | ||
properties: | ||
path: | ||
type: string | ||
method: | ||
type: string | ||
enum: [ GET, PUT, POST, DELETE, PATCH, HEAD, OPTIONS ] | ||
parameters: | ||
type: object | ||
additionalProperties: | ||
$ref: '#/definitions/Parameter' | ||
request_body: | ||
$ref: '#/definitions/RequestBody' | ||
required: [ path, method ] | ||
additionalProperties: false | ||
|
||
|
||
RequestBody: | ||
type: object | ||
properties: | ||
content_type: | ||
type: string | ||
default: application/json | ||
payload: | ||
$ref: '#/definitions/Payload' | ||
required: [ payload ] | ||
additionalProperties: false | ||
|
||
ExpectedResponse: | ||
type: object | ||
properties: | ||
status: | ||
type: integer | ||
description: The expected HTTP status code. Default to 200. | ||
default: 200 | ||
content_type: | ||
type: string | ||
default: application/json | ||
payload: | ||
$ref: '#/definitions/Payload' | ||
required: [ status ] | ||
additionalProperties: false | ||
|
||
ActualResponse: | ||
type: object | ||
properties: | ||
status: | ||
type: integer | ||
content_type: | ||
type: string | ||
payload: | ||
$ref: '#/definitions/Payload' | ||
message: | ||
type: string | ||
description: Error message for non 2XX responses. | ||
error: | ||
type: object | ||
description: Error object. | ||
required: [ status, content_type, payload ] | ||
additionalProperties: false | ||
|
||
Payload: | ||
anyOf: | ||
- type: object | ||
- type: array | ||
- type: string | ||
- type: number | ||
- type: boolean | ||
|
||
Parameter: | ||
anyOf: | ||
- type: array | ||
items: | ||
oneOf: | ||
- type: string | ||
- type: number | ||
- type: boolean | ||
- type: string | ||
- type: number | ||
- type: boolean |
Oops, something went wrong.