diff --git a/.github/fabricbot.json b/.github/fabricbot.json new file mode 100644 index 0000000000..1e963aa1e9 --- /dev/null +++ b/.github/fabricbot.json @@ -0,0 +1,35 @@ +[ + { + "taskType": "trigger", + "capabilityId": "IssueResponder", + "subCapability": "IssuesOnlyResponder", + "version": "1.0", + "config": { + "conditions": { + "operator": "and", + "operands": [ + { + "name": "labelAdded", + "parameters": { + "label": "need-info" + } + } + ] + }, + "eventType": "issue", + "eventNames": [ + "issues", + "project_card" + ], + "taskName": "Add comment when 'need-info' is applied to issue", + "actions": [ + { + "name": "addReply", + "parameters": { + "comment": "Hi @${issueAuthor}. We have added the \"need-info\" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time." + } + } + ] + } + } +] diff --git a/tests/Makefile b/tests/Makefile index 2eac140230..e22d5d2536 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -402,5 +402,5 @@ package-test-libraries.zip: $(Q) @$(MAKE) all -C test-libraries $(Q) mkdir -p $@.tmpdir $(Q) $(CP) -a test-libraries/* $@.tmpdir - $(Q_GEN) cd $@.tmpdir && zip -9r $(abspath $@) . + $(Q_GEN) cd $@.tmpdir && zip -9r --symlinks $(abspath $@) . $(Q) rm -rf $@.tmpdir diff --git a/tests/common/Configuration.cs b/tests/common/Configuration.cs index 1a5a9cc48b..b0ebc0b681 100644 --- a/tests/common/Configuration.cs +++ b/tests/common/Configuration.cs @@ -320,31 +320,18 @@ namespace Xamarin.Tests public static string RootPath { get { - if (IsVsts) { - var workingDir = Environment.GetEnvironmentVariable ("SYSTEM_DEFAULTWORKINGDIRECTORY"); - var git = Path.Combine (workingDir, ".git"); - if (Directory.Exists (git)) { - return workingDir; - } else { - var xamarin = Path.Combine (workingDir, "xamarin-macios"); - if (!Directory.Exists (xamarin)) - throw new Exception ($"Could not find the xamarin-macios repo given the test working directory {workingDir}"); - return xamarin; - } - } else { - var dir = TestAssemblyDirectory; - var path = Path.Combine (dir, ".git"); - while (!Directory.Exists (path) && path.Length > 3) { - dir = Path.GetDirectoryName (dir); - if (dir is null) - throw new Exception ($"Could not find the xamarin-macios repo given the test assembly directory {TestAssemblyDirectory}"); - path = Path.Combine (dir, ".git"); - } - path = Path.GetDirectoryName (path); - if (!Directory.Exists (path)) + var dir = TestAssemblyDirectory; + var path = Path.Combine (dir, ".git"); + while (!Directory.Exists (path) && path.Length > 3) { + dir = Path.GetDirectoryName (dir); + if (dir is null) throw new Exception ($"Could not find the xamarin-macios repo given the test assembly directory {TestAssemblyDirectory}"); - return path; + path = Path.Combine (dir, ".git"); } + path = Path.GetDirectoryName (path); + if (!Directory.Exists (path)) + throw new Exception ($"Could not find the xamarin-macios repo given the test assembly directory {TestAssemblyDirectory}"); + return path; } } diff --git a/tests/dotnet/UnitTests/BundleStructureTest.cs b/tests/dotnet/UnitTests/BundleStructureTest.cs index 436b618fe0..10272c3fad 100644 --- a/tests/dotnet/UnitTests/BundleStructureTest.cs +++ b/tests/dotnet/UnitTests/BundleStructureTest.cs @@ -535,19 +535,15 @@ namespace Xamarin.Tests { // Debug [TestCase (ApplePlatform.iOS, "ios-arm64;ios-arm", CodeSignature.All, "Debug")] [TestCase (ApplePlatform.iOS, "iossimulator-x64", CodeSignature.Frameworks, "Debug")] -#if !NET //ignore due to https://github.com/xamarin/maccore/issues/2548 [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64", CodeSignature.All, "Debug")] [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64;maccatalyst-arm64", CodeSignature.All, "Debug")] - [TestCase (ApplePlatform.MacOSX, "osx-x64", CodeSignature.None, "Debug")] - [TestCase (ApplePlatform.MacOSX, "osx-x64;osx-arm64", CodeSignature.None, "Debug")] -#endif + [TestCase (ApplePlatform.MacOSX, "osx-x64", CodeSignature.Frameworks, "Debug")] + [TestCase (ApplePlatform.MacOSX, "osx-x64;osx-arm64", CodeSignature.Frameworks, "Debug")] [TestCase (ApplePlatform.TVOS, "tvos-arm64", CodeSignature.All, "Debug")] // Release [TestCase (ApplePlatform.iOS, "ios-arm64;ios-arm", CodeSignature.All, "Release")] -#if !NET // ignore due to https://github.com/xamarin/maccore/issues/2548 [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64;maccatalyst-arm64", CodeSignature.All, "Release")] - [TestCase (ApplePlatform.MacOSX, "osx-x64", CodeSignature.None, "Release")] -#endif + [TestCase (ApplePlatform.MacOSX, "osx-x64", CodeSignature.Frameworks, "Release")] [TestCase (ApplePlatform.TVOS, "tvos-arm64", CodeSignature.All, "Release")] public void Build (ApplePlatform platform, string runtimeIdentifiers, CodeSignature signature, string configuration) { diff --git a/tests/xharness/GitHub.cs b/tests/xharness/GitHub.cs index 06785a06a0..749a5a74b7 100644 --- a/tests/xharness/GitHub.cs +++ b/tests/xharness/GitHub.cs @@ -164,8 +164,8 @@ namespace Xharness { IEnumerable GetModifiedFilesLocally (int pullRequest) { - var base_commit = $"origin/pr/{pullRequest}/merge^"; - var head_commit = $"origin/pr/{pullRequest}/merge"; + var base_commit = $"origin/pull/{pullRequest}/merge^"; + var head_commit = $"origin/pull/{pullRequest}/merge"; harness.Log ("Fetching modified files for commit range {0}..{1}", base_commit, head_commit); diff --git a/tools/common/Application.cs b/tools/common/Application.cs index c36ce659a4..30d07342f9 100644 --- a/tools/common/Application.cs +++ b/tools/common/Application.cs @@ -1701,8 +1701,10 @@ namespace Xamarin.Bundler { return !Profile.IsSdkAssembly (Path.GetFileNameWithoutExtension (assembly)); case ApplePlatform.TVOS: case ApplePlatform.WatchOS: - case ApplePlatform.MacCatalyst: return false; + case ApplePlatform.MacCatalyst: + // https://github.com/xamarin/xamarin-macios/issues/14437 + return true; default: throw ErrorHelper.CreateError (71, Errors.MX0071, Platform, ProductName); } diff --git a/tools/devops/automation/templates/build/build.yml b/tools/devops/automation/templates/build/build.yml index dfe652fc24..e5e06ed4d8 100644 --- a/tools/devops/automation/templates/build/build.yml +++ b/tools/devops/automation/templates/build/build.yml @@ -52,7 +52,13 @@ steps: - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - pwsh: | - git reset --hard HEAD^2 + git config remote.origin.fetch '+refs/pull/*:refs/remotes/origin/pull/*' + git fetch origin + $branch="$(Build.SourceBranch)".Replace("merge", "head") + $branch=$branch.Replace("refs", "origin") + Write-Host "Checking out branch $branch" + git checkout $branch + git branch -a displayName: "Undo Github merge" workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-macios diff --git a/tools/devops/automation/templates/common/download-artifacts.yml b/tools/devops/automation/templates/common/download-artifacts.yml index 524c2b8007..8b870674c7 100644 --- a/tools/devops/automation/templates/common/download-artifacts.yml +++ b/tools/devops/automation/templates/common/download-artifacts.yml @@ -43,5 +43,5 @@ steps: - powershell: | Write-Host "##vso[task.setvariable variable=TEST_SUMMARY_PATH]$Env:SYSTEM_DEFAULTWORKINGDIRECTORY\Reports\TestSummary-${{ parameters.testPrefix }}\TestSummary.md" Write-Host "##vso[task.setvariable variable=HTML_REPORT_PATH]$Env:SYSTEM_DEFAULTWORKINGDIRECTORY\HtmlReport-${{ parameters.testPrefix }}" - displayName: Pusblish artifact paths + displayName: Publish artifact paths name: artifacts # not to be confused with the displayName, this is used to later use the name of the step to access the output variables from an other job diff --git a/tools/devops/automation/templates/tests/build.yml b/tools/devops/automation/templates/tests/build.yml index 79ec21be85..91dbf17b39 100644 --- a/tools/devops/automation/templates/tests/build.yml +++ b/tools/devops/automation/templates/tests/build.yml @@ -54,7 +54,13 @@ steps: - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - pwsh: | - git reset --hard HEAD^2 + git config remote.origin.fetch '+refs/pull/*:refs/remotes/origin/pull/*' + git fetch origin + $branch="$(Build.SourceBranch)".Replace("merge", "head") + $branch=$branch.Replace("refs", "origin") + Write-Host "Checking out branch $branch" + git checkout $branch + git branch -a displayName: "Undo Github merge" workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-macios diff --git a/tools/devops/automation/templates/tests/run-tests.yml b/tools/devops/automation/templates/tests/run-tests.yml index d80ac07bc2..f3d18224be 100644 --- a/tools/devops/automation/templates/tests/run-tests.yml +++ b/tools/devops/automation/templates/tests/run-tests.yml @@ -227,7 +227,7 @@ steps: make -C builds downloads -j || true make -C builds .stamp-mono-ios-sdk-destdir -j || true RC=0 - MONO_ENV_OPTIONS=--trace=E:all make -C tests ${{ parameters.makeTarget }} || RC=$? + make -C tests ${{ parameters.makeTarget }} || RC=$? if [ $RC -eq 0 ]; then echo "##vso[task.setvariable variable=TESTS_JOBSTATUS;isOutput=true]Succeeded" else @@ -281,6 +281,25 @@ steps: continueOnError: true condition: succeededOrFailed() +# Upload all the binlogs +# Copy all the binlogs to a separate directory, keeping directory structure. +- script: | + set -x + mkdir -p $(Build.ArtifactStagingDirectory)/all-binlogs + rsync -av --prune-empty-dirs --include '*/' --include '*.binlog' --exclude '*' $(Build.SourcesDirectory)/xamarin-macios $(Build.ArtifactStagingDirectory)/all-binlogs + displayName: Copy all binlogs + continueOnError: true + condition: succeededOrFailed() + +# Publish all the binlogs we collected in the previous step +- task: PublishPipelineArtifact@1 + displayName: 'Publish Artifact: All binlogs' + inputs: + targetPath: $(Build.ArtifactStagingDirectory)/all-binlogs + artifactName: all-binlogs-test-$(Build.BuildId) + continueOnError: true + condition: succeededOrFailed() + # Be nice and clean behind you - pwsh: | cd $Env:SYSTEM_DEFAULTWORKINGDIRECTORY/xamarin-macios/tools/devops/automation/scripts/