diff --git a/.github/workflows/run-tests-in-container.yml b/.github/workflows/run-tests-in-container.yml index 698bb8b6..62333826 100644 --- a/.github/workflows/run-tests-in-container.yml +++ b/.github/workflows/run-tests-in-container.yml @@ -1,4 +1,4 @@ -name: Tests inside a Container +name: (With Mongo) Tests inside a Container on: [pull_request] jobs: diff --git a/.github/workflows/run-tests-kafka.yml b/.github/workflows/run-tests-kafka.yml index 732a1917..2439f4b2 100644 --- a/.github/workflows/run-tests-kafka.yml +++ b/.github/workflows/run-tests-kafka.yml @@ -1,4 +1,4 @@ -name: All tests on Kafka MQ +name: (With Mongo) Tests on Kafka MQ #on: # pull_request: # branches: [ "dev", "main" ] @@ -27,17 +27,42 @@ jobs: python-version: "3.10" cache: "pip" - - name: Install package and dependencies - run: | - python -m pip install --upgrade pip - python -m pip install .[all] - python -m pip install .[ml_dev] - - name: Run docker compose run: docker compose -f deployment/compose-kafka.yml up -d - - name: Wait for one minute - run: sleep 60 + - name: Upgrade pip + run: python -m pip install --upgrade pip + + - name: Show Python version + run: python --version && pip --version + + - name: Install default dependencies and run simple test + run: | + pip install . + python examples/simple_instrumented_script.py + + - name: Install Dask dependencies alone and run a simple Dask test + run: | + pip uninstall flowcept -y + pip install .[dask] + python examples/dask_example.py + + - name: Install MLFlow dependencies alone and run a simple MLFlow test + run: | + pip uninstall flowcept -y + pip install .[mlflow] + python examples/mlflow_example.py + + - name: Install Tensorboard dependencies alone and run a simple Tensorboard test + run: | + pip uninstall flowcept -y + pip install .[tensorboard] + python examples/tensorboard_example.py + + - name: Install all dependencies + run: | + python -m pip install .[all] + python -m pip install .[ml_dev] - name: Check liveness run: | diff --git a/.github/workflows/run-tests-py11-all-dbs.yml b/.github/workflows/run-tests-py11-all-dbs.yml index b2b6e8fd..b01d4510 100644 --- a/.github/workflows/run-tests-py11-all-dbs.yml +++ b/.github/workflows/run-tests-py11-all-dbs.yml @@ -1,4 +1,4 @@ -name: Tests on py11 with and without Mongo +name: (With and Without Mongo) Tests on py11 on: [pull_request] jobs: diff --git a/.github/workflows/run-tests-py11-simple.yml b/.github/workflows/run-tests-py11-simple.yml index 69787731..b63c4a22 100644 --- a/.github/workflows/run-tests-py11-simple.yml +++ b/.github/workflows/run-tests-py11-simple.yml @@ -1,4 +1,4 @@ -name: Tests on py11 without Mongo +name: (Without Mongo) Tests on py11 on: [pull_request] jobs: diff --git a/.github/workflows/run-tests-py11.yml b/.github/workflows/run-tests-py11.yml index 9c05a805..d3dc9fda 100644 --- a/.github/workflows/run-tests-py11.yml +++ b/.github/workflows/run-tests-py11.yml @@ -1,4 +1,4 @@ -name: Tests on py11 +name: (With Mongo) Tests on py11 on: [pull_request] jobs: @@ -59,7 +59,6 @@ jobs: - name: Install all dependencies run: | - python -m pip install --upgrade pip python -m pip install .[all] python -m pip install .[ml_dev] diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 1c770f03..2cdec81a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -77,7 +77,6 @@ jobs: - name: Install all dependencies run: | - python -m pip install --upgrade pip python -m pip install .[all] python -m pip install .[ml_dev] diff --git a/tests/decorator_tests/flowcept_task_decorator_test.py b/tests/decorator_tests/flowcept_task_decorator_test.py index bd10593c..833d2ac2 100644 --- a/tests/decorator_tests/flowcept_task_decorator_test.py +++ b/tests/decorator_tests/flowcept_task_decorator_test.py @@ -267,10 +267,16 @@ def test_flowcept_loop_generator(self): docs = Flowcept.db.query(filter={"workflow_id": Flowcept.current_workflow_id}) assert len(docs) == 3 # 1 (parent_task) + 2 (sub_tasks) - first_task = docs[0] - assert first_task["activity_id"] == "epochs" - sub_tasks = docs[1:] - assert all(t["parent_task_id"] == first_task["task_id"] for t in sub_tasks) + + iteration_tasks = [] + whole_loop_task = None + for d in docs: + if d["activity_id"] == "epochs": + whole_loop_task = d + else: + iteration_tasks.append(d) + assert len(iteration_tasks) == 2 + assert all(t["parent_task_id"] == whole_loop_task["task_id"] for t in iteration_tasks)