-
Notifications
You must be signed in to change notification settings - Fork 147
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
Conversation
tests/functional/test_actions.py
Outdated
@@ -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))) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
self.assertEqual(collections.Counter(os.listdir(test_folder)), collections.Counter(os.listdir(target))) | |
self.assertEqual(set(os.listdir(test_folder)), set(os.listdir(target))) |
There was a problem hiding this comment.
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
There was a problem hiding this 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
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
0cbd29d
to
5c8c37e
Compare
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.