Skip to content

Commit d2216f1

Browse files
committed
Add in script to validate example YAML files against JSON schema, update README
1 parent bd8494b commit d2216f1

7 files changed

Lines changed: 574 additions & 61 deletions

File tree

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ To use this GitHub Action, you need to get a username and token from
4545
runs-on: ubuntu-latest
4646
steps:
4747
- name: Run integration tests
48-
uses: data-catering/insta-integration@v2
48+
uses: data-catering/insta-integration@v3
4949
with:
5050
data_caterer_user: ${{ secrets.DATA_CATERER_USER }}
5151
data_caterer_token: ${{ secrets.DATA_CATERER_TOKEN }}
@@ -129,10 +129,11 @@ The following data sources are available to generate/validate data.
129129
<summary>Click here</summary>
130130

131131
| Data Source Type | Data Source | Support |
132-
| ---------------- | ---------------------------------- | ------- |
132+
| ---------------- |------------------------------------| ------- |
133133
| Cloud Storage | AWS S3 | ✅ |
134134
| Cloud Storage | Azure Blob Storage | ✅ |
135135
| Cloud Storage | GCP Cloud Storage | ✅ |
136+
| Database | BigQuery | ✅ |
136137
| Database | Cassandra | ✅ |
137138
| Database | MySQL | ✅ |
138139
| Database | Postgres | ✅ |
@@ -148,10 +149,10 @@ The following data sources are available to generate/validate data.
148149
| File | Hudi | ❌ |
149150
| HTTP | REST API | ✅ |
150151
| Messaging | Kafka | ✅ |
152+
| Messaging | RabbitMQ | ✅ |
151153
| Messaging | Solace | ✅ |
152154
| Messaging | ActiveMQ | ❌ |
153155
| Messaging | Pulsar | ❌ |
154-
| Messaging | RabbitMQ | ❌ |
155156
| Metadata | Data Contract CLI | ✅ |
156157
| Metadata | Great Expectations | ✅ |
157158
| Metadata | Marquez | ✅ |
@@ -349,7 +350,11 @@ Validate the JSON Schema:
349350
ajv compile --spec=draft2019 -s schema/insta-integration-config-latest.json
350351
```
351352

352-
Validate a `insta-integration.yaml` file:
353+
#### Validate YAML file
354+
355+
You can run `npm run validate-yaml` and it will validate all the YAML files under the `examples` directory.
356+
357+
Otherwise, if you have a different pathway, validate via `ajv`:
353358

354359
```shell
355360
ajv validate --spec=draft2019 -s schema/insta-integration-config-latest.json -d example/postgres-to-csv.yaml

example/spring-postgres.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ run:
2727
validationIdentifier: GET/account/{accountNumber}/transactions
2828
fields:
2929
- name: httpUrl
30+
type: struct
3031
fields:
3132
- name: url
3233
static: http://localhost:8080/account/{accountNumber}/transactions
3334
- name: method
3435
static: GET
3536
- name: pathParams
37+
type: struct
3638
fields:
3739
- name: accountNumber
3840
options:
@@ -46,6 +48,6 @@ run:
4648
validationIdentifier: GET/account/{accountNumber}/transactions
4749
validations:
4850
- expr: request.method == 'GET'
49-
- expr: response.timeTaken < 100
51+
- expr: response.timeTakenMs < 100
5052
- expr: response.headers.Content-Type == 'application/json'
5153
- expr: response.body.account_number matches 'ACC[0-9]{8}'

insta-integration.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ run:
33
- command: echo 'hello world'
44
test:
55
relationship:
6-
my_parquet.account_id:
7-
- my_csv.account_id
6+
my_parquet||account_id:
7+
- my_csv||account_id
88
generation:
99
parquet:
1010
- name: my_parquet

0 commit comments

Comments
 (0)