Skip to content

[clr-ios] Skip XSLT API tests on Apple mobile CoreCLR via ConditionalClass#128049

Open
kotlarmilos wants to merge 6 commits into
dotnet:mainfrom
kotlarmilos:clr-ios-xslt-conditional-class
Open

[clr-ios] Skip XSLT API tests on Apple mobile CoreCLR via ConditionalClass#128049
kotlarmilos wants to merge 6 commits into
dotnet:mainfrom
kotlarmilos:clr-ios-xslt-conditional-class

Conversation

@kotlarmilos
Copy link
Copy Markdown
Member

@kotlarmilos kotlarmilos commented May 11, 2026

Description

This PR uses [ConditionalClass], which does propagate (the existing IsReflectionEmitSupported condition already relies on that) unlike #127947.

Tracked under #124344.

Fixes #128049

…alClass

xUnit's [ActiveIssue] does not propagate from a base test class to
derived classes, so the [ActiveIssue] on XsltApiTestCaseBase2 (added by
dotnet#127464, restored by the revert in dotnet#127947) does not actually skip the
~469 derived tests on iOS/tvOS + CoreCLR. They still run, instantiate
the base type, and throw TypeInitializationException from the base
static constructor that writes into the read-only app bundle.

dotnet#127788 worked around this by duplicating [ActiveIssue] on every
derived class; this commit replaces that mechanism with a single
[ConditionalClass] on the base class. [ConditionalClass] does propagate
to derived classes (as already demonstrated by the pre-existing
IsReflectionEmitSupported condition, which silently skips derived
classes on NativeAOT). ConditionalClassAttribute has AllowMultiple=false,
so the reflection-emit and Apple-mobile-CoreCLR conditions are combined
into a single predicate.

The predicate is hosted on a sibling type (XsltApiTestRequirements)
rather than on XsltApiTestCaseBase2 itself, so that evaluating it does
not trigger the dangerous static constructor.

See dotnet#124344.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-xml
See info in area-owners.md if you want to be subscribed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kotlarmilos kotlarmilos force-pushed the clr-ios-xslt-conditional-class branch from de9f189 to f483175 Compare May 11, 2026 19:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the XSLT API test gating in System.Private.Xml to ensure the full suite of derived XSLT API tests is skipped on Apple mobile + CoreCLR, where running them can trigger a failing base-type static constructor that writes into read-only app bundle test data.

Changes:

  • Introduces a dedicated XsltApiTestRequirements.IsSupported predicate to centralize skip logic without touching XsltApiTestCaseBase2’s type initializer.
  • Replaces the base-class [ConditionalClass(...IsReflectionEmitSupported...)] + [ActiveIssue(...)] pairing with a single [ConditionalClass(...IsSupported...)] that is intended to apply to all derived test classes.
Show a summary per file
File Description
src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs Consolidates XSLT API test skip conditions into a single ConditionalClass predicate to skip derived classes on Apple mobile CoreCLR.

Copilot's findings

Comments suppressed due to low confidence (1)

src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs:55

  • Removing the [ActiveIssue("https://github.com//issues/124344", ...)] annotation means these skipped tests will no longer be discoverable via the tracking workflow described in the issue (grep for ActiveIssue with that URL). Consider keeping the ActiveIssue attribute on this base type for tracking/metadata (even if it doesn’t control skipping), and rely on ConditionalClass for the actual skip behavior.
        public string szDefaultNS = "urn:my-object";
        public string szEmpty = "";
  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@kotlarmilos
Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@kotlarmilos kotlarmilos modified the milestones: 10.0.x, 11.0.0 May 11, 2026
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

This was referenced May 12, 2026
xUnit trait discovery does not walk the inheritance chain, so neither
[ActiveIssue] nor [ConditionalClass] on the base class actually skips
derived test classes. Replicate the new combined condition on every
derived class, replacing the existing reflection-emit-only ConditionalClass
in place where present (the new IsSupported predicate already requires it).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs Outdated
…rmApi/XsltApiV2.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@kotlarmilos
Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

Copilot AI review requested due to automatic review settings May 12, 2026 13:41
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 9/9 changed files
  • Comments generated: 1

Comment thread src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs Outdated
Comment thread src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs Outdated
…rmApi/XsltApiV2.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Copilot AI review requested due to automatic review settings May 12, 2026 16:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 9/9 changed files
  • Comments generated: 2

Comment thread src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 12, 2026 17:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 9/9 changed files
  • Comments generated: 1

@kotlarmilos
Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants