Skip to content

Commit

Permalink
Organizing the files
Browse files Browse the repository at this point in the history
  • Loading branch information
imakecodes committed Oct 22, 2024
1 parent 414a917 commit bdb0045
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 20 deletions.
13 changes: 7 additions & 6 deletions integration/Makefile
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions integration/README.md
Original file line number Diff line number Diff line change
@@ -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
```
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -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())
14 changes: 14 additions & 0 deletions integration/commands/start.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bdb0045

Please sign in to comment.