-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
47: Add README.md and ci scripts for system_tests and example_sdk_cli…
…ent providing easy info and access to using them locally. Also add Legal considerations in root README.md and alter reconnect.py example to fully show reconnect.
- Loading branch information
1 parent
b78b3da
commit e71ed11
Showing
8 changed files
with
111 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Example clients using the SDK | ||
This directory contains a selection of scripts that use the Python SDK with a specific | ||
functionality. It is meant to provide an easy starting point on how to integrate the Python | ||
SDK (or other SDKs) in your own application. | ||
|
||
In order to run the examples, it is necessary to setup the Python SDK first. You may | ||
run `./ci/linux/create_venv.sh` to create a virtual environment or just simply | ||
`pip install -r requirements.txt`. Then (activate the virtual environment if necessary and) | ||
run any of the example scripts through python such as `python3 optimizer.py`. | ||
|
||
The scripts show case the following functionalities: | ||
- `optimizer.py`: Start an optimization job and wait for the result. | ||
- `optimizer_cancel.py`: Start an optimization job and cancel it after some time. | ||
- `reconnect.py`: Reconnect the SDK after prior submitting a job and stopping the SDK. This | ||
simulates the case where an application (which integrates the SDK) has to reboot for some reason. | ||
It then needs to reconnect to any submitted but unfinished jobs to receive the events. | ||
- `simulator.py`: Start a simulation job and wait for the result. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env sh | ||
|
||
python3 -m venv ./.venv | ||
if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then | ||
echo "Activating .venv first." | ||
. .venv/bin/activate | ||
fi | ||
pip3 install -r ./requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# OMOTES System Tests | ||
|
||
This directory contains a number of tests which test the OMOTES stack/system as a whole. It | ||
requires a running OMOTES stack and it interacts with OMOTES through the python SDK as if it is | ||
any other (frontend) application. | ||
|
||
# Running the system tests | ||
In order to run the system tests, first ensure there is an OMOTES stack running. RabbitMQ | ||
should be exposed on localhost:5672 (which it is by default). It also requires the default | ||
login credentials omotes:somepass1 to log into RabbitMQ as an SDK. | ||
|
||
```bash | ||
./ci/linux/create_venv.sh # Sets up the dependencies for running the system tests application. | ||
./ci/linux/run.sh # Runs the system tests. May be repeated. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env sh | ||
|
||
python3 -m venv ./.venv | ||
if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then | ||
echo "Activating .venv first." | ||
. .venv/bin/activate | ||
fi | ||
pip3 install -r ./requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then | ||
echo "Activating .venv first." | ||
. .venv/bin/activate | ||
fi | ||
cd src/ | ||
pytest --timeout 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ omotes_sdk_python==0.0.16 | |
pytest ~= 8.1.2 | ||
pytest-timeout | ||
xmltodict ~= 0.13.0 | ||
pip-tools |