Commit 36a3b658 authored by Luc Yriarte's avatar Luc Yriarte
Browse files

Sanitize documentation for OSDU

parent cbf02914
......@@ -349,8 +349,7 @@ This example runs basic tests using the local filesystem for blob storage and st
First, create the temp storage folders and run the service.
```bash
mkdir -p tmpstorage
mkdir -p tmpblob
mkdir -p tmpstorage tmpblob
python main.py -e USE_INTERNAL_STORAGE_SERVICE_WITH_PATH $(pwd)/tmpstorage -e USE_LOCALFS_BLOB_STORAGE_WITH_PATH $(pwd)/tmpblob -e CLOUD_PROVIDER local
```
......@@ -378,6 +377,11 @@ If you want to work with other requirements file, you can specify them
pip-sync requirements.txt requirements_dev.txt
```
**Note:** On a Windows workstation, platform-specific modules such as `pywin32` are also needed. In this case don't use `pip-sync` but `pip install` instead.
```bash
pip install -r requirements.txt -r requirements_dev.txt
```
If you want to update `requirements.txt` to retrieve the most recent version, respecting bounds set in `requirements.in`, you can use:
```bash
......@@ -390,6 +394,8 @@ If you want to update the version of only one dependency, for instance fastapi:
pip-compile --upgrade-package fastapi
```
**Note:** On a Windows workstation, **don't** commit the `pywin32` back to the `requirements.txt` file, that will cause CICD to fail.
For more information: https://github.com/jazzband/pip-tools/
### Debugging:
......
......@@ -4,31 +4,19 @@ The OpenAPI specification for Wellbore DMS is reverse generated from the source
as opposed to generating the implementation from the specification.
## Where to find it
The Swagger page for WDMS is available along the running service at,
The Swagger page for WDMS is available along the running service, at
`https://{hostname}/docs`.
And the OpenAPI specification file will be at `https://{hostname}/openapi.json`
E.g.: For EVT enviroment, `https://evt-mvp.managed-osdu.cloud.slb-ds.com/api/os-wellbore-ddms/openapi.json`
E.g.: On local deployment, `http://127.0.0.1:8080/api/os-wellbore-ddms/openapi.json`
The `spec` directory contains the OpenAPI specification files for Wellbore DMS.
Under `spec/generated`, the OpenAPI in JSON format is saved as-is.
## Publishing to Developer Portal
API products are grouped in families as described in the table below.
## Publishing to community documentation repo
A sanitized version of the OpenAPI specification including only the OSDU v3 APIs is published
in the [platform/api/Wellbore-DDMS](https://community.opengroup.org/osdu/documentation/-/tree/master/platform/api/Wellbore-DDMS)
section of the OSDU community documentation repo.
API reference/Swagger | API Product | Path | Objects/services
--- | --- | --- | ---
Wellbore Objects Generic data types | OSDU Wellbore DMS - Data Access | baseURL/osdu/wdms/wellbore/v2 | Well, Wellbore, Logset, Log, Trajectory, Geology
Dips & Markers | OSDU Wellbore DMS - Data Access | baseURL/osdu/wdms/geology/v2 | Dip & DipSet, Maker
Search | OSDU Wellbore DMS - Data Access | baseURL/osdu/wdms/search/v2 | Search (aka Contextualization)
Log Recognition | OSDU Wellbore DMS - Data Services | baseURL/osdu/wdms/log-recognition/v2 | Rule Based Log Recognition
### Steps
1. Convert generated JSON to YAML. Use swagger-codegen-cli locally, or Swagger Editor UI locally.
2. The converted YAML had syntax errors that were corrected in `spec/edited/openapi.yaml`
3. `spec/edited/openapi.yaml` was split according to the API groups defined above,
`geology.yaml`, `log-recognition.yaml`, `search.yaml`, and `wellbore.yaml`, placed under `spec/edited`.
_**Latest synced version:**_ Commit 6bad362 (Dec/10/2020)
\ No newline at end of file
_**Latest synced version:**_ (Jun/09/2021)
......@@ -60,7 +60,7 @@ local_environment.json file.
`pytest ./functional --param="token: MY_TOKEN"` => Run all tests, pass token in parameter.
`pytest ./functional --environment="./generated/postman_environment.json" --insecure --timeout-request=15000 --filter-tag=crud`
`pytest ./functional --environment="./generated/postman_environment.json" --insecure --timeout-request=15000 --filter-tag=basic`
=> Run tests with tag 'crud', use a environment file generated by the script gen_postman_env.py, disable SSL validation,
15 seconds request timeout.
......@@ -68,25 +68,23 @@ For better logging in console use `--log-cli-level=INFO|DEBUG`. (by default log_
INFO level see [pytest.ini](./functional/pytest.ini)). This produces this output on the console:
```
collected 53 items
collected 197 items
functional\tests\test_about.py::test_about
----------------------------------------------------------------------------------------------------------------- live log call -----------------------------------------------------------------------------------------------------------------
16:38:40 [INFO] - test_about => GET https://open.opendes.cloud.slb-ds.com/api/os-wellbore-ddms/about
16:38:40 [INFO] - test_about <= status_code=200 (298 ms)
PASSED [ 1%]
-------------------------------- live log call --------------------------------
11:32:05 [INFO] - test_about => GET http://127.0.0.1:8080/api/os-wellbore-ddms/about
11:32:05 [INFO] - test_about <= status_code=200 (8 ms)
PASSED [ 0%]
functional\tests\test_about.py::test_version
----------------------------------------------------------------------------------------------------------------- live log call -----------------------------------------------------------------------------------------------------------------
16:38:40 [INFO] - test_version => GET https://open.opendes.cloud.slb-ds.com/api/os-wellbore-ddms/version
16:38:40 [INFO] - test_version <= status_code=200 (245 ms)
PASSED [ 3%]
functional\tests\test_about.py::test_status SKIPPED [ 5%]
functional\tests\test_crud.py::test_crud_create_record[well] SKIPPED [ 7%]
functional\tests\test_crud.py::test_crud_create_record[wellbore] SKIPPED
-------------------------------- live log call --------------------------------
11:32:05 [INFO] - test_version => GET http://127.0.0.1:8080/api/os-wellbore-ddms/version
11:32:05 [INFO] - test_version <= status_code=200 (38 ms)
PASSED [ 1%]
functional\tests\test_about.py::test_status
...
functional\tests\test_search.py::test_search_logs_by_logset_attribute SKIPPED [100%]
functional\tests\test_trajectory.py::test_trajectory_error_code SKIPPED [100%]
========================================================================================================= 2 passed, 51 skipped in 0.73s =========================================================================================================
======================= 112 passed, 85 skipped in 8.32s =======================
```
To export logs into a file use `--log-file=test_log.txt`. The level for log file can be set independently:
......@@ -201,41 +199,41 @@ It can be override (as any headers) by passing it in the pytest command line:
To get the test specific correlation id, the easiest is to enable full log verbosity on request by using
`--log-request-level=2`:
`pytest ./functional/tests/test_about.py::test_about --log-request-level=2`
`pytest ./functional/tests/test_about.py::test_aboutreset
`
=> run only test_about, here's the output:
```
functional\tests\test_about.py::test_about
-------------------------------------------------------------------------------------------------------- live log call ---------------------------------------------------------------------------------------------------------
11:26:57 [INFO] - test_about => GET https://open.opendes.cloud.slb-ds.com/api/os-wellbore-ddms/about
11:26:57 [INFO] - test_about <=
11:26:57 [INFO] - [200] - https://open.opendes.cloud.slb-ds.com/api/os-wellbore-ddms/about
start: [2020-11-25 11:26:57.413062], end: 2020-11-25 11:26:57.702802, elapsed: 289 ms
-------------------------------- live log call --------------------------------
11:52:20 [INFO] - test_about => GET http://127.0.0.1:8080/api/os-wellbore-ddms/about
11:52:20 [INFO] - test_about <=
11:52:20 [INFO] - [200] - http://127.0.0.1:8080/api/os-wellbore-ddms/about
start: [2021-09-29 11:52:20.029676], end: 2021-09-29 11:52:20.044676, elapsed: 15 ms
============ REQUEST ===============
URL: [GET] https://open.opendes.cloud.slb-ds.com/api/os-wellbore-ddms/about)
URL: [GET] http://127.0.0.1:8080/api/os-wellbore-ddms/about)
headers:
- User-Agent: python-requests/2.24.0
- User-Agent: python-requests/2.26.0
- Accept-Encoding: gzip, deflate
- accept: application/json
- Connection: close
- correlation-id: wdms_e2e_test_about_a3b54d19-73f9-4047-aadb-11592fc0d949
- correlation-id: wdms_e2e_test_about_8412b5e9-ae17-4c6d-8b6b-9400b5414e64
============ RESPONSE ===============
headers:
- date: Wed, 25 Nov 2020 10:26:57 GMT
- server: istio-envoy
- content-length: 114
- date: Wed, 29 Sep 2021 09:52:19 GMT
- server: uvicorn
- content-length: 97
- content-type: application/json
- x-envoy-upstream-service-time: 4
- Via: 1.1 google
- Alt-Svc: clear
- Connection: close
body: -------------------------------------------
{"service":"Wellbore DDMS OSDU","version":"0.2.20112501","buildNumber":"20112501_master","cloudEnvironment":"gcp"}
{"service":"Wellbore DDMS OSDU","version":"0.2","buildNumber":"local","cloudEnvironment":"local"}
PASSED
PASSED [100%]
============================== 1 passed in 0.05s ==============================
```
The request headers contain it:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment