diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bac258e..c5825330 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project since 0.82.0 will be documented in this file. +## [3.3.8] - 2024-03-11 + +- Lock .NET Microsoft.Azure.IoT.Edge.Module version at 3.2.0 + ## [3.3.7] - 2022-11-7 - Lock simulator version at 0.14.18 diff --git a/iotedgedev/__init__.py b/iotedgedev/__init__.py index 23327ede..ac53d24f 100644 --- a/iotedgedev/__init__.py +++ b/iotedgedev/__init__.py @@ -2,5 +2,5 @@ __author__ = 'Microsoft Corporation' __email__ = 'opencode@microsoft.com' -__version__ = '3.3.7' +__version__ = '3.3.8' __AIkey__ = '95b20d64-f54f-4de3-8ad5-165a75a6c6fe' diff --git a/iotedgedev/dotnet.py b/iotedgedev/dotnet.py index b8d73852..3999bf35 100644 --- a/iotedgedev/dotnet.py +++ b/iotedgedev/dotnet.py @@ -11,7 +11,8 @@ def __init__(self, output, utility): self.utility.check_dependency(["dotnet", "--version"], "To add new C# modules and C# Functions modules, the .NET Core SDK") def install_module_template(self): - cmd = "dotnet new -i Microsoft.Azure.IoT.Edge.Module" + # Use C# module template version 3.2.0; this is the last version before the upgrdae to .NET 7 which no longer uses dockerfiles + cmd = "dotnet new -i Microsoft.Azure.IoT.Edge.Module::3.2.0 --force" self.output.header(cmd) self.utility.exe_proc(cmd.split()) diff --git a/setup.cfg b/setup.cfg index 29fd4f88..ba2a456e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.3.7 +current_version = 3.3.8 commit = True tag = True diff --git a/setup.py b/setup.py index 153400f0..46648740 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ setup( name='iotedgedev', - version='3.3.7', + version='3.3.8', description='The Azure IoT Edge Dev Tool greatly simplifies the IoT Edge development process by automating many routine manual tasks, such as building, deploying, pushing modules and configuring the IoT Edge Runtime.', long_description='See https://github.com/azure/iotedgedev for usage instructions.', author='Microsoft Corporation', diff --git a/tests/__init__.py b/tests/__init__.py index e8de78dc..6b0dbbdd 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,4 +2,4 @@ __author__ = 'Microsoft Corporation' __email__ = 'opencode@microsoft.com' -__version__ = '3.3.7' +__version__ = '3.3.8' diff --git a/tests/test_iotedgedev_solution.py b/tests/test_iotedgedev_solution.py index a315cacb..3c6b2d7f 100644 --- a/tests/test_iotedgedev_solution.py +++ b/tests/test_iotedgedev_solution.py @@ -260,21 +260,21 @@ def test_valid_env_device_connectionstring(): assert connectionstring.device_id -# def test_create_new_solution(): -# os.chdir(tests_dir) -# clean_folder(test_solution_dir) -# -# for template in templates: -# # Node.js modules is skipped on non-Windows for below known issue. -# # https://github.com/Azure/iotedgedev/issues/312 -# # https://github.com/Azure/iotedgedev/issues/346 -# if (template == "nodejs") and (platform.system().lower() != 'windows'): -# continue -# else: -# result = create_solution(template) -# assert_solution_folder_structure(template) -# assert 'AZURE IOT EDGE SOLUTION CREATED' in result.output -# clean_folder(test_solution_dir) +def test_create_new_solution(): + os.chdir(tests_dir) + clean_folder(test_solution_dir) + + for template in templates: + # Node.js modules is skipped on non-Windows for below known issue. + # https://github.com/Azure/iotedgedev/issues/312 + # https://github.com/Azure/iotedgedev/issues/346 + if (template == "nodejs") and (platform.system().lower() != 'windows'): + continue + else: + result = create_solution(template) + assert_solution_folder_structure(template) + assert 'AZURE IOT EDGE SOLUTION CREATED' in result.output + clean_folder(test_solution_dir) # def test_solution_push_with_default_platform(prepare_solution_with_env): @@ -433,24 +433,24 @@ def test_gen_config_with_non_string_placeholder(): assert "ERROR" not in result.output -# @mock.patch.dict(os.environ, {"CONTAINER_REGISTRY_SERVER": "localhost:5000"}) -# @pytest.mark.skipif(get_docker_os_type() == 'windows', reason='windows container does not support local registry image') -# def test_push_modules_to_local_registry(prepare_solution_with_env): -# try: -# module_name = "filtermodule" -# -# if module_name in get_all_docker_images(): -# remove_docker_image(module_name) -# -# result = runner_invoke(['push', '-P', get_platform_type()]) -# -# assert 'ERROR' not in result.output -# assert result.exit_code == 0 -# assert 'BUILD COMPLETE' in result.output -# assert 'PUSH COMPLETE' in result.output -# assert f"localhost:5000/{module_name in get_all_docker_images()}" -# finally: -# if "registry" in get_all_docker_containers(): -# remove_docker_container("registry") -# if "registry" in get_all_docker_images(): -# remove_docker_image("registry:2") +@mock.patch.dict(os.environ, {"CONTAINER_REGISTRY_SERVER": "localhost:5000"}) +@pytest.mark.skipif(get_docker_os_type() == 'windows', reason='windows container does not support local registry image') +def test_push_modules_to_local_registry(prepare_solution_with_env): + try: + module_name = "filtermodule" + + if module_name in get_all_docker_images(): + remove_docker_image(module_name) + + result = runner_invoke(['push', '-P', get_platform_type()]) + + assert 'ERROR' not in result.output + assert result.exit_code == 0 + assert 'BUILD COMPLETE' in result.output + assert 'PUSH COMPLETE' in result.output + assert f"localhost:5000/{module_name in get_all_docker_images()}" + finally: + if "registry" in get_all_docker_containers(): + remove_docker_container("registry") + if "registry" in get_all_docker_images(): + remove_docker_image("registry:2")