Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docs/ci/TestingOnCI.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ If no `Partition` traits are found, the infrastructure automatically falls back

## Controlling OS Compatibility

By default, tests run on all three platforms. To restrict a project to specific OSes:
By default, tests run on Linux and Windows. macOS is **disabled by default** — only tests that explicitly opt in will run on macOS. To configure which OSes a project runs on:

```xml
<PropertyGroup>
Expand All @@ -227,6 +227,15 @@ By default, tests run on all three platforms. To restrict a project to specific
</PropertyGroup>
```

To opt a project into macOS runs (e.g., only on push/merge, not on pull requests):

```xml
<PropertyGroup>
<!-- Run on macOS in GitHub Actions, but only outside of pull requests -->
<RunOnGithubActionsMacOS Condition=" '$(IsGitHubActionsRunner)' == 'true' and '$(IsGithubPullRequest)' != 'true' ">true</RunOnGithubActionsMacOS>
</PropertyGroup>
```

## Requiring NuGet Packages

For tests that need the built Aspire packages (e.g., template tests, end-to-end tests):
Expand Down
7 changes: 4 additions & 3 deletions eng/Testing.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Project requirements:
- RunOnGithubActions: indicates whether tests should run on GitHub Actions (either Windows or Linux or macOS); computed.
- RunOnGithubActionsWindows: indicates whether tests should run on Windows in GitHub Actions; default is true; overridable.
- RunOnGithubActionsMacOS: indicates whether tests should run on MacOS in GitHub Actions; default is false on pull requests and true otherwise; overridable.
- RunOnGithubActionsMacOS: indicates whether tests should run on MacOS in GitHub Actions; default is false; overridable.
- RunOnGithubActionsLinux: indicates whether tests should run on Linux in GitHub Actions; default is true; overridable.
- RunOnAzdoCI: indicates whether tests should run on Azure DevOps (either Windows or Linux); always false, if RunOnAzdoHelix=true; computed.
- RunOnAzdoCIWindows: indicates whether tests should run on Windows in Azure DevOps; default is true; overridable.
Expand Down Expand Up @@ -49,8 +49,9 @@
</PropertyGroup>

<PropertyGroup>
<RunOnGithubActionsMacOS Condition=" '$(RunOnGithubActionsMacOS)' == '' and '$(IsGithubPullRequest)' == 'true' ">false</RunOnGithubActionsMacOS>
<RunOnGithubActionsMacOS Condition=" '$(RunOnGithubActionsMacOS)' == '' ">true</RunOnGithubActionsMacOS>
<!-- See https://github.com/microsoft/aspire/issues/15615 -->
<!-- <RunOnGithubActionsMacOS Condition=" '$(RunOnGithubActionsMacOS)' == '' and '$(IsGithubPullRequest)' == 'true' ">false</RunOnGithubActionsMacOS> -->
<RunOnGithubActionsMacOS Condition=" '$(RunOnGithubActionsMacOS)' == '' ">false</RunOnGithubActionsMacOS>

<RunOnGithubActions>false</RunOnGithubActions>
<RunOnGithubActions Condition=" '$(RunOnGithubActionsWindows)' == 'true' or '$(RunOnGithubActionsLinux)' == 'true' or '$(RunOnGithubActionsMacOS)' == 'true' ">true</RunOnGithubActions>
Expand Down
3 changes: 3 additions & 0 deletions tests/Aspire.Templates.Tests/Aspire.Templates.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<RunOnAzdoCIWindows>false</RunOnAzdoCIWindows>
<RunOnAzdoCILinux>false</RunOnAzdoCILinux>

<!-- run on macOS in GitHub Actions, but only outside of pull requests -->
<RunOnGithubActionsMacOS Condition=" '$(IsGitHubActionsRunner)' == 'true' and '$(IsGithubPullRequest)' != 'true' ">true</RunOnGithubActionsMacOS>

<!-- Timeout configuration -->
<TestSessionTimeout>20m</TestSessionTimeout>
<TestHangTimeout>15m</TestHangTimeout>
Expand Down
Loading