Skip to content

Commit

Permalink
Lock .NET template version to 3.2.0 (#624)
Browse files Browse the repository at this point in the history
* Lock .NET template version to 3.2.0

* Bump version

* Update dotnet install cmd

* Update dotnet new cmd args

* Update dotnet new cmd args

* Enable solution tests

* Enable solution tests

* Enable solution tests
  • Loading branch information
marianan authored Mar 13, 2024
1 parent 0d30f73 commit 8765d71
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 41 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion iotedgedev/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

__author__ = 'Microsoft Corporation'
__email__ = '[email protected]'
__version__ = '3.3.7'
__version__ = '3.3.8'
__AIkey__ = '95b20d64-f54f-4de3-8ad5-165a75a6c6fe'
3 changes: 2 additions & 1 deletion iotedgedev/dotnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.3.7
current_version = 3.3.8
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = 'Microsoft Corporation'
__email__ = '[email protected]'
__version__ = '3.3.7'
__version__ = '3.3.8'
72 changes: 36 additions & 36 deletions tests/test_iotedgedev_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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")

0 comments on commit 8765d71

Please sign in to comment.