Skip to content

feat: add dotnet8 support #587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 16, 2024
Merged

feat: add dotnet8 support #587

merged 3 commits into from
Feb 16, 2024

Conversation

Beau-Gosse-dev
Copy link
Contributor

Description of changes:
Adding .NET 8 Support and tests for .NET 8 Lambda managed runtime

Also fixing a failing 2 unit tests in tests/functional/test_actions.py

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Beau-Gosse-dev Beau-Gosse-dev requested a review from a team as a code owner December 11, 2023 08:09
@github-actions github-actions bot added pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Dec 11, 2023
@Beau-Gosse-dev
Copy link
Contributor Author

FYI: @mndeveci @hawflau

@Beau-Gosse-dev Beau-Gosse-dev marked this pull request as draft December 11, 2023 08:23
@Beau-Gosse-dev Beau-Gosse-dev marked this pull request as ready for review December 14, 2023 00:54
@@ -30,7 +30,7 @@ def test_copy_dependencies_action(self, source_folder):
copy_dependencies_action = CopyDependenciesAction(empty_source, test_folder, target)
copy_dependencies_action.execute()

self.assertEqual(os.listdir(test_folder), os.listdir(target))
self.assertEqual(collections.Counter(os.listdir(test_folder)), collections.Counter(os.listdir(target)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we need to use collections.Counter here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order of the files in the directory was different causing the test to fail. I assume this test doesn't care if the order comes out differently from listdir and just that all the files exist in both places. collections.Counter counts the instances of each file by key and allows to compare without order. At least that was the idea. We could also sort the output.

Copy link
Contributor

@hawflau hawflau Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also convert them to set, so we don't need to import collections.

Suggested change
self.assertEqual(collections.Counter(os.listdir(test_folder)), collections.Counter(os.listdir(target)))
self.assertEqual(set(os.listdir(test_folder)), set(os.listdir(target)))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. Updated

Copy link
Contributor

@hawflau hawflau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some the error log from dotnet cli was not shown properly. I created another draft PR and print the stdout and stderr from dotnet cli so pytest could capture them (https://github.com/aws/aws-lambda-builders/actions/runs/7218998949/job/19669306281?pr=593):

Amazon Lambda Tools for .NET Core applications (5.9.0)
Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet
	
Executing publish command
... invoking 'dotnet publish', working folder '/home/runner/work/aws-lambda-builders/aws-lambda-builders/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime6/bin/Release/net6.0/publish'
... dotnet publish "/home/runner/work/aws-lambda-builders/aws-lambda-builders/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime6" --output "/home/runner/work/aws-lambda-builders/aws-lambda-builders/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime6/bin/Release/net6.0/publish" --configuration "Release" --framework "net6.0" --runtime linux-x64 /p:GenerateRuntimeConfigurationFiles=true --self-contained False 
... publish: MSBuild version 17.8.3+195e7f5a3 for .NET
... publish:   Determining projects to restore...
... publish:   Restored /home/runner/work/aws-lambda-builders/aws-lambda-builders/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime6/CustomRuntime6.csproj (in 1.91 sec).
... publish: /home/runner/work/aws-lambda-builders/aws-lambda-builders/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime6/WithDefaultsFile6/Function.cs(9,64): error CS0234: The type or namespace name 'Json' does not exist in the namespace 'Amazon.Lambda.Serialization' (are you missing an assembly reference?) [/home/runner/work/aws-lambda-builders/aws-lambda-builders/tests/integration/workflows/dotnet_clipackage/testdata/CustomRuntime6/CustomRuntime6.csproj]
ERROR: The dotnet publish command return unsuccessful error code

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the WithDefaultsFile6 dir be under CustomRuntime6?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it shouldn't I think I just accidentally copied it over there. Sorry about that. It already exists at the higher level here: https://github.com/aws/aws-lambda-builders/tree/develop/tests/integration/workflows/dotnet_clipackage/testdata/WithDefaultsFile6

@hawflau hawflau added this pull request to the merge queue Feb 16, 2024
Merged via the queue into aws:develop with commit c5d5c83 Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants