Skip to content

Commit

Permalink
Merge branch 'main' into attribute_super_convert_type_mass_smash_2
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel-macaque authored Mar 12, 2022
2 parents f32651c + 2586aa1 commit 1c36da1
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 90 deletions.
4 changes: 2 additions & 2 deletions src/CFNetwork/CFHTTPAuthentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ internal CFHTTPAuthentication (NativeHandle handle, bool owns)
public static CFHTTPAuthentication? CreateFromResponse (CFHTTPMessage response)
{
if (response is null)
throw new ArgumentNullException (nameof (response));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (response));

if (response.IsRequest)
throw new InvalidOperationException ();
Expand All @@ -77,7 +77,7 @@ public bool IsValid {
public bool AppliesToRequest (CFHTTPMessage request)
{
if (request is null)
throw new ArgumentNullException (nameof (request));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (request));

if (!request.IsRequest)
throw new InvalidOperationException ();
Expand Down
26 changes: 13 additions & 13 deletions src/CFNetwork/CFHTTPMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ public static CFHTTPMessage CreateEmpty (bool request)
public static CFHTTPMessage CreateRequest (CFUrl url, NSString method, Version? version)
{
if (url is null)
throw new ArgumentNullException (nameof (url));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (url));
if (method is null)
throw new ArgumentNullException (nameof (method));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (method));

var handle = CFHTTPMessageCreateRequest (
IntPtr.Zero, method.Handle, url.Handle, GetVersion (version));
Expand All @@ -106,7 +106,7 @@ public static CFHTTPMessage CreateRequest (Uri uri, string method)
public static CFHTTPMessage CreateRequest (Uri uri, string method, Version? version)
{
if (uri is null)
throw new ArgumentNullException (nameof (uri));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (uri));

// the method is obsolete, but EscapeDataString does not work the same way. We could get the components
// of the Uri and then EscapeDataString, but this might introduce bugs, so for now we will ignore the warning
Expand Down Expand Up @@ -200,15 +200,15 @@ public bool IsHeaderComplete {
public bool AppendBytes (byte[] bytes)
{
if (bytes is null)
throw new ArgumentNullException (nameof (bytes));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (bytes));

return CFHTTPMessageAppendBytes (Handle, bytes, bytes.Length);
}

public bool AppendBytes (byte[] bytes, nint count)
{
if (bytes is null)
throw new ArgumentNullException (nameof (bytes));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (bytes));

return CFHTTPMessageAppendBytes (Handle, bytes, count);
}
Expand Down Expand Up @@ -260,9 +260,9 @@ AuthenticationException GetException (CFStreamErrorHTTPAuthentication code)
public void ApplyCredentials (CFHTTPAuthentication auth, NetworkCredential credential)
{
if (auth is null)
throw new ArgumentNullException (nameof (auth));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (auth));
if (credential is null)
throw new ArgumentNullException (nameof (credential));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (credential));

if (auth.RequiresAccountDomain) {
ApplyCredentialDictionary (auth, credential);
Expand Down Expand Up @@ -348,9 +348,9 @@ public bool AddAuthentication (CFHTTPMessage failureResponse, NSString username,
bool forProxy)
{
if (username is null)
throw new ArgumentNullException (nameof (username));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (username));
if (password is null)
throw new ArgumentNullException (nameof (password));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (password));

return CFHTTPMessageAddAuthentication (
Handle, failureResponse.GetHandle (), username.Handle,
Expand All @@ -365,9 +365,9 @@ public bool AddAuthentication (CFHTTPMessage failureResponse, NSString username,
public void ApplyCredentialDictionary (CFHTTPAuthentication auth, NetworkCredential credential)
{
if (auth is null)
throw new ArgumentNullException (nameof (auth));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (auth));
if (credential is null)
throw new ArgumentNullException (nameof (credential));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (credential));

var length = credential.Domain is null ? 2 : 3;
var keys = new NSString [length];
Expand Down Expand Up @@ -407,7 +407,7 @@ extern static void CFHTTPMessageSetHeaderFieldValue (/* CFHTTPMessageRef __nonnu
public void SetHeaderFieldValue (string name, string value)
{
if (name is null)
throw new ArgumentNullException (nameof (name));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (name));

var nameHandle = CFString.CreateNative (name);
var valueHandle = CFString.CreateNative (value);
Expand All @@ -426,7 +426,7 @@ extern static void CFHTTPMessageSetBody (/* CFHTTPMessageRef __nonnull */ IntPtr
public void SetBody (byte[] buffer)
{
if (buffer is null)
throw new ArgumentNullException (nameof (buffer));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (buffer));

using (var data = new CFDataBuffer (buffer))
CFHTTPMessageSetBody (Handle, data.Handle);
Expand Down
2 changes: 1 addition & 1 deletion src/CFNetwork/CFHTTPStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ internal CFDictionary Proxy {
public void SetProxy (CFProxySettings proxySettings)
{
if (proxySettings is null)
throw new ArgumentNullException (nameof (proxySettings));
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (proxySettings));

SetProperty (_Proxy, proxySettings.Dictionary);
}
Expand Down
20 changes: 11 additions & 9 deletions tests/xharness/Jenkins/MakeTestTaskEnumerable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,17 @@ public IEnumerator<MakeTask> GetEnumerator ()
};
yield return runMacBindingProject;

var runDocsTests = new MakeTask (jenkins: jenkins, processManager: processManager) {
Platform = TestPlatform.All,
TestName = "Documentation",
Target = "wrench-docs",
WorkingDirectory = HarnessConfiguration.RootDirectory,
Ignored = !jenkins.IncludeDocs,
Timeout = TimeSpan.FromMinutes (45),
};
yield return runDocsTests;
// Documentation is broken due to https://github.com/xamarin/maccore/commit/e06c4fda779e5ab6d41116d59410d3871841b9a5
// Ref: https://github.com/xamarin/xamarin-macios/issues/14372
// var runDocsTests = new MakeTask (jenkins: jenkins, processManager: processManager) {
// Platform = TestPlatform.All,
// TestName = "Documentation",
// Target = "wrench-docs",
// WorkingDirectory = HarnessConfiguration.RootDirectory,
// Ignored = !jenkins.IncludeDocs,
// Timeout = TimeSpan.FromMinutes (45),
// };
// yield return runDocsTests;
}

IEnumerator IEnumerable.GetEnumerator () => GetEnumerator ();
Expand Down
33 changes: 16 additions & 17 deletions tools/devops/automation/build-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,24 +359,23 @@ stages:
parseLabels: false

- ${{ if eq(parameters.runOldMacOSTests, true) }}:
- ${{ if and(ne(variables['Build.Reason'], 'Schedule'), or(eq(variables['Build.Reason'], 'IndividualCI'), eq(variables['Build.Reason'], 'Manual'))) }}:
- ${{ each config in parameters.macTestsConfigurations }}:
- template: templates/mac/stage.yml
parameters:
stageName: ${{ config.stageName }}
displayName: ${{ config.displayName }}
macPool: ${{ config.macPool }}
useImage: ${{ config.useImage }}
statusContext: ${{ config.statusContext }}
keyringPass: $(pass--lab--mac--builder--keychain)
demands: ${{ config.demands }}

- template: templates/windows/stage.yml
- ${{ each config in parameters.macTestsConfigurations }}:
- template: templates/mac/stage.yml
parameters:
stageName: windows_integration
displayName: 'Windows Integration Tests'
pool: 'VSEng-Xamarin-Mac-Devices' # currently ignored until the VS team provides a real one
statusContext: 'Windows Integration Tests'
stageName: ${{ config.stageName }}
displayName: ${{ config.displayName }}
macPool: ${{ config.macPool }}
useImage: ${{ config.useImage }}
statusContext: ${{ config.statusContext }}
keyringPass: $(pass--lab--mac--builder--keychain)
demands: ${{ config.demands }}

- template: templates/windows/stage.yml
parameters:
stageName: windows_integration
displayName: 'Windows Integration Tests'
pool: 'VSEng-Xamarin-Mac-Devices' # currently ignored until the VS team provides a real one
statusContext: 'Windows Integration Tests'

# iOS 32b tests are slow and do not have many machines, for that reason we are going just to run them in the Schedule builds.
# This means we are going to get the translations AND the iOS 32b on those builds.
Expand Down
2 changes: 1 addition & 1 deletion tools/devops/automation/scripts/GitHub.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ function New-GitHubSummaryComment {
$sb.AppendLine("* [Azure DevOps]($vstsTargetUrl)")
if ($Env:VSDROPS_INDEX) {
# we did generate an index with the files in vsdrops
$sb.AppendLine("* [Html Report (VSDrops)]($Env:VSDROPS_INDEX) [Download]($Env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI$Env:SYSTEM_TEAMPROJECT/_apis/build/builds/$Env:BUILD_BUILDID/artifacts?artifactName=HtmlReport-sim&api-version=6.0&`$format=zip)")
$sb.AppendLine("* [Html Report (VSDrops)]($Env:VSDROPS_INDEX) [Download]($Env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI$Env:SYSTEM_TEAMPROJECT/_apis/build/builds/$Env:BUILD_BUILDID/artifacts?artifactName=HtmlReport-simulator&api-version=6.0&`$format=zip)")
}

if (-not $DeviceTest) {
Expand Down
29 changes: 29 additions & 0 deletions tools/devops/automation/templates/build/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,35 @@ steps:
GitHubToken: $(GitHub.Token)
ArtifactDirectory: $(Build.SourcesDirectory)/package-internal

- bash: |
var=$(make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops print-variable VARIABLE=IOS_NUGET_VERSION_FULL)
IOS_NUGET_VERSION_FULL=${var#*=}
IOS_NUGET_VERSION_FULL=$(echo $IOS_NUGET_VERSION_FULL | cut -d "+" -f1)
var=$(make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops print-variable VARIABLE=TVOS_NUGET_VERSION_FULL)
TVOS_NUGET_VERSION_FULL=${var#*=}
TVOS_NUGET_VERSION_FULL=$(echo $TVOS_NUGET_VERSION_FULL | cut -d "+" -f1)
var=$(make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops print-variable VARIABLE=MACOS_NUGET_VERSION_FULL)
MACOS_NUGET_VERSION_FULL=${var#*=}
MACOS_NUGET_VERSION_FULL=$(echo $MACOS_NUGET_VERSION_FULL | cut -d "+" -f1)
var=$(make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops print-variable VARIABLE=MACCATALYST_NUGET_VERSION_FULL)
MACCATALYST_NUGET_VERSION_FULL=${var#*=}
MACCATALYST_NUGET_VERSION_FULL=$(echo $MACCATALYST_NUGET_VERSION_FULL | cut -d "+" -f1)
WORKLOAD_DST="$(Build.SourcesDirectory)/package-internal/WorkloadRollback.json"
echo "{" > $WORKLOAD_DST
echo "\"microsoft.net.sdk.ios\": \"$IOS_NUGET_VERSION_FULL\"," >> $WORKLOAD_DST
echo "\"microsoft.net.sdk.tvos\": \"$TVOS_NUGET_VERSION_FULL\"," >> $WORKLOAD_DST
echo "\"microsoft.net.sdk.macos\": \"$MACOS_NUGET_VERSION_FULL\"," >> $WORKLOAD_DST
echo "\"microsoft.net.sdk.maccatalyst\": \"$MACCATALYST_NUGET_VERSION_FULL\"" >> $WORKLOAD_DST
echo "}" >> $WORKLOAD_DST
echo "Rollback file contents:"
echo "$(cat $WORKLOAD_DST)"
displayName: 'Generate "WorkloadRollback.json'
# upload each of the pkgs into the pipeline artifacts
- task: PublishPipelineArtifact@1
displayName: 'Publish Build Artifacts'
Expand Down
4 changes: 0 additions & 4 deletions tools/devops/automation/templates/build/upload-vsdrops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ steps:
persistCredentials: true
path: s/xamarin-macios

- template: download-artifacts.yml
parameters:
runTests: ${{ parameters.runTests }}

# Upload the API diff to vsdrops to be able to locate it
- task: ms-vscs-artifact.build-tasks.artifactDropTask-1.artifactDropTask@0
displayName: 'Publish API diff to Artifact Services Drop'
Expand Down
26 changes: 12 additions & 14 deletions tools/devops/automation/templates/common/upload-vsdrops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@ steps:
persistCredentials: true
path: s/xamarin-macios

- ${{ if eq(parameters.provisioningFailed, 'False') }}:
- template: download-artifacts.yml
parameters:
testPrefix: ${{ parameters.testPrefix }}
- template: download-artifacts.yml
parameters:
testPrefix: ${{ parameters.testPrefix }}

# Upload full report to vsdrops using the the build numer and id as uuids.
- task: ms-vscs-artifact.build-tasks.artifactDropTask-1.artifactDropTask@0
displayName: 'Publish to Artifact Services Drop'
inputs:
dropServiceURI: 'https://devdiv.artifacts.visualstudio.com/DefaultCollection'
dropMetadataContainerName: 'DropMetadata-${{ parameters.testPrefix }}'
buildNumber: 'xamarin-macios/device-tests/$(Build.BuildNumber)/$(Build.BuildId)/${{ parameters.testPrefix }}'
sourcePath: $(HTML_REPORT_PATH)
detailedLog: true
usePat: true
- task: ms-vscs-artifact.build-tasks.artifactDropTask-1.artifactDropTask@0
displayName: 'Publish to Artifact Services Drop'
inputs:
dropServiceURI: 'https://devdiv.artifacts.visualstudio.com/DefaultCollection'
dropMetadataContainerName: 'DropMetadata-${{ parameters.testPrefix }}'
buildNumber: 'xamarin-macios/device-tests/$(Build.BuildNumber)/$(Build.BuildId)/${{ parameters.testPrefix }}'
sourcePath: $(HTML_REPORT_PATH)
detailedLog: true
usePat: true
2 changes: 1 addition & 1 deletion tools/devops/automation/templates/mac/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ stages:
dependsOn:
- build_packages
# we need to have the pkgs built and the device sets to be ran, that is decided via the labels or type of build during the build_packages stage
condition: and(succeeded(), eq(dependencies.build_packages.outputs['build.configuration.RunDeviceTests'], 'True'))
condition: succeeded()

variables:
MAC_TESTS_PRESENT: $[ dependencies.build_packages.outputs['macTestPkg.macTestsPresent'] ]
Expand Down
2 changes: 1 addition & 1 deletion tools/devops/automation/templates/tests/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ steps:

# download the artifacts.json, which will use to find the URI of the built pkg to later be installed by provisionator
- task: DownloadPipelineArtifact@2
displayName: Download artifacts.json
displayName: Download json artifacts
inputs:
patterns: '**/*.json'
allowFailedBuilds: true
Expand Down
30 changes: 3 additions & 27 deletions tools/devops/automation/templates/tests/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,34 +116,10 @@ steps:
DOTNET_NUPKG_DIR=${var#*=}
echo "Using nuget dir $DOTNET_NUPKG_DIR"
echo "Build WorkloadRollback.json"
VERSIONS=""
var=$(make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops print-variable VARIABLE=IOS_NUGET_VERSION_FULL)
IOS_NUGET_VERSION_FULL=${var#*=}
IOS_NUGET_VERSION_FULL=$(echo $IOS_NUGET_VERSION_FULL | cut -d "+" -f1)
var=$(make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops print-variable VARIABLE=TVOS_NUGET_VERSION_FULL)
TVOS_NUGET_VERSION_FULL=${var#*=}
TVOS_NUGET_VERSION_FULL=$(echo $TVOS_NUGET_VERSION_FULL | cut -d "+" -f1)
var=$(make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops print-variable VARIABLE=MACOS_NUGET_VERSION_FULL)
MACOS_NUGET_VERSION_FULL=${var#*=}
MACOS_NUGET_VERSION_FULL=$(echo $MACOS_NUGET_VERSION_FULL | cut -d "+" -f1)
var=$(make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops print-variable VARIABLE=MACCATALYST_NUGET_VERSION_FULL)
MACCATALYST_NUGET_VERSION_FULL=${var#*=}
MACCATALYST_NUGET_VERSION_FULL=$(echo $MACCATALYST_NUGET_VERSION_FULL | cut -d "+" -f1)
echo "{" > "WorkloadRollback.json"
echo "\"microsoft.net.sdk.ios\": \"$IOS_NUGET_VERSION_FULL\"," >> "WorkloadRollback.json"
echo "\"microsoft.net.sdk.tvos\": \"$TVOS_NUGET_VERSION_FULL\"," >> "WorkloadRollback.json"
echo "\"microsoft.net.sdk.macos\": \"$MACOS_NUGET_VERSION_FULL\"," >> "WorkloadRollback.json"
echo "\"microsoft.net.sdk.maccatalyst\": \"$MACCATALYST_NUGET_VERSION_FULL\"" >> "WorkloadRollback.json"
echo "}" >> "WorkloadRollback.json"
ROLLBACK_PATH="$(Build.SourcesDirectory)/artifacts/package-internal/WorkloadRollback.json"
echo "Rollback file contents:"
echo "$(cat WorkloadRollback.json)"
echo "$(cat $ROLLBACK_PATH)"
mkdir -p $DOTNET_NUPKG_DIR
ls -R $(Build.SourcesDirectory)/artifacts/package
Expand All @@ -165,7 +141,7 @@ steps:
rm global.json
cp global6.json global.json
$DOTNET6 workload install --from-rollback-file WorkloadRollback.json --source $DOTNET_NUPKG_DIR $SOURCES --verbosity diag $PLATFORMS
$DOTNET6 workload install --from-rollback-file $ROLLBACK_PATH --source $DOTNET_NUPKG_DIR $SOURCES --verbosity diag $PLATFORMS
var=$(make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops print-variable VARIABLE=DOTNET6_DIR)
DOTNET6_DIR=${var#*=}
Expand Down

0 comments on commit 1c36da1

Please sign in to comment.