Skip to content
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

[s390x] Fix Extensions.ApiDescription.Client tests on s390x #58235

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

saitama951
Copy link

Extensions.ApiDescription client tests cases were failing on s390x

Microsoft.Extensions.ApiDescription.Client.GetOpenApiReferenceMetadataTest.Execute_SetsClassName_BasedOnSanitizedOutputPath(outputPath: "aabb.cs", className: "aa__bb") [FAIL]
[xUnit.net 00:00:00.54]       Assert.Equal() Failure: Collections differ
[xUnit.net 00:00:00.54]       Expected: [["ClassName"] = "aa__bb", ["CodeGenerator"] = "NSwagCSharp", ["FirstForGenerator"] = "true", ["Namespace"] = "Console.Client", ["OriginalItemSpec"] = "TestProjects/files/NSwag.json", ···]
[xUnit.net 00:00:00.54]       Actual:   [["ClassName"] = "aa__bb", ["CodeGenerator"] = "NSwagCSharp", ["FirstForGenerator"] = "true", ["Namespace"] = "Console.Client", ["OriginalItemSpec"] = "TestProjects/files/NSwag.json", ···]
[xUnit.net 00:00:00.54]       Stack Trace:
[xUnit.net 00:00:00.54]         /home/sanjam/aspnetcore/src/Tools/Extensions.ApiDescription.Client/test/GetOpenApiReferenceMetadataTest.cs(450,0): at Microsoft.Extensions.ApiDescription.Client.GetOpenApiReferenceMetadataTest.Execute_SetsClassName_BasedOnSanitizedOutputPath(String outputPath, String className)
[xUnit.net 00:00:00.54]            at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
[xUnit.net 00:00:00.54]            at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
[xUnit.net 00:00:00.54]    

according to the msdocs

For purposes of enumeration, each item in the dictionary is treated as a [KeyValuePair<TKey,TValue>](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.keyvaluepair-2?view=net-8.0) structure representing a value and its key. The order in which the items are returned is undefined.

This is just a snippet of a particular failure, I have attached the other failures as well
Untitled.txt

* The enumeration of dictionary is undefined according to msdocs.
* Sort the values of the expected and the actual in the test cases.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI label Oct 4, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant