Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Determine the anyAttribute Namespace based on the NamespaceList#37409

Merged
krwq merged 3 commits intodotnet:masterfrom
JosVerburg:attributewildcard-namespace
May 16, 2019
Merged

Determine the anyAttribute Namespace based on the NamespaceList#37409
krwq merged 3 commits intodotnet:masterfrom
JosVerburg:attributewildcard-namespace

Conversation

@JosVerburg
Copy link
Copy Markdown
Contributor

This fixes #36484

I implemented it as a fallback to ensure it doesn't override the private value as it can be set using the public API.

@dnfclas
Copy link
Copy Markdown

dnfclas commented May 3, 2019

CLA assistant check
All CLA requirements met.

@ViktorHofer
Copy link
Copy Markdown
Member

@JosVerburg can you please let me know if you think the failing NETFX tests are related to your changes?

[Theory]
//[Variation(Desc = "complextype Any ns - ##any, attrgroup Any ns2, allow ns2 attribute")]
[InlineData("##any", "ns2", "ns2", 0)]
[InlineData("##any", "ns2", "ns2", 0, "##targetNamespace")]
Copy link
Copy Markdown
Member

@krwq krwq May 3, 2019

Choose a reason for hiding this comment

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

since the behavior is now different on full framework and corefx you might solve it in two ways:

  • split test for generic tests and corefx specific and put XYZ attribute on corefx specific
  • use PlatformDetection.IsFullFramework for those tests (i.e. additional bool arg) and throw new SkipTestException()

some usage examples:


[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "On desktop, XUnit hosts in an appdomain in such a way that GetEntryAssembly() returns null")]

throw new SkipTestException("Platform limitation with curl");

Copy link
Copy Markdown
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 pointers, made it easy to fix.
I'll try to look at the failing Linux arm64 tests tomorrow.

@JosVerburg
Copy link
Copy Markdown
Contributor Author

@krwq I'm not sure the failing tests are caused by this chance.
The failing tests are in System.Linq.Queryable.Tests and System.Xml.Linq.xNodeReader.Tests. Could this be an issue in the CI infrastructure?

@JosVerburg
Copy link
Copy Markdown
Contributor Author

/azp run corefx-ci

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 37409 in repo dotnet/corefx

@krwq
Copy link
Copy Markdown
Member

krwq commented May 13, 2019

@JosVerburg sorry, I've been out of town for the last week, I've restarted the CI now. @ViktorHofer should restarting CI be allowed?

@ViktorHofer
Copy link
Copy Markdown
Member

We are debating this currently offline in a mail thread.

CompareWildcardNamespaces(expectedNs, attributeWildcard.Namespace);
}

private static void CompareWildcardNamespaces(string expected, string actual)
Copy link
Copy Markdown
Member

@krwq krwq May 14, 2019

Choose a reason for hiding this comment

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

would it make sense to instead split, order and join back to string and compare strings instead? Alternatively Split, order and just compare IEnumerable with Assert.Equal which I believe should correctly compare elementwise

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fair point. I've rewritten it to string compares which does improve readability.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The failing tests are now in System.Net.Sockets.Tests and System.Reflection.Emit.ILGeneration.Tests. I don't believe this can be caused by the last commit on this PR as that only changed a test file.

Copy link
Copy Markdown
Member

@krwq krwq left a comment

Choose a reason for hiding this comment

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

LGTM, see comment

@krwq
Copy link
Copy Markdown
Member

krwq commented May 16, 2019

Thanks @JosVerburg!

@krwq krwq merged commit 2c22af8 into dotnet:master May 16, 2019
@karelz karelz added this to the 3.0 milestone May 22, 2019
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…et/corefx#37409)

* Determine the anyAttribute Namespace based on the NamespaceList

* Do not test the namespace attribute for full framework for intersection and union cases

* Compare namespaces using string comparison in unit tests


Commit migrated from dotnet/corefx@2c22af8
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The AttritubteWildcard.Namespace does not contain a value if an intersection or union is used

5 participants