Browse Source

Moved pycharm_targets to conandata

Added individual tests. Still not everything

Contributes to CURA-8827
j.spijker@ultimaker.com 2 years ago
parent
commit
c5acaa768b
3 changed files with 119 additions and 30 deletions
  1. 6 8
      .run_templates/pycharm_cura_test.run.xml.jinja
  2. 110 0
      conandata.yml
  3. 3 22
      conanfile.py

+ 6 - 8
.run_templates/pycharm_cura_test.run.xml.jinja

@@ -13,13 +13,11 @@
     <option name="ADD_CONTENT_ROOTS" value="true" />
     <option name="ADD_SOURCE_ROOTS" value="true" />
     <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
-    <option name="SCRIPT_NAME" value="$PROJECT_DIR$/{{ script_name }}" />
-    <option name="PARAMETERS" value="{{ parameters }}" />
-    <option name="SHOW_COMMAND_LINE" value="false" />
-    <option name="EMULATE_TERMINAL" value="false" />
-    <option name="MODULE_MODE" value="false" />
-    <option name="REDIRECT_INPUT" value="false" />
-    <option name="INPUT_FILE" value="" />
+    <option name="_new_keywords" value="&quot;&quot;" />
+    <option name="_new_parameters" value="&quot;&quot;" />
+    <option name="_new_additionalArguments" value="&quot;&quot;" />
+    <option name="_new_target" value="&quot;$PROJECT_DIR$/{{ script_name }}&quot;" />
+    <option name="_new_targetType" value="&quot;PATH&quot;" />
     <method v="2" />
   </configuration>
-</component>
+</component>

+ 110 - 0
conandata.yml

@@ -286,3 +286,113 @@
             Windows: "./icons/Cura.ico"
             Macos: "./icons/cura.icns"
             Linux: "./icons/cura-128.png"
+pycharm_targets:
+    - jinja_path: .run_templates/pycharm_cura_run.run.xml.jinja
+      module_name: Cura
+      name: cura
+      script_name: cura_app.py
+    - jinja_path: .run_templates/pycharm_cura_run.run.xml.jinja
+      module_name: Cura
+      name: cura_external_engine
+      parameters: --external-backend
+      script_name: cura_app.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in tests
+      script_name: tests/
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestBuildVolume.py
+      script_name: tests/TestBuildVolume.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestConvexHullDecorator.py
+      script_name: tests/TestConvexHullDecorator.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestCuraSceneNode.py
+      script_name: tests/TestCuraSceneNode.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestCuraSceneNode.py
+      script_name: tests/TestExtruderManager.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestGCodeListDecorator.py
+      script_name: tests/TestGCodeListDecorator.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestIntentManager.py
+      script_name: tests/TestIntentManager.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestLayer.py
+      script_name: tests/TestLayer.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestMachineAction.py
+      script_name: tests/TestMachineAction.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestMachineManager.py
+      script_name: tests/TestMachineManager.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestOAuth2.py
+      script_name: tests/TestOAuth2.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestObjectsModel.py
+      script_name: tests/TestObjectsModel.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestPrintInformation.py
+      script_name: tests/TestPrintInformation.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestProfileRequirements.py
+      script_name: tests/TestProfileRequirements.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestThemes.py
+      script_name: tests/TestThemes.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestContainerManager.py
+      script_name: tests/Settings/TestContainerManager.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestCuraContainerRegistry.py
+      script_name: tests/Settings/TestCuraContainerRegistry.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestCuraStackBuilder.py
+      script_name: tests/Settings/TestCuraStackBuilder.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestDefinitionContainer.py
+      script_name: tests/Settings/TestDefinitionContainer.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestExtruderStack.py
+      script_name: tests/Settings/TestExtruderStack.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestGlobalStack.py
+      script_name: tests/Settings/TestGlobalStack.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestProfiles.py
+      script_name: tests/Settings/TestProfiles.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestSettingInheritanceManager.py
+      script_name: tests/Settings/TestSettingInheritanceManager.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestSettingOverrideDecorator.py
+      script_name: tests/Settings/TestSettingOverrideDecorator.py
+    - jinja_path: .run_templates/pycharm_cura_test.run.xml.jinja
+      module_name: Cura
+      name: pytest in TestSettingVisibilityPresets.py
+      script_name: tests/Settings/TestSettingVisibilityPresets.py

+ 3 - 22
conanfile.py

@@ -52,28 +52,9 @@ class CuraConan(ConanFile):
         "revision": "auto"
     }
 
-    # TODO: Add unit tests (but they need a different jinja template
-    _pycharm_targets = [
-        {
-            "name": "cura",
-            "module_name": "Cura",
-            "script_name": "cura_app.py",
-            "jinja_path": ".run_templates/pycharm_cura_run.run.xml.jinja"
-        },
-        {
-            "name": "cura_external_engine",
-            "module_name": "Cura",
-            "script_name": "cura_app.py",
-            "parameters": "--external-backend",
-            "jinja_path": ".run_templates/pycharm_cura_run.run.xml.jinja"
-        },
-        {
-            "name": "cura_test",
-            "module_name": "Cura",
-            "script_name": "run_coverage.py",
-            "jinja_path": ".run_templates/pycharm_cura_test.run.xml.jinja"
-        },
-    ]
+    @property
+    def _pycharm_targets(self):
+        return self.conan_data["pycharm_targets"]
 
     # FIXME: These env vars should be defined in the runenv.
     _cura_env = None