From 1567776139221fac6aadeaec74a3fb4a15fc056e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Youen=20Ch=C3=A9n=C3=A9?= Date: Fri, 6 Oct 2023 09:15:36 +0200 Subject: [PATCH] feat: documentation and last adjustment --- CONTRIBUTING.md | 9 +++++++++ test/README.md | 2 ++ test/check-service-conformity.feature | 4 +--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d7c6748..a2c837f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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). diff --git a/test/README.md b/test/README.md index a1d4cdd..315a352 100644 --- a/test/README.md +++ b/test/README.md @@ -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 + diff --git a/test/check-service-conformity.feature b/test/check-service-conformity.feature index ea9b11b..8c250ef 100644 --- a/test/check-service-conformity.feature +++ b/test/check-service-conformity.feature @@ -5,7 +5,7 @@ Background: * def account_name = 'Conformity-' + now() * url 'http://localhost:8080/' -Scenario: +Scenario: Healthcheck Given path 'healthcheck' When method head @@ -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 }