Repository: teemtee/tmt (language: python)

Issue:
Testing `examples`
I am not sure if the `examples` folder is being tested? If not I think it would be useful to symlink the example folders inside a `tests/examples` folder. That way you can add testing scripts, while keeping the `examples` folder minimal and navigable.


Discussion / hints:

Fix patch:
diff --git a/examples/plugins/pyproject.toml b/examples/plugins/pyproject.toml
new file mode 100644
index 0000000000..126126bf99
--- /dev/null
+++ b/examples/plugins/pyproject.toml
@@ -0,0 +1,21 @@
+[build-system]
+# Using hatchling as build backend because EPEL9 setuptools (53.0.0) does not build with PEP517 properly
+requires = ["hatchling"]
+build-backend = "hatchling.build"
+
+[project]
+name = "demo-plugins"
+version = "0.0.1"
+dependencies = [
+    "tmt",
+    ]
+
+[tool.hatch.build.targets.wheel]
+packages = [
+    "discover.py",
+    "provision.py",
+]
+
+[project.entry-points."tmt.plugin"]
+ProvisionExample = "provision:ProvisionExample"
+DiscoverExample = "discover:DiscoverExample"
diff --git a/examples/plugins/setup.py b/examples/plugins/setup.py
deleted file mode 100644
index e7adf17146..0000000000
--- a/examples/plugins/setup.py
+++ /dev/null
@@ -1,13 +0,0 @@
-from setuptools import setup
-
-setup(
-    name='demo-plugins',
-    version='0.0.1',
-    py_modules=['discover', 'provision'],
-    entry_points={
-        'tmt.plugin': [
-            'ProvisionExample = provision:ProvisionExample',
-            'DiscoverExample = discover:DiscoverExample',
-            ]
-        }
-    )


Test patch:
diff --git a/tests/plugins/test.sh b/tests/plugins/test.sh
index 4d43c863da..e5dd76c97a 100755
--- a/tests/plugins/test.sh
+++ b/tests/plugins/test.sh
@@ -40,9 +40,6 @@ rlJournalStart
     rlPhaseEnd
 
     rlPhaseStartTest "Using TMT_PLUGINS"
-        # setup.py is not a plugin and cannot be loaded
-        rlRun "mv ./plugins/setup.py ./plugins/setup.XXX"
-
         # Plugins are not available before
         rlRun -s "$tmt run discover -h example --help" "2"
         rlAssertGrep "Unsupported discover method" "$rlRun_LOG"
@@ -53,9 +50,6 @@ rlJournalStart
         rlRun "export TMT_PLUGINS=./plugins"
         rlRun "$tmt run discover -h example --help"
         rlRun "$tmt run provision -h example --help"
-
-        rlRun "unset TMT_PLUGINS"
-        rlRun "mv ./plugins/setup.XXX ./plugins/setup.py"
     rlPhaseEnd
 
     rlPhaseStartCleanup