Repository: AgnostiqHQ/covalent (language: python)

Issue:
Re-organize test folders
- [ ] Move covalent test folder to inside /covalent
- [ ] Adding the micro-service test folders.
- [ ] Ensure that the test folders don't get added when doing `pip install`
- [ ] Ensure that the test folders are updated in the Actions.


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9a5082003..910891896 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [UNRELEASED]
 
+### Added
+
+- Folders for tests.
+
+### Changed
+
+- Organization of covalent tests.
+
 ## [0.50.0] - 2022-04-03
 
 ### Added
@@ -20,7 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ### Removed
 
-- Removed redundant local storage cache on frontend  
+- Removed redundant local storage cache on frontend
 
 ## [0.49.1] - 2022-04-01
 
diff --git a/MANIFEST.in b/MANIFEST.in
index a8b7ac6dc..5963e100b 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,9 +1,9 @@
 include VERSION
 include requirements.txt
-include covalent_dispatcher/_cli/supervisord.template.conf 
+include covalent_dispatcher/_cli/supervisord.template.conf
 recursive-include covalent/executor/executor_plugins/ *
 recursive-include covalent/notify/notification_plugins/ *
 recursive-include covalent_dispatcher/_service/ *
 recursive-exclude covalent_ui/webapp/ *
 recursive-include covalent_ui/webapp/build/ *
-recursive-exclude tests/ *
+recursive-exclude **/tests/ *
diff --git a/Makefile b/Makefile
deleted file mode 100644
index c26b4bc13..000000000
--- a/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-all:
-	gcc -shared -fPIC -o libtest.so test.c
-
-clean:
-	rm -f test.so
diff --git a/setup.py b/setup.py
index 9481e38fc..29ac81faf 100644
--- a/setup.py
+++ b/setup.py
@@ -150,7 +150,7 @@ def run(self):
 
 setup_info = {
     "name": "cova",
-    "packages": find_packages(exclude=["tests"]),
+    "packages": find_packages(exclude=["*tests*"]),
     "version": version,
     "maintainer": "Agnostiq",
     "url": "https://github.com/AgnostiqHQ/covalent",


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index dc878411f..df73fa861 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -87,8 +87,8 @@ jobs:
           VERSION="$(cat ./VERSION)"
           cd dist
           tar xzf cova-${VERSION}.tar.gz
-          diff -r cova-${VERSION}/covalent ../covalent
-          diff -r cova-${VERSION}/covalent_dispatcher ../covalent_dispatcher
+          diff -x tests -r cova-${VERSION}/covalent ../covalent
+          diff -x tests -r cova-${VERSION}/covalent_dispatcher ../covalent_dispatcher
           diff -x README.md cova-${VERSION}/covalent_ui ../covalent_ui 
           diff -r cova-${VERSION}/covalent_ui/webapp/build ../covalent_ui/webapp/build
           rm -rf cova-${VERSION}/
@@ -97,7 +97,7 @@ jobs:
       - name: Start Covalent dispatcher server
         run: covalent start -d
       - name: Run tests and measure coverage
-        run: pytest -v --cov=covalent --cov=covalent_dispatcher --ignore=refactor
+        run: pytest tests covalent/tests covalent_dispatcher/tests -vv --cov=covalent --cov=covalent_dispatcher --ignore=covalent/tests --ignore=covalent_dispatcher/tests
       - name: Generate coverage report
         run: coverage xml
       - name: Upload report to Codecov
diff --git a/tests/covalent_dispatcher_tests/__init__.py b/covalent/tests/__init__.py
similarity index 100%
rename from tests/covalent_dispatcher_tests/__init__.py
rename to covalent/tests/__init__.py
diff --git a/tests/covalent_tests/choose_executor_test.py b/covalent/tests/choose_executor_test.py
similarity index 100%
rename from tests/covalent_tests/choose_executor_test.py
rename to covalent/tests/choose_executor_test.py
diff --git a/tests/covalent_dispatcher_tests/_cli/__init__.py b/covalent/tests/dispatcher_plugins/__init__.py
similarity index 100%
rename from tests/covalent_dispatcher_tests/_cli/__init__.py
rename to covalent/tests/dispatcher_plugins/__init__.py
diff --git a/tests/covalent_tests/dispatcher_plugins/base_test.py b/covalent/tests/dispatcher_plugins/base_test.py
similarity index 100%
rename from tests/covalent_tests/dispatcher_plugins/base_test.py
rename to covalent/tests/dispatcher_plugins/base_test.py
diff --git a/tests/covalent_tests/dispatcher_plugins/local_test.py b/covalent/tests/dispatcher_plugins/local_test.py
similarity index 100%
rename from tests/covalent_tests/dispatcher_plugins/local_test.py
rename to covalent/tests/dispatcher_plugins/local_test.py
diff --git a/tests/covalent_dispatcher_tests/_core/__init__.py b/covalent/tests/executor/__init__.py
similarity index 100%
rename from tests/covalent_dispatcher_tests/_core/__init__.py
rename to covalent/tests/executor/__init__.py
diff --git a/tests/covalent_tests/executor/base_test.py b/covalent/tests/executor/base_test.py
similarity index 100%
rename from tests/covalent_tests/executor/base_test.py
rename to covalent/tests/executor/base_test.py
diff --git a/tests/covalent_tests/__init__.py b/covalent/tests/executor/executor_plugins/__init__.py
similarity index 100%
rename from tests/covalent_tests/__init__.py
rename to covalent/tests/executor/executor_plugins/__init__.py
diff --git a/tests/covalent_tests/executor/executor_plugins/local_test.py b/covalent/tests/executor/executor_plugins/local_test.py
similarity index 100%
rename from tests/covalent_tests/executor/executor_plugins/local_test.py
rename to covalent/tests/executor/executor_plugins/local_test.py
diff --git a/tests/covalent_tests/executor/init_test.py b/covalent/tests/executor/init_test.py
similarity index 100%
rename from tests/covalent_tests/executor/init_test.py
rename to covalent/tests/executor/init_test.py
diff --git a/tests/covalent_tests/dispatcher_plugins/__init__.py b/covalent/tests/notify/__init__.py
similarity index 100%
rename from tests/covalent_tests/dispatcher_plugins/__init__.py
rename to covalent/tests/notify/__init__.py
diff --git a/tests/covalent_tests/notify/init_test.py b/covalent/tests/notify/init_test.py
similarity index 100%
rename from tests/covalent_tests/notify/init_test.py
rename to covalent/tests/notify/init_test.py
diff --git a/tests/covalent_tests/notify/notify_test.py b/covalent/tests/notify/notify_test.py
similarity index 100%
rename from tests/covalent_tests/notify/notify_test.py
rename to covalent/tests/notify/notify_test.py
diff --git a/tests/covalent_tests/notify/webhook_test.py b/covalent/tests/notify/webhook_test.py
similarity index 100%
rename from tests/covalent_tests/notify/webhook_test.py
rename to covalent/tests/notify/webhook_test.py
diff --git a/tests/covalent_tests/executor/__init__.py b/covalent/tests/results_manager/__init__.py
similarity index 100%
rename from tests/covalent_tests/executor/__init__.py
rename to covalent/tests/results_manager/__init__.py
diff --git a/tests/covalent_tests/results_manager/results_manager_test.py b/covalent/tests/results_manager/results_manager_test.py
similarity index 100%
rename from tests/covalent_tests/results_manager/results_manager_test.py
rename to covalent/tests/results_manager/results_manager_test.py
diff --git a/tests/covalent_tests/executor/executor_plugins/__init__.py b/covalent/tests/shared_files/__init__.py
similarity index 100%
rename from tests/covalent_tests/executor/executor_plugins/__init__.py
rename to covalent/tests/shared_files/__init__.py
diff --git a/tests/covalent_tests/shared_files/config_test.py b/covalent/tests/shared_files/config_test.py
similarity index 100%
rename from tests/covalent_tests/shared_files/config_test.py
rename to covalent/tests/shared_files/config_test.py
diff --git a/tests/covalent_tests/shared_files/test_files/covalent/covalent.conf b/covalent/tests/shared_files/test_files/covalent/covalent.conf
similarity index 100%
rename from tests/covalent_tests/shared_files/test_files/covalent/covalent.conf
rename to covalent/tests/shared_files/test_files/covalent/covalent.conf
diff --git a/tests/covalent_tests/shared_files/utils_test.py b/covalent/tests/shared_files/utils_test.py
similarity index 100%
rename from tests/covalent_tests/shared_files/utils_test.py
rename to covalent/tests/shared_files/utils_test.py
diff --git a/tests/covalent_tests/workflow/dispatch_source_test.py b/covalent/tests/workflow/dispatch_source_test.py
similarity index 100%
rename from tests/covalent_tests/workflow/dispatch_source_test.py
rename to covalent/tests/workflow/dispatch_source_test.py
diff --git a/tests/covalent_tests/workflow/lattice_test.py b/covalent/tests/workflow/lattice_test.py
similarity index 100%
rename from tests/covalent_tests/workflow/lattice_test.py
rename to covalent/tests/workflow/lattice_test.py
diff --git a/tests/covalent_tests/workflow/lepton_test.py b/covalent/tests/workflow/lepton_test.py
similarity index 100%
rename from tests/covalent_tests/workflow/lepton_test.py
rename to covalent/tests/workflow/lepton_test.py
diff --git a/tests/covalent_tests/workflow/transport_test.py b/covalent/tests/workflow/transport_test.py
similarity index 100%
rename from tests/covalent_tests/workflow/transport_test.py
rename to covalent/tests/workflow/transport_test.py
diff --git a/tests/covalent_tests/notify/__init__.py b/covalent_dispatcher/tests/__init__.py
similarity index 100%
rename from tests/covalent_tests/notify/__init__.py
rename to covalent_dispatcher/tests/__init__.py
diff --git a/tests/covalent_dispatcher_tests/choose_conda_test.py b/covalent_dispatcher/tests/choose_conda_test.py
similarity index 100%
rename from tests/covalent_dispatcher_tests/choose_conda_test.py
rename to covalent_dispatcher/tests/choose_conda_test.py
diff --git a/tests/covalent_tests/results_manager/__init__.py b/covalent_dispatcher/tests/cli/__init__.py
similarity index 100%
rename from tests/covalent_tests/results_manager/__init__.py
rename to covalent_dispatcher/tests/cli/__init__.py
diff --git a/tests/covalent_dispatcher_tests/_cli/cli_test.py b/covalent_dispatcher/tests/cli/cli_test.py
similarity index 90%
rename from tests/covalent_dispatcher_tests/_cli/cli_test.py
rename to covalent_dispatcher/tests/cli/cli_test.py
index 2b317bca1..b1eff8857 100644
--- a/tests/covalent_dispatcher_tests/_cli/cli_test.py
+++ b/covalent_dispatcher/tests/cli/cli_test.py
@@ -47,4 +47,12 @@ def test_cli_commands():
     """Test the list of commands associated with Covalent CLI."""
 
     ctx = click.Context
-    assert cli.list_commands(ctx) == ["config", "logs", "purge", "restart", "start", "status", "stop"]
+    assert cli.list_commands(ctx) == [
+        "config",
+        "logs",
+        "purge",
+        "restart",
+        "start",
+        "status",
+        "stop",
+    ]
diff --git a/tests/covalent_dispatcher_tests/_cli/service_test.py b/covalent_dispatcher/tests/cli/service_test.py
similarity index 100%
rename from tests/covalent_dispatcher_tests/_cli/service_test.py
rename to covalent_dispatcher/tests/cli/service_test.py
diff --git a/tests/covalent_tests/shared_files/__init__.py b/covalent_dispatcher/tests/core/__init__.py
similarity index 100%
rename from tests/covalent_tests/shared_files/__init__.py
rename to covalent_dispatcher/tests/core/__init__.py
diff --git a/tests/covalent_dispatcher_tests/_core/execution_test.py b/covalent_dispatcher/tests/core/execution_test.py
similarity index 100%
rename from tests/covalent_dispatcher_tests/_core/execution_test.py
rename to covalent_dispatcher/tests/core/execution_test.py
diff --git a/tests/covalent_dispatcher_tests/data.py b/covalent_dispatcher/tests/data.py
similarity index 100%
rename from tests/covalent_dispatcher_tests/data.py
rename to covalent_dispatcher/tests/data.py
diff --git a/tests/covalent_dispatcher_tests/dispatchdb_test.py b/covalent_dispatcher/tests/dispatchdb_test.py
similarity index 100%
rename from tests/covalent_dispatcher_tests/dispatchdb_test.py
rename to covalent_dispatcher/tests/dispatchdb_test.py
diff --git a/tests/covalent_dispatcher_tests/dispatcher_service_app_test.py b/covalent_dispatcher/tests/dispatcher_service_app_test.py
similarity index 100%
rename from tests/covalent_dispatcher_tests/dispatcher_service_app_test.py
rename to covalent_dispatcher/tests/dispatcher_service_app_test.py
diff --git a/tests/covalent_dispatcher_tests/init_test.py b/covalent_dispatcher/tests/init_test.py
similarity index 100%
rename from tests/covalent_dispatcher_tests/init_test.py
rename to covalent_dispatcher/tests/init_test.py
diff --git a/refactor/client_side/tests/__init__.py b/refactor/client_side/tests/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/refactor/data/tests/__init__.py b/refactor/data/tests/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/refactor/executor/tests/__init__.py b/refactor/executor/tests/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/refactor/results/tests/__init__.py b/refactor/results/tests/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/refactor/runner/tests/__init__.py b/refactor/runner/tests/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/refactor/ui_backend/tests/__init__.py b/refactor/ui_backend/tests/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/test.py b/test.py
deleted file mode 100644
index 44e4eb819..000000000
--- a/test.py
+++ /dev/null
@@ -1,18 +0,0 @@
-import covalent as ct
-
-endpoints = [ct.notify.NotifySlack(display_name="will")]
-
-
-@ct.electron
-def my_task(x, y):
-    return x + y
-
-
-@ct.lattice(notify=endpoints)
-def workflow(x, y):
-    return my_task(x, y)
-
-
-if __name__ == "__main__":
-    result = ct.dispatch_sync(workflow)(1, 2)
-    print(result)
diff --git a/tests/covalent_dispatcher_tests/dispatcher_stack_test.py b/tests/dispatcher_stack_test.py
similarity index 94%
rename from tests/covalent_dispatcher_tests/dispatcher_stack_test.py
rename to tests/dispatcher_stack_test.py
index 9e60ae6ce..bfb182e67 100644
--- a/tests/covalent_dispatcher_tests/dispatcher_stack_test.py
+++ b/tests/dispatcher_stack_test.py
@@ -28,8 +28,12 @@
 from covalent._results_manager import results_manager as rm
 from covalent._shared_files.defaults import parameter_prefix
 from covalent_dispatcher._db.dispatchdb import DispatchDB
-
-from .data import TEST_RESULTS_DIR, get_mock_result, get_mock_result_2, get_mock_result_3
+from covalent_dispatcher.tests.data import (
+    TEST_RESULTS_DIR,
+    get_mock_result,
+    get_mock_result_2,
+    get_mock_result_3,
+)
 
 
 @pytest.mark.parametrize(