Skip to content
Snippets Groups Projects
Verified Commit ac99b0d5 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

DOC: update README

parent f893ce4a
No related branches found
No related tags found
No related merge requests found
Pipeline #55597 passed
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
This repository contains a python test suite for testing the FDO Manager using [pytest](https://docs.pytest.org/en/stable/getting-started.html). This repository contains a python test suite for testing the FDO Manager using [pytest](https://docs.pytest.org/en/stable/getting-started.html).
Currently, the test suite send requests via the REST API to the FDO Manager Service which then delegates the call to the FDO SDK. The effects on the repositories or the handle system is not tested right now which is why the FDO SDK may use mockup repositories. ## Mockup Mode
The test suite send requests via the REST API to the FDO Manager Service which then delegates the call to the FDO SDK. When the FDO Manager Service runs in mockup mode the testing covers the following components:
```mermaid ```mermaid
sequenceDiagram sequenceDiagram
...@@ -13,33 +15,69 @@ sequenceDiagram ...@@ -13,33 +15,69 @@ sequenceDiagram
FDO Manager Service->>-Test Suite: API Response FDO Manager Service->>-Test Suite: API Response
``` ```
## Full End-to-end Testing
When the FDO Manager Service is configure to use actual repositories the tests cover the full path of requests and also checks the effects on the repositories and the handle system independently from the FDO Manager API.
```mermaid
sequenceDiagram
Test Suite->>+FDO Manager Service: API Request
FDO Manager Service->>+FDO SDK: Java Call
FDO SDK->>+Repository (LinkAhead|Cordra): DOIP Request
Repository (LinkAhead|Cordra)->>Handle System: DO-IRP Request
Handle System->>Repository (LinkAhead|Cordra): DO-IRP Response
Repository (LinkAhead|Cordra)->>-FDO SDK:DOIP Response
FDO SDK->>-FDO Manager Service: Java Call Returns
FDO Manager Service->>-Test Suite: API Response
Test Suite-->>Repository (LinkAhead|Cordra): Test state of the repositories
Test Suite-->>Handle System: Test state of the Handle System
```
## Run Tests ## Run Tests
To run the tests, the [python client](https://gitlab.indiscale.com/fdo/fdo-manager-clients/-/tree/main/example-client?ref_type=heads) must be installed, which can be done by running install_python_client.sh. ### Installation and Testbed Setup
Afterwards, all dependencies from requirements.txt can be installed with
``` To run the tests, the [python client](https://gitlab.indiscale.com/fdo/fdo-manager-clients/-/tree/main/example-client?ref_type=heads)
must be installed, which can be done by running `install_python_client.sh`.
Afterwards, all dependencies from requirements.txt can be installed with
```
pip install -r requirements.txt pip install -r requirements.txt
``` ```
\ To set which services are tested, modify `manager_test/service_index.py`. By
To use a local repository for testing, the [FDO manager service](https://gitlab.indiscale.com/fdo/fdo-manager-service) default, the test suite is set up to run against a local testbed. You need to
must be running with mock repository enabled. Refer to the project documentation for setup instructions. start the local testbed by
```
make -C fdo-local-testbed clean start
```
### Start Tests
\
Then all tests can be run from this directory using Then all tests can be run from this directory using
``` ```
pytest --order-dependencies --ignore-unknown-dependency pytest --order-dependencies --ignore-unknown-dependency
``` ```
\ \
To set which services are tested, modify manager_test/service_index.py.
### Teardown Local Testbed
Stop the local testbed afterwards with
```
make -C fdo-local-testbed stop
```
#### Usage of install_python_client.sh #### Usage of `install_python_client.sh`
The api.yaml that the install_python_client.sh bash script generates a client for can be The api.yaml that the `install_python_client.sh` shell script generates a
changed by setting one of two environment variables: \ client for can be changed by setting one of two environment variables: \
API_CLIENT_PATH for a file path or API_CLIENT_URL for an url. \ `API_CLIENT_PATH` for a file path or `API_CLIENT_URL` for an url. \
If both are set, API_CLIENT_PATH is used. If both are set, `API_CLIENT_PATH` is used.
### Troubleshooting ### Troubleshooting
If pytest is not a recognized command, the pytest.py location may not be available in PATH. To solve this error, If pytest is not a recognized command, the pytest.py location may not be
find out where the pytest script was installed on your PC and append the value to your PATH environment variable. available in PATH. To solve this error, find out where the pytest script was
installed on your PC and append the value to your PATH environment variable.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment