From 3c20ab296a70f4a1424c11e4192af74d838dd1c1 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 2 Dec 2022 17:48:35 +0100 Subject: [PATCH 1/3] Added --dev flag to cpl run & start #124 --- src/cpl_cli/command/run_service.py | 17 +++++++++++- .../live_server/live_server_service.py | 23 ++++++++++++++-- src/cpl_cli/startup_argument_extension.py | 6 +++-- .../general/src/general/arguments/__init__.py | 26 +++++++++++++++++++ .../custom/general/src/general/db/__init__.py | 7 ++--- tests/custom/general/src/general/general.json | 8 +++--- unittests/unittests_cli/run_test_case.py | 7 ++--- unittests/unittests_shared/cli_commands.py | 10 ++++--- 8 files changed, 84 insertions(+), 20 deletions(-) diff --git a/src/cpl_cli/command/run_service.py b/src/cpl_cli/command/run_service.py index 7aa4e456..92583f95 100644 --- a/src/cpl_cli/command/run_service.py +++ b/src/cpl_cli/command/run_service.py @@ -8,6 +8,7 @@ from cpl_cli.configuration import WorkspaceSettings from cpl_cli.configuration.build_settings import BuildSettings from cpl_cli.configuration.project_settings import ProjectSettings from cpl_cli.live_server.start_executable import StartExecutable +from cpl_cli.publish import PublisherService from cpl_core.configuration import ConfigurationABC from cpl_core.console.console import Console from cpl_core.dependency_injection import ServiceProviderABC @@ -22,7 +23,8 @@ class RunService(CommandABC): services: ServiceProviderABC, project_settings: ProjectSettings, build_settings: BuildSettings, - workspace: WorkspaceSettings + workspace: WorkspaceSettings, + publisher: PublisherService, ): """ Service for the CLI command start @@ -41,8 +43,10 @@ class RunService(CommandABC): self._project_settings = project_settings self._build_settings = build_settings self._workspace = workspace + self._publisher = publisher self._src_dir = os.path.join(self._env.working_directory, self._build_settings.source_path) + self._is_dev = False @property def help_message(self) -> str: @@ -80,16 +84,27 @@ class RunService(CommandABC): self._src_dir = os.path.dirname(json_file) + def _build(self): + if self._is_dev: + return + self._publisher.build() + def execute(self, args: list[str]): """ Entry point of command :param args: :return: """ + if 'dev' in args: + self._is_dev = True + args.remove('dev') + if len(args) >= 1: self._set_project_by_args(args[0]) args.remove(args[0]) + self._build() + start_service = StartExecutable(self._env, self._build_settings) start_service.run(args, self._project_settings.python_executable, self._src_dir, output=False) Console.write_line() diff --git a/src/cpl_cli/live_server/live_server_service.py b/src/cpl_cli/live_server/live_server_service.py index e9bb40b6..c51c9c58 100644 --- a/src/cpl_cli/live_server/live_server_service.py +++ b/src/cpl_cli/live_server/live_server_service.py @@ -6,6 +6,7 @@ import psutil as psutil from watchdog.events import FileSystemEventHandler from watchdog.observers import Observer +from cpl_cli.publish import PublisherService from cpl_core.console.console import Console from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC from cpl_cli.configuration.build_settings import BuildSettings @@ -15,8 +16,13 @@ from cpl_cli.live_server.live_server_thread import LiveServerThread class LiveServerService(FileSystemEventHandler): - def __init__(self, env: ApplicationEnvironmentABC, project_settings: ProjectSettings, - build_settings: BuildSettings): + def __init__( + self, + env: ApplicationEnvironmentABC, + project_settings: ProjectSettings, + build_settings: BuildSettings, + publisher: PublisherService, + ): """ Service for the live development server :param env: @@ -28,12 +34,14 @@ class LiveServerService(FileSystemEventHandler): self._env = env self._project_settings = project_settings self._build_settings = build_settings + self._publisher = publisher self._src_dir = os.path.join(self._env.working_directory, self._build_settings.source_path) self._ls_thread = None self._observer = None self._args: list[str] = [] + self._is_dev = False def _start_observer(self): """ @@ -87,6 +95,11 @@ class LiveServerService(FileSystemEventHandler): self._ls_thread.join() Console.close() + def _build(self): + if self._is_dev: + return + self._publisher.build() + def start(self, args: list[str]): """ Starts the CPL live development server @@ -97,6 +110,12 @@ class LiveServerService(FileSystemEventHandler): Console.error('Project has no entry point.') return + if 'dev' in args: + self._is_dev = True + args.remove('dev') + + self._build() + self._args = args Console.write_line('** CPL live development server is running **') self._start() diff --git a/src/cpl_cli/startup_argument_extension.py b/src/cpl_cli/startup_argument_extension.py index de57d9c3..16bd5449 100644 --- a/src/cpl_cli/startup_argument_extension.py +++ b/src/cpl_cli/startup_argument_extension.py @@ -60,8 +60,10 @@ class StartupArgumentExtension(StartupExtensionABC): config.create_console_argument(ArgumentTypeEnum.Executable, '', 'publish', ['p', 'P'], PublishService, True, validators=[ProjectValidator]) config.create_console_argument(ArgumentTypeEnum.Executable, '', 'remove', ['r', 'R'], RemoveService, True, validators=[WorkspaceValidator]) \ .add_console_argument(ArgumentTypeEnum.Flag, '--', 'simulate', ['s', 'S']) - config.create_console_argument(ArgumentTypeEnum.Executable, '', 'run', [], RunService, True, validators=[ProjectValidator]) - config.create_console_argument(ArgumentTypeEnum.Executable, '', 'start', ['s', 'S'], StartService, True, validators=[ProjectValidator]) + config.create_console_argument(ArgumentTypeEnum.Executable, '', 'run', [], RunService, True, validators=[ProjectValidator]) \ + .add_console_argument(ArgumentTypeEnum.Flag, '--', 'dev', ['d', 'D']) + config.create_console_argument(ArgumentTypeEnum.Executable, '', 'start', ['s', 'S'], StartService, True, validators=[ProjectValidator]) \ + .add_console_argument(ArgumentTypeEnum.Flag, '--', 'dev', ['d', 'D']) config.create_console_argument(ArgumentTypeEnum.Executable, '', 'uninstall', ['ui', 'UI'], UninstallService, True, validators=[ProjectValidator]) \ .add_console_argument(ArgumentTypeEnum.Flag, '--', 'dev', ['d', 'D']) \ .add_console_argument(ArgumentTypeEnum.Flag, '--', 'virtual', ['v', 'V']) \ diff --git a/tests/custom/general/src/general/arguments/__init__.py b/tests/custom/general/src/general/arguments/__init__.py index e69de29b..a1515376 100644 --- a/tests/custom/general/src/general/arguments/__init__.py +++ b/tests/custom/general/src/general/arguments/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- + +""" +general sh-edraft Common Python library +~~~~~~~~~~~~~~~~~~~ + +sh-edraft Common Python library + +:copyright: (c) 2020 - 2021 sh-edraft.de +:license: MIT, see LICENSE for more details. + +""" + +__title__ = 'general.arguments' +__author__ = 'Sven Heidemann' +__license__ = 'MIT' +__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de' +__version__ = '2021.4.1' + +from collections import namedtuple + + +# imports: + +VersionInfo = namedtuple('VersionInfo', 'major minor micro') +version_info = VersionInfo(major='2021', minor='04', micro='01') diff --git a/tests/custom/general/src/general/db/__init__.py b/tests/custom/general/src/general/db/__init__.py index 746ca0b0..099d021f 100644 --- a/tests/custom/general/src/general/db/__init__.py +++ b/tests/custom/general/src/general/db/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -sh_cpl sh-edraft Common Python library +general sh-edraft Common Python library ~~~~~~~~~~~~~~~~~~~ sh-edraft Common Python library @@ -11,7 +11,7 @@ sh-edraft Common Python library """ -__title__ = 'tests.db' +__title__ = 'general.db' __author__ = 'Sven Heidemann' __license__ = 'MIT' __copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de' @@ -19,7 +19,8 @@ __version__ = '2021.4.1' from collections import namedtuple + # imports: VersionInfo = namedtuple('VersionInfo', 'major minor micro') -version_info = VersionInfo(major=2021, minor=4, micro=1) +version_info = VersionInfo(major='2021', minor='04', micro='01') diff --git a/tests/custom/general/src/general/general.json b/tests/custom/general/src/general/general.json index 0bf4dded..aa7ce5d7 100644 --- a/tests/custom/general/src/general/general.json +++ b/tests/custom/general/src/general/general.json @@ -16,12 +16,12 @@ "LicenseName": "MIT", "LicenseDescription": "MIT, see LICENSE for more details.", "Dependencies": [ - "cpl-core==2022.10rc2", - "cpl-translation==2022.10rc2", - "cpl-query==2022.10rc2" + "cpl-core==2022.10.0.post9", + "cpl-translation==2022.10.0.post2", + "cpl-query==2022.10.0.post2" ], "DevDependencies": [ - "cpl-cli==2022.10.rc2" + "cpl-cli==2022.10" ], "PythonVersion": ">=3.10", "PythonPath": { diff --git a/unittests/unittests_cli/run_test_case.py b/unittests/unittests_cli/run_test_case.py index 23841a79..eeaf05b5 100644 --- a/unittests/unittests_cli/run_test_case.py +++ b/unittests/unittests_cli/run_test_case.py @@ -46,9 +46,6 @@ class RunTestCase(CommandTestCase): project_file.close() def setUp(self): - if not os.path.exists(PLAYGROUND_PATH): - os.makedirs(PLAYGROUND_PATH) - os.chdir(PLAYGROUND_PATH) # create projects CLICommands.new('console', self._source, '--ab', '--s') @@ -60,7 +57,7 @@ class RunTestCase(CommandTestCase): file.close() def test_run(self): - CLICommands.run() + CLICommands.run(is_dev=True, output=True) settings = self._get_appsettings() self.assertNotEqual(settings, {}) self.assertIn('RunTest', settings) @@ -72,7 +69,7 @@ class RunTestCase(CommandTestCase): def test_run_by_project(self): os.chdir(os.path.join(os.getcwd())) - CLICommands.run(self._source) + CLICommands.run(self._source, is_dev=True) settings = self._get_appsettings() self.assertNotEqual(settings, {}) self.assertIn('RunTest', settings) diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index eb0f2f1f..3d2b0442 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -65,11 +65,15 @@ class CLICommands: cls._run('remove', project, output=output) @classmethod - def run(cls, project: str = None, output=False): + def run(cls, project: str = None, is_dev=False, output=False): + dev = '' + if is_dev: + dev = '--dev' + if project is None: - cls._run('run', output=output) + cls._run('run', dev, output=output) return - cls._run('run', project, output=output) + cls._run('run', project, dev, output=output) @classmethod def start(cls, output=False): From d0877a4ea634223d71bb5ca8a2ba2a63a025fa74 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 2 Dec 2022 18:41:58 +0100 Subject: [PATCH 2/3] Added logic to run build code to cpl run #124 --- src/cpl_cli/command/run_service.py | 10 ++++ unittests/unittests_cli/run_test_case.py | 64 +++++++++++++++++++--- unittests/unittests_shared/cli_commands.py | 8 +-- 3 files changed, 71 insertions(+), 11 deletions(-) diff --git a/src/cpl_cli/command/run_service.py b/src/cpl_cli/command/run_service.py index 92583f95..e3740e00 100644 --- a/src/cpl_cli/command/run_service.py +++ b/src/cpl_cli/command/run_service.py @@ -13,6 +13,7 @@ from cpl_core.configuration import ConfigurationABC from cpl_core.console.console import Console from cpl_core.dependency_injection import ServiceProviderABC from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC +from cpl_core.utils import String class RunService(CommandABC): @@ -87,7 +88,16 @@ class RunService(CommandABC): def _build(self): if self._is_dev: return + + self._env.set_working_directory(self._src_dir) self._publisher.build() + self._src_dir = os.path.abspath(os.path.join( + self._src_dir, + self._build_settings.output_path, + self._project_settings.name, + 'build', + String.convert_to_snake_case(self._project_settings.name) + )) def execute(self, args: list[str]): """ diff --git a/unittests/unittests_cli/run_test_case.py b/unittests/unittests_cli/run_test_case.py index eeaf05b5..a44ded36 100644 --- a/unittests/unittests_cli/run_test_case.py +++ b/unittests/unittests_cli/run_test_case.py @@ -15,10 +15,10 @@ class RunTestCase(CommandTestCase): CommandTestCase.__init__(self, method_name) self._source = 'run-test' self._project_file = f'src/{String.convert_to_snake_case(self._source)}/{self._source}.json' - self._appsettings = f'src/{String.convert_to_snake_case(self._source)}/appsettings.json' self._application = f'src/{String.convert_to_snake_case(self._source)}/application.py' self._test_code = f""" import json + import os settings = dict() with open('appsettings.json', 'r', encoding='utf-8') as cfg: # load json @@ -26,14 +26,19 @@ class RunTestCase(CommandTestCase): cfg.close() settings['RunTest']['WasStarted'] = 'True' + settings['RunTest']['Path'] = os.path.dirname(os.path.realpath(__file__)) with open('appsettings.json', 'w', encoding='utf-8') as project_file: project_file.write(json.dumps(settings, indent=2)) project_file.close() """ - def _get_appsettings(self): - with open(os.path.join(os.getcwd(), self._appsettings), 'r', encoding='utf-8') as cfg: + def _get_appsettings(self, is_dev=False): + appsettings = f'dist/{self._source}/build/{String.convert_to_snake_case(self._source)}/appsettings.json' + if is_dev: + appsettings = f'src/{String.convert_to_snake_case(self._source)}/appsettings.json' + + with open(os.path.join(os.getcwd(), appsettings), 'r', encoding='utf-8') as cfg: # load json project_json = json.load(cfg) cfg.close() @@ -41,7 +46,7 @@ class RunTestCase(CommandTestCase): return project_json def _save_appsettings(self, settings: dict): - with open(os.path.join(os.getcwd(), self._appsettings), 'w', encoding='utf-8') as project_file: + with open(os.path.join(os.getcwd(), f'src/{String.convert_to_snake_case(self._source)}/appsettings.json'), 'w', encoding='utf-8') as project_file: project_file.write(json.dumps(settings, indent=2)) project_file.close() @@ -57,7 +62,7 @@ class RunTestCase(CommandTestCase): file.close() def test_run(self): - CLICommands.run(is_dev=True, output=True) + CLICommands.run() settings = self._get_appsettings() self.assertNotEqual(settings, {}) self.assertIn('RunTest', settings) @@ -66,10 +71,17 @@ class RunTestCase(CommandTestCase): 'True', settings['RunTest']['WasStarted'] ) + self.assertNotEqual( + os.path.join(os.getcwd(), f'src/{String.convert_to_snake_case(self._source)}'), + settings['RunTest']['Path'] + ) + self.assertEqual( + os.path.join(os.getcwd(), f'dist/{self._source}/build/{String.convert_to_snake_case(self._source)}'), + settings['RunTest']['Path'] + ) def test_run_by_project(self): - os.chdir(os.path.join(os.getcwd())) - CLICommands.run(self._source, is_dev=True) + CLICommands.run(self._source) settings = self._get_appsettings() self.assertNotEqual(settings, {}) self.assertIn('RunTest', settings) @@ -78,3 +90,41 @@ class RunTestCase(CommandTestCase): 'True', settings['RunTest']['WasStarted'] ) + self.assertNotEqual( + os.path.join(os.getcwd(), f'src/{String.convert_to_snake_case(self._source)}'), + settings['RunTest']['Path'] + ) + self.assertEqual( + os.path.join(os.getcwd(), f'dist/{self._source}/build/{String.convert_to_snake_case(self._source)}'), + settings['RunTest']['Path'] + ) + + def test_run_dev(self): + CLICommands.run(is_dev=True) + settings = self._get_appsettings(is_dev=True) + self.assertNotEqual(settings, {}) + self.assertIn('RunTest', settings) + self.assertIn('WasStarted', settings['RunTest']) + self.assertEqual( + 'True', + settings['RunTest']['WasStarted'] + ) + self.assertEqual( + os.path.join(os.getcwd(), f'src/{String.convert_to_snake_case(self._source)}'), + settings['RunTest']['Path'] + ) + + def test_run_dev_by_project(self): + CLICommands.run(self._source, is_dev=True) + settings = self._get_appsettings(is_dev=True) + self.assertNotEqual(settings, {}) + self.assertIn('RunTest', settings) + self.assertIn('WasStarted', settings['RunTest']) + self.assertEqual( + 'True', + settings['RunTest']['WasStarted'] + ) + self.assertEqual( + os.path.join(os.getcwd(), f'src/{String.convert_to_snake_case(self._source)}'), + settings['RunTest']['Path'] + ) diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index 3d2b0442..12a3a70d 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -66,14 +66,14 @@ class CLICommands: @classmethod def run(cls, project: str = None, is_dev=False, output=False): - dev = '' + args = [] if is_dev: - dev = '--dev' + args.append('--dev') if project is None: - cls._run('run', dev, output=output) + cls._run('run', *args, output=output) return - cls._run('run', project, dev, output=output) + cls._run('run', project, *args, output=output) @classmethod def start(cls, output=False): From 856960d7992d1a4066f64c4fa6d01310d003dff7 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 2 Dec 2022 19:38:03 +0100 Subject: [PATCH 3/3] Added logic to run build code to cpl start #124 --- .../live_server/live_server_service.py | 18 +++++-- unittests/unittests_cli/start_test_case.py | 49 +++++++++++++++++-- .../threads/start_test_thread.py | 5 +- unittests/unittests_shared/cli_commands.py | 8 ++- 4 files changed, 68 insertions(+), 12 deletions(-) diff --git a/src/cpl_cli/live_server/live_server_service.py b/src/cpl_cli/live_server/live_server_service.py index c51c9c58..7eadc8cc 100644 --- a/src/cpl_cli/live_server/live_server_service.py +++ b/src/cpl_cli/live_server/live_server_service.py @@ -12,6 +12,7 @@ from cpl_core.environment.application_environment_abc import ApplicationEnvironm from cpl_cli.configuration.build_settings import BuildSettings from cpl_cli.configuration.project_settings import ProjectSettings from cpl_cli.live_server.live_server_thread import LiveServerThread +from cpl_core.utils import String class LiveServerService(FileSystemEventHandler): @@ -37,6 +38,7 @@ class LiveServerService(FileSystemEventHandler): self._publisher = publisher self._src_dir = os.path.join(self._env.working_directory, self._build_settings.source_path) + self._wd = self._src_dir self._ls_thread = None self._observer = None @@ -83,10 +85,11 @@ class LiveServerService(FileSystemEventHandler): self._restart() def _start(self): + self._build() self._start_observer() self._ls_thread = LiveServerThread( self._project_settings.python_executable, - self._src_dir, + self._wd, self._args, self._env, self._build_settings @@ -98,7 +101,18 @@ class LiveServerService(FileSystemEventHandler): def _build(self): if self._is_dev: return + + self._env.set_working_directory(self._src_dir) + Console.disable() self._publisher.build() + Console.enable() + self._wd = os.path.abspath(os.path.join( + self._src_dir, + self._build_settings.output_path, + self._project_settings.name, + 'build', + String.convert_to_snake_case(self._project_settings.name) + )) def start(self, args: list[str]): """ @@ -114,8 +128,6 @@ class LiveServerService(FileSystemEventHandler): self._is_dev = True args.remove('dev') - self._build() - self._args = args Console.write_line('** CPL live development server is running **') self._start() diff --git a/unittests/unittests_cli/start_test_case.py b/unittests/unittests_cli/start_test_case.py index b0949f14..308450a5 100644 --- a/unittests/unittests_cli/start_test_case.py +++ b/unittests/unittests_cli/start_test_case.py @@ -21,6 +21,7 @@ class StartTestCase(CommandTestCase): self._application = f'src/{String.convert_to_snake_case(self._source)}/application.py' self._test_code = f""" import json + import os settings = dict() with open('appsettings.json', 'r', encoding='utf-8') as cfg: # load json @@ -31,14 +32,19 @@ class StartTestCase(CommandTestCase): settings['RunTest']['WasRestarted'] = 'True' settings['RunTest']['WasStarted'] = 'True' + settings['RunTest']['Path'] = os.path.dirname(os.path.realpath(__file__)) with open('appsettings.json', 'w', encoding='utf-8') as project_file: project_file.write(json.dumps(settings, indent=2)) project_file.close() """ - def _get_appsettings(self): - with open(os.path.join(os.getcwd(), self._appsettings), 'r', encoding='utf-8') as cfg: + def _get_appsettings(self, is_dev=False): + appsettings = f'dist/{self._source}/build/{String.convert_to_snake_case(self._source)}/appsettings.json' + if is_dev: + appsettings = f'src/{String.convert_to_snake_case(self._source)}/appsettings.json' + + with open(os.path.join(os.getcwd(), appsettings), 'r', encoding='utf-8') as cfg: # load json project_json = json.load(cfg) cfg.close() @@ -46,14 +52,14 @@ class StartTestCase(CommandTestCase): return project_json def _save_appsettings(self, settings: dict): - with open(os.path.join(os.getcwd(), self._appsettings), 'w', encoding='utf-8') as project_file: + with open(os.path.join(os.getcwd(), f'src/{String.convert_to_snake_case(self._source)}/appsettings.json'), 'w', encoding='utf-8') as project_file: project_file.write(json.dumps(settings, indent=2)) project_file.close() def setUp(self): if not os.path.exists(PLAYGROUND_PATH): os.makedirs(PLAYGROUND_PATH) - + os.chdir(PLAYGROUND_PATH) # create projects CLICommands.new('console', self._source, '--ab', '--s') @@ -67,6 +73,39 @@ class StartTestCase(CommandTestCase): def test_start(self): thread = StartTestThread() thread.start() + time.sleep(5) + settings = self._get_appsettings() + self.assertNotEqual(settings, {}) + self.assertIn('RunTest', settings) + self.assertIn('WasStarted', settings['RunTest']) + self.assertEqual( + 'True', + settings['RunTest']['WasStarted'] + ) + + with open(os.path.join(os.getcwd(), self._application), 'a', encoding='utf-8') as file: + file.write(f'# trigger restart (comment generated by unittest)') + file.close() + + time.sleep(5) + + settings = self._get_appsettings() + self.assertNotEqual(settings, {}) + self.assertIn('RunTest', settings) + self.assertIn('WasStarted', settings['RunTest']) + self.assertIn('WasRestarted', settings['RunTest']) + self.assertEqual( + 'True', + settings['RunTest']['WasStarted'] + ) + self.assertEqual( + 'True', + settings['RunTest']['WasRestarted'] + ) + + def test_start_dev(self): + thread = StartTestThread(is_dev=True) + thread.start() time.sleep(1) settings = self._get_appsettings() self.assertNotEqual(settings, {}) @@ -83,7 +122,7 @@ class StartTestCase(CommandTestCase): time.sleep(1) - settings = self._get_appsettings() + settings = self._get_appsettings(is_dev=True) self.assertNotEqual(settings, {}) self.assertIn('RunTest', settings) self.assertIn('WasStarted', settings['RunTest']) diff --git a/unittests/unittests_cli/threads/start_test_thread.py b/unittests/unittests_cli/threads/start_test_thread.py index 6c413e6d..e6884ed9 100644 --- a/unittests/unittests_cli/threads/start_test_thread.py +++ b/unittests/unittests_cli/threads/start_test_thread.py @@ -5,8 +5,9 @@ from unittests_shared.cli_commands import CLICommands class StartTestThread(threading.Thread): - def __init__(self): + def __init__(self, is_dev=False): threading.Thread.__init__(self, daemon=True) + self._is_dev = is_dev def run(self): - CLICommands.start(True) + CLICommands.start(is_dev=self._is_dev, output=True) diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index 12a3a70d..ad7c39ce 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -76,8 +76,12 @@ class CLICommands: cls._run('run', project, *args, output=output) @classmethod - def start(cls, output=False): - cls._run('start', output=output) + def start(cls, is_dev=False, output=False): + args = [] + if is_dev: + args.append('--dev') + + cls._run('start', *args, output=output) @classmethod def uninstall(cls, package: str, is_dev=False, output=False):