-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[s390x] Fix Extensions.ApiDescription.Client tests on s390x #58235
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
base: main
Are you sure you want to change the base?
Conversation
* The enumeration of dictionary is undefined according to msdocs. * Sort the values of the expected and the actual in the test cases.
Can you provide a link to the docs you're referencing here? |
|
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
@@ -60,7 +60,9 @@ public void Execute_AddsExpectedMetadata() | |||
orderedMetadata.Add(key, metadata[key]); | |||
} | |||
|
|||
Assert.Equal(expectedMetadata, orderedMetadata); | |||
expectedMetadata["SerializedMetadata"] = string.Join("|", expectedMetadata["SerializedMetadata"].Split('|').OrderBy(s => s)); |
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.
It's not clear to me why we need to make this mutation to the SerializedMetadata
field on S390X targets. Can you provide an example of what the current metadata output looks like? The logs you shared appear to be truncated and don't show the actual comparison of the SerializedMetadata
field.
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.
According to my understanding, This might be due to when serializing metadata
var metadata = item.CloneCustomMetadata(); |
where CloneCustomMetadata usually returns an
Dictionary
where the order might be undefined.
Here is the difference in this particular test case on s390x
Expected: [ClassName, NSwagClient][CodeGenerator, NSwagCSharp][FirstForGenerator, true][Namespace, Console.Client][OriginalItemSpec, TestProjects/files/NSwag.json][OutputPath, obj/NSwagClient.cs][SerializedMetadata, Identity=TestProjects/files/NSwag.json|FirstForGenerator=true|CodeGenerator=NSwagCSharp|OutputPath=obj/NSwagClient.cs|Namespace=Console.Client|OriginalItemSpec=TestProjects/files/NSwag.json|ClassName=NSwagClient]
--------------------------------------------------------------------------------------------
Actual: [ClassName, NSwagClient][CodeGenerator, NSwagCSharp][FirstForGenerator, true][Namespace, Console.Client][OriginalItemSpec, TestProjects/files/NSwag.json][OutputPath, obj/NSwagClient.cs][SerializedMetadata, Identity=TestProjects/files/NSwag.json|FirstForGenerator=true|Namespace=Console.Client|OriginalItemSpec=TestProjects/files/NSwag.json|ClassName=NSwagClient|OutputPath=obj/NSwagClient.cs|CodeGenerator=NSwagCSharp]
Note this change in order is not only wrt architecture but with runtime's as well.
here is the change in order for x64 mono
expected: [ClassName, NSwagClient][CodeGenerator, NSwagCSharp][FirstForGenerator, true][Namespace, Console.Client][OriginalItemSpec, TestProjects/files/NSwag.json][OutputPath, obj/NSwagClient.cs][SerializedMetadata, Identity=TestProjects/files/NSwag.json|FirstForGenerator=true|CodeGenerator=NSwagCSharp|OutputPath=obj/NSwagClient.cs|Namespace=Console.Client|OriginalItemSpec=TestProjects/files/NSwag.json|ClassName=NSwagClient]
--------------------------------------------------------------------------------------------
Actual: [ClassName, NSwagClient][CodeGenerator, NSwagCSharp][FirstForGenerator, true][Namespace, Console.Client][OriginalItemSpec, TestProjects/files/NSwag.json][OutputPath, obj/NSwagClient.cs][SerializedMetadata, Identity=TestProjects/files/NSwag.json|CodeGenerator=NSwagCSharp|OriginalItemSpec=TestProjects/files/NSwag.json|FirstForGenerator=true|OutputPath=obj/NSwagClient.cs|ClassName=NSwagClient|Namespace=Console.Client]
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.
@captainsafia can we reopen this PR?
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 change makes sense to me, maybe we could add a little helper method to do the reordering so we don't have all the repetitive code?
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
I was asked to reopen this so here you go. |
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
Extensions.ApiDescription client tests cases were failing on s390x
according to the msdocs
This is just a snippet of a particular failure, I have attached the other failures as well
Untitled.txt