From bdb004581b699feb852e0c20716abb4e506a177a Mon Sep 17 00:00:00 2001 From: Michel Wilhelm Date: Mon, 21 Oct 2024 23:38:06 -0300 Subject: [PATCH] Organizing the files --- integration/Makefile | 13 ++++++----- integration/README.md | 23 +++++++++++++++++++ .../commands/{populate.py => prepare.py} | 19 ++++----------- integration/commands/start.py | 14 +++++++++++ 4 files changed, 49 insertions(+), 20 deletions(-) rename integration/commands/{populate.py => prepare.py} (88%) create mode 100644 integration/commands/start.py diff --git a/integration/Makefile b/integration/Makefile index 949364c..a9fd3dd 100644 --- a/integration/Makefile +++ b/integration/Makefile @@ -1,10 +1,11 @@ -populate: - @uv run python -m commands.populate - - -shutdown: - @uv run python -m commands.shutdown +prepare: + @uv run python -m commands.prepare +start: + @uv run python -m commands.start queue: @uv run python -m commands.queue + +shutdown: + @uv run python -m commands.shutdown diff --git a/integration/README.md b/integration/README.md index e69de29..52b810b 100644 --- a/integration/README.md +++ b/integration/README.md @@ -0,0 +1,23 @@ +# About the integration directory + +This directoy is a manual integration tests and is useful to understand how Flowspell can be integrated with other systems. + +## Commands + +There are some commands which should be executed + +### prepare + +This the #1 command to be executed. It will prepare the data creating flows and task definitions + +```bash +make prepare +``` + +### start + +This command will start a flow instance which was previously created by the prepare command + +```bash +make start +``` diff --git a/integration/commands/populate.py b/integration/commands/prepare.py similarity index 88% rename from integration/commands/populate.py rename to integration/commands/prepare.py index ac4cc1c..f950187 100644 --- a/integration/commands/populate.py +++ b/integration/commands/prepare.py @@ -1,3 +1,7 @@ +""" +This script is used to populate the system with data for testing purposes. +It is used to create flow definitions, task definitions, and start a flow instance. +""" from utils import client @@ -83,17 +87,4 @@ response_task_definition = client().post("/tasks/definitions/", json=task_definition_data) task_def_ref_id = response_task_definition.json()["reference_id"] - # 3. Starting the flow - flow_instance_data = { - "input_data": { - "id": 1, - }, - } - - response_flow_instance = client().post(f"/flows/instances/{flow_definition_ref_id}/start", json=flow_instance_data) - assert response_flow_instance.status_code == 201 - - -queue_data = {} -queue_response = client().post("/tasks/queue", json=queue_data) -print(queue_response.json()) + print("Task definition created: ", response_task_definition.json()) diff --git a/integration/commands/start.py b/integration/commands/start.py new file mode 100644 index 0000000..052ddff --- /dev/null +++ b/integration/commands/start.py @@ -0,0 +1,14 @@ +""" + +""" +from utils import client + + +flow_instance_data = { + "input_data": { + "id": 1, + }, +} + +response_flow_instance = client().post(f"/flows/instances/{flow_definition_ref_id}/start", json=flow_instance_data) +assert response_flow_instance.status_code == 201