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.
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