Skip to content

Commit

Permalink
[CI] Re-enable Mac Mono Tests (#5945)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkl committed Aug 1, 2024
1 parent 3b318e3 commit dc44240
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 15 deletions.
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<PackageVersion Include="Microsoft.PowerShell.3.ReferenceAssemblies" Version="1.0.0" />
<PackageVersion Include="Microsoft.TeamFoundationServer.ExtendedClient" Version="16.153.0" />
<PackageVersion Include="Microsoft.Test.Apex.VisualStudio" Version="17.11.35005.70" />
<PackageVersion Include="Microsoft.TestPlatform.Portable" Version="17.1.0" />
<PackageVersion Include="Microsoft.VisualStudio.LanguageServices" Version="4.3.1" />
<PackageVersion Include="Microsoft.VisualStudio.ProjectSystem" Version="17.4.221-pre" />
<PackageVersion Include="Microsoft.VisualStudio.ProjectSystem.Managed" Version="17.2.0-beta1-20502-01" />
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ parameters:
- name: RunMonoTestsOnMac
displayName: Run Mono tests on Mac
type: boolean
default: false
default: true

resources:
pipelines:
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ parameters:
- name: RunMonoTestsOnMac
displayName: Run Mono tests on Mac
type: boolean
default: false
default: true
- name: RunStaticAnalysis
displayName: Run static analysis
type: boolean
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/templates/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ stages:
TestRunCommandLineArguments: "--mono-tests"
pool:
name: 'Azure Pipelines'
vmImage: macos-13
vmImage: macos-latest
os: macOS
templateContext:
outputs:
Expand Down
25 changes: 13 additions & 12 deletions scripts/funcTests/runFuncTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,22 @@ if [ "$MONO_TESTS" == "1" ]; then
rm -rf "$TestDir/System.*" "$TestDir/WindowsBase.dll" "$TestDir/Microsoft.CSharp.dll" "$TestDir/Microsoft.Build.Engine.dll"

case "$(uname -s)" in
Linux)
# We are not testing Mono on linux currently, so comment it out.
#echo "mono $VsTestConsole $TestDir/NuGet.CommandLine.Test.dll --TestCaseFilter:Platform!=Windows&Platform!=Darwin --logger:console;verbosity=$VsTestVerbosity --logger:"trx" --ResultsDirectory:$TestResultsDir"
#mono $VsTestConsole "$TestDir/NuGet.CommandLine.Test.dll" --TestCaseFilter:"Platform!=Windows&Platform!=Darwin" --logger:"console;verbosity=$VsTestVerbosity" --logger:"trx" --ResultsDirectory:"$TestResultsDir"
#EXIT_CODE=$?
;;
Darwin)
Linux)
# We are not testing Mono on linux currently, so comment it out.
#echo "mono $VsTestConsole $TestDir/NuGet.CommandLine.Test.dll --TestCaseFilter:Platform!=Windows&Platform!=Darwin --logger:console;verbosity=$VsTestVerbosity --logger:"trx" --ResultsDirectory:$TestResultsDir"
#mono $VsTestConsole "$TestDir/NuGet.CommandLine.Test.dll" --TestCaseFilter:"Platform!=Windows&Platform!=Darwin" --logger:"console;verbosity=$VsTestVerbosity" --logger:"trx" --ResultsDirectory:"$TestResultsDir"
#EXIT_CODE=$?
;;
Darwin)
echo "==================== Run mono tests started at `date -u +"%Y-%m-%dT%H:%M:%S"` ======================"
echo "mono $VsTestConsole $TestDir/NuGet.CommandLine.Test.dll --TestCaseFilter:Platform!=Windows&Platform!=Linux --logger:console;verbosity=$VsTestVerbosity --logger:"trx" --ResultsDirectory:$TestResultsDir"
mono $VsTestConsole "$TestDir/NuGet.CommandLine.Test.dll" --TestCaseFilter:"Platform!=Windows&Platform!=Linux" --logger:"console;verbosity=$VsTestVerbosity" --logger:"trx" --ResultsDirectory:"$TestResultsDir"
EXIT_CODE=$?
set -x
mono $VsTestConsole $TestDir/NuGet.CommandLine.Test.dll --logger:"console;verbosity=$VsTestVerbosity" --logger:trx --diag:$BUILD_STAGINGDIRECTORY/binlog/vstest.diag.log --ResultsDirectory:$TestResultsDir --Settings:$DIR/build/xunit.runsettings
EXIT_CODE=$?
set +x
echo "================== mono tests finished at `date -u +"%Y-%m-%dT%H:%M:%S"` ==================="
echo ""
;;
*) ;;
;;
*) ;;
esac
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Build.Framework" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.NET.StringTools" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.TestPlatform.Portable" IncludeAssets="None" />
</ItemGroup>

<ItemGroup>
Expand All @@ -35,6 +36,8 @@
CopyToOutputDirectory="PreserveNewest"
Visible="false"
Condition="'$(PkgMicrosoft_TestPlatform_Portable)' != ''" />
<None Include="xunit.runner.json"
CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"diagnosticMessages": true,
"methodDisplay": "classAndMethod",
"parallelizeAssembly": true,
"parallelizeTestCollections": true,
"longRunningTestSeconds": 120
}

0 comments on commit dc44240

Please sign in to comment.