From e1416146a2e244eb8e5a6df50e471e5e81621592 Mon Sep 17 00:00:00 2001 From: zhenyu-ms <111329301+zhenyu-ms@users.noreply.github.com> Date: Thu, 2 Jan 2025 17:44:39 +0800 Subject: [PATCH] fix test; make package use dev version by default --- testplan/exporters/testing/xml/__init__.py | 6 ++++-- testplan/version.py | 2 +- tests/functional/testplan/cli/data/curr.data | 4 ++++ tests/functional/testplan/runnable/interactive/test_api.py | 3 --- .../testplan/runnable/interactive/test_interactive.py | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/testplan/exporters/testing/xml/__init__.py b/testplan/exporters/testing/xml/__init__.py index c70464267..74973cd30 100644 --- a/testplan/exporters/testing/xml/__init__.py +++ b/testplan/exporters/testing/xml/__init__.py @@ -292,9 +292,11 @@ def export( ) xml_dir = pathlib.Path(self.cfg.xml_dir).resolve() - # TODO: what if xml_dir is a file? if xml_dir.exists(): - shutil.rmtree(xml_dir) + if xml_dir.is_dir(): + shutil.rmtree(xml_dir) + else: + xml_dir.unlink() xml_dir.mkdir(parents=True, exist_ok=True) diff --git a/testplan/version.py b/testplan/version.py index 8853ae594..2ed8a826a 100644 --- a/testplan/version.py +++ b/testplan/version.py @@ -3,7 +3,7 @@ __version__ = "24.9.2" -dev_build = int(os.environ.get("DEV_BUILD", "0")) +dev_build = int(os.environ.get("DEV_BUILD", "1")) dev_suffix = f"dev{int(time.time())}" if dev_build else "" __build_version__ = f"{__version__}{dev_suffix}" diff --git a/tests/functional/testplan/cli/data/curr.data b/tests/functional/testplan/cli/data/curr.data index 150a9429a..3dfb4ac5a 100644 --- a/tests/functional/testplan/cli/data/curr.data +++ b/tests/functional/testplan/cli/data/curr.data @@ -499,6 +499,10 @@ "label": null, "tags_index": {}, "information": [ + [ + "testplan_version", + "24.9.2.dev1735810598" + ], [ "user", "unknown" diff --git a/tests/functional/testplan/runnable/interactive/test_api.py b/tests/functional/testplan/runnable/interactive/test_api.py index 4a7149de6..28e2957bb 100644 --- a/tests/functional/testplan/runnable/interactive/test_api.py +++ b/tests/functional/testplan/runnable/interactive/test_api.py @@ -283,7 +283,6 @@ def plan3(tmpdir): ], "name": "ExampleSuite", "parent_uids": ["InteractiveAPITest", "ExampleMTest"], - "part": None, "status": "unknown", "runtime_status": "ready", "counter": { @@ -312,7 +311,6 @@ def plan3(tmpdir): ], "name": "ExampleSuite", "parent_uids": ["InteractiveAPITest", "ExampleMTest"], - "part": None, "status": "unknown", "runtime_status": "ready", "counter": {"failed": 0, "passed": 0, "total": 7, "unknown": 7}, @@ -440,7 +438,6 @@ def plan3(tmpdir): "ExampleMTest", "ExampleSuite", ], - "part": None, "runtime_status": "ready", "status": "unknown", "tags": {}, diff --git a/tests/functional/testplan/runnable/interactive/test_interactive.py b/tests/functional/testplan/runnable/interactive/test_interactive.py index b23297f43..5d526508d 100644 --- a/tests/functional/testplan/runnable/interactive/test_interactive.py +++ b/tests/functional/testplan/runnable/interactive/test_interactive.py @@ -9,7 +9,7 @@ from testplan import TestplanMock from testplan.common import entity -from testplan.common.utils.comparison import compare, ReportOptions +from testplan.common.utils.comparison import compare from testplan.common.utils.context import context from testplan.common.utils.logger import USER_INFO from testplan.common.utils.timing import wait