Skip to content

Commit

Permalink
feat: documentation and last adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
youenchene committed Oct 6, 2023
1 parent 9ff38a1 commit 1567776
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ Each service must respect :

Reference implementation is the [golang implementation](./service/go-pgx).

### Acceptance criteria

Service should pass the [conformity tests](./test/check-service-conformity.feature) - For help to execute test go here : https://github.com/karatelabs/karate

Service's docker should have 2 environment variables :

- `DATABASE_URL` : Example of value injected: postgres://postgres:mysecretpassword@database:5432/postgres - url signature can be change for each service
- `DATABASE_POOL_MAX` : setup to 20 by default

#### API Contract

API Contract must respect the following [API Definition documentation](./service/specs.md).
Expand Down
2 changes: 2 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

### Test Script to check the good behavior of each service implementation.

Get help here on how to launch the test : https://github.com/karatelabs/karate

4 changes: 1 addition & 3 deletions test/check-service-conformity.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Background:
* def account_name = 'Conformity-' + now()
* url 'http://localhost:8080/'

Scenario:
Scenario: Healthcheck
Given path 'healthcheck'
When method head

Expand Down Expand Up @@ -43,14 +43,12 @@ Scenario: Simple Conformity Scenario - API Behavior and Cache agressive check
And param page = 0
When method get
Then match [200, 201, 204] contains responseStatus
Then print response
Then match response[0] contains { id: #(list_id), name: #(list_name), tasks: #notnull }
Then match response[0].tasks[0] contains { id: #(task_id), name: #(task_name), description: #(task_description) }
# Check stats
Given path 'api/stats'
And header Content-Type = 'application/json'
When method get
Then print response
Then match [200, 201, 204] contains responseStatus
Then def sub_result = karate.filter(response, x => { return x.account_id == account_id } )
Then match sub_result[0] contains { account_id: #(account_id), account_login: #(account_name), list_count:1, task_avg:1 }
Expand Down

0 comments on commit 1567776

Please sign in to comment.