Skip to content

[mobile] Skip publishing tests ignored by CI#131071

Merged
kotlarmilos merged 1 commit into
dotnet:mainfrom
kotlarmilos:fix/skip-ignored-mobile-test-publish
Jul 21, 2026
Merged

[mobile] Skip publishing tests ignored by CI#131071
kotlarmilos merged 1 commit into
dotnet:mainfrom
kotlarmilos:fix/skip-ignored-mobile-test-publish

Conversation

@kotlarmilos

@kotlarmilos kotlarmilos commented Jul 20, 2026

Copy link
Copy Markdown
Member

Description

Skip PublishTestAsSelfContained when IgnoreForCI evaluates to true. Mobile builds currently skip archiving these projects but still publish them after Build, which runs aggressive trimming for tests that are not supported on the target platform. This prevents the Apple mobile CoreCLR leg from invoking ILLink for System.Text.Json.SourceGeneration.Roslyn4.4.Tests. Failure log https://dev.azure.com/dnceng-public/public/_build/results?buildId=1516430&view=logs&j=fbbe6d24-ec94-5563-68e4-47df2fb4f886&t=fd24ffdb-b6c4-50de-7ee2-f1794d18b0a7

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7a6a3acd-96c4-46b9-9dac-d21804d4576a
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts the mobile test publishing pipeline so that projects marked IgnoreForCI=true no longer execute the PublishTestAsSelfContained target. This aligns publishing behavior with existing “skip ignored tests” behavior already applied to other mobile-test steps (e.g., archive/bundle paths).

Changes:

  • Gate PublishTestAsSelfContained on IgnoreForCI != true so ignored projects are not published after Build.
  • Prevent downstream publish-time actions (including trimming/ILLink) from running for ignored test projects in mobile builds.
Show a summary per file
File Description
eng/testing/tests.mobile.targets Adds an IgnoreForCI condition to PublishTestAsSelfContained to skip publishing ignored test projects.

Copilot's findings

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

@kotlarmilos

Copy link
Copy Markdown
Member Author

/azp run runtime-ioslike

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@kotlarmilos kotlarmilos added this to the 11.0.0 milestone Jul 20, 2026
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Workflow state for the Holistic Review Orchestrator.

{
  "version": 5,
  "last_dispatched_commit": "33f2b989b3c516f1d0bd49fdac86b537db669efa",
  "last_dispatched_base_ref": "main",
  "last_dispatched_base_sha": "d349aa7988e9adf0ee0f5f0473886c0582975955",
  "last_reviewed_commit": "33f2b989b3c516f1d0bd49fdac86b537db669efa",
  "last_reviewed_base_ref": "main",
  "last_reviewed_base_sha": "d349aa7988e9adf0ee0f5f0473886c0582975955",
  "last_recorded_worker_run_id": "29741176640",
  "review_attempt_commit": "",
  "review_attempt_base_ref": "",
  "review_attempt_count": 0,
  "max_review_attempts": 5,
  "review_history_format": "holistic-review-disclosure-v1",
  "review_history": [
    {
      "commit": "33f2b989b3c516f1d0bd49fdac86b537db669efa",
      "review_id": 4734866719
    }
  ]
}

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Holistic Review

Motivation: The problem is real and well-evidenced. Mobile builds already skip archiving/bundling IgnoreForCI test projects, but PublishTestAsSelfContained still ran after Build, triggering aggressive trimming (ILLink) for tests unsupported on the target platform (e.g. System.Text.Json.SourceGeneration.Roslyn4.4.Tests on the Apple mobile CoreCLR leg). A CI failure log is linked, so the change is justified.

Approach: Correct and minimal. Adding and '$(IgnoreForCI)' != 'true' to the PublishTestAsSelfContained target condition mirrors the guard already applied to the sibling PublishDir/BundleDir properties (lines 6-8) and to the archiving targets in tests.targets, tests.android.targets, and tests.ioslike.targets. The target's DependsOnTargets (ArchiveTests, $(BundleTestAppTargets)) are already no-ops for IgnoreForCI projects, so skipping the publish step for them is consistent and avoids wasted trimming work rather than masking an error.

Summary: ✅ LGTM. A one-line, low-risk build-infra fix that brings the publish target in line with the established IgnoreForCI handling across the mobile testing targets. No correctness, performance, or scope concerns; no new public API surface. No actionable findings.

Note

This review was generated by this repository's Holistic Review agentic workflow to complement the built-in Copilot review.

Generated by Holistic Review · 41.2 AIC · ⌖ 10.2 AIC · ⊞ 10K


<Target Name="PublishTestAsSelfContained"
Condition="'$(IsCrossTargetingBuild)' != 'true'"
Condition="'$(IsCrossTargetingBuild)' != 'true' and '$(IgnoreForCI)' != 'true'"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this caused by a specific test that was disabled recently or do you know why we started hitting this now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, this is not a disabled test, System.Text.Json.SourceGeneration.Roslyn4.4.Tests has always been IgnoreForCI on mobile, so it never runs on the Apple mobile CoreCLR legs, but it was still published and trimmed

What actually fails is ILLink crashing during that publish trim with an unhandled ArgumentOutOfRangeException in Mono.Cecil.

The crash first appears in the https://dev.azure.com/dnceng-public/public/_build/results?buildId=1515988, which points to #130164 and #130665, each added a [JsonSerializable(typeof(...))] entry to the TestTypesContext source-generated context that these tests compile, which could have caused the error.

I will create a tracking issue if it doesn't exist.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Tracked in #131122

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm wondering if this a real issue not just a CI thing which warrant a bigger attention. Could it be something with trimmer that is broken on mobile @vitek-karas ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It is a latent Cecil bug that only appears once the assembly grows past a certain size. I believe it is worth further investigation and don't think it is mobile-specific.

@matouskozak

Copy link
Copy Markdown
Member

Approving to unblock the CI

@kotlarmilos
kotlarmilos merged commit dd3e6bc into dotnet:main Jul 21, 2026
143 of 150 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants