From cd02d08696cf4dedaee84831c9eb6e7c429c6c5c Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Thu, 21 Feb 2019 16:43:56 -0800 Subject: [PATCH] Publish corefx test assets (dotnet/corefx#35473) * Publish corefx test assets So coreclr and other repos can run the corefx tests. New step to publish the test zip files to dotnet-core blob storage. Publishes the build manifest from above to blob storage path: https://dotnetfeed.blob.core.windows.net/dotnet-core/corefx-tests/$(Version)/$(TargetOS).$(ArchGroup)/$(TargetGroup)/corefx-test-assets.xml Declare DotNet-Blob-Feed only in official builds * Code review feedback. The blob path should NOT be Normalized. * WIP Commit migrated from https://github.com/dotnet/corefx/commit/bfb495d39e2d7b5d7cc0b571ed504670b2faa68c --- eng/pipelines/libraries/corefx-base.yml | 38 ++++++++++++++++++++ eng/pipelines/libraries/linux.yml | 1 + eng/pipelines/libraries/macos.yml | 1 + eng/pipelines/libraries/windows.yml | 2 ++ eng/publish.proj | 61 ++++++++++++++++++++++++++++++--- 5 files changed, 99 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/libraries/corefx-base.yml b/eng/pipelines/libraries/corefx-base.yml index 27ccef7..84d0fa5 100644 --- a/eng/pipelines/libraries/corefx-base.yml +++ b/eng/pipelines/libraries/corefx-base.yml @@ -26,6 +26,10 @@ parameters: # _skipTests: true | false # _outerloop: true | false + # Optional: _publishTests -> Boolean -> Publish test assets to blob storage if true. + # Default: false + # _publishTests: true | false + # Required: submitToHelix -> Boolean -> Value to know if it should submit tests payloads to helix. # Optional: buildScriptPrefix -> String -> string to append to Unix build script. @@ -55,6 +59,7 @@ jobs: - template: ../common/templates/job/job.yml parameters: variables: + # pass along job variables - ${{ each variable in job.variables }}: - ${{ if ne(variable.name, '') }}: @@ -82,6 +87,10 @@ jobs: - group: DotNet-HelixApi-Access - _archiveTestsParameter: /p:ArchiveTests=Tests + - ${{ if eq(parameters.isOfficialBuild, 'true') }}: + - group: DotNet-Blob-Feed + - _dotnetFeedUrl: https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json + # Windows variables - ${{ if eq(parameters.targetOS, 'Windows_NT') }}: - _buildScript: build.cmd @@ -173,6 +182,35 @@ jobs: - ${{ job.customBuildSteps }} - ${{ if eq(job.submitToHelix, 'true') }}: + - ${{ if eq(parameters.isOfficialBuild, 'true') }}: + - script: $(_msbuildCommand) eng/publish.proj + /t:PublishTestAssets + /p:FilesToPublishPattern=$(Build.SourcesDirectory)/artifacts/helix/**/*.zip + /p:AccountKey=$(dotnetfeed-storage-access-key-1) + /p:ExpectedFeedUrl=$(_dotnetFeedUrl) + /p:OSGroup=${{ parameters.targetOS }} + /p:ArchGroup=$(_architecture) + /p:ConfigurationGroup=$(_BuildConfig) + /p:TargetGroup=$(_framework) + /p:OfficialBuildId=$(Build.BuildNumber) + /p:ContinuousIntegrationBuild=true + /p:AssetManifestFileName='corefx-test-assets.xml' + /p:ManifestBuildId=$(Build.BuildNumber) + /p:ManifestBuildData=Location=$(_dotnetFeedUrl) + /p:ManifestBranch=$(Build.SourceBranchName) + /p:ManifestCommit=$(Build.SourceVersion) + /p:ManifestRepoUri=$(Build.Repository.Uri) + displayName: Publish test assets to dotnet-core feed + condition: and(succeeded(), eq(variables['_publishTests'], 'true')) + + - task: PublishBuildArtifacts@1 + displayName: Publish test asset manifest to artifacts container + inputs: + pathToPublish: $(Build.SourcesDirectory)/artifacts/AssetManifests + artifactName: $(Agent.Os)_$(Agent.JobName) + artifactType: container + condition: and(succeeded(), eq(variables['_publishTests'], 'true')) + - template: /eng/pipelines/helix.yml parameters: targetOS: ${{ parameters.targetOS }} diff --git a/eng/pipelines/libraries/linux.yml b/eng/pipelines/libraries/linux.yml index 251f936..b1f9a23 100644 --- a/eng/pipelines/libraries/linux.yml +++ b/eng/pipelines/libraries/linux.yml @@ -28,6 +28,7 @@ jobs: _dockerContainer: rhel7_container _buildScriptPrefix: '' _buildExtraArguments: '' + _publishTests: true arm64_Release: _BuildConfig: Release diff --git a/eng/pipelines/libraries/macos.yml b/eng/pipelines/libraries/macos.yml index ad0631e..5c1d0c1d 100644 --- a/eng/pipelines/libraries/macos.yml +++ b/eng/pipelines/libraries/macos.yml @@ -33,6 +33,7 @@ jobs: _architecture: x64 _framework: netcoreapp _helixQueues: $(macOSQueues) + _publishTests: true pool: name: Hosted Mac Internal Sierra diff --git a/eng/pipelines/libraries/windows.yml b/eng/pipelines/libraries/windows.yml index 112365c..6a08bd4 100644 --- a/eng/pipelines/libraries/windows.yml +++ b/eng/pipelines/libraries/windows.yml @@ -54,12 +54,14 @@ jobs: _architecture: x64 _framework: netcoreapp _helixQueues: $(netcoreappWindowsQueues)+$(nanoQueues) + _publishTests: true x86_Release: _BuildConfig: Release _architecture: x86 _framework: netcoreapp _helixQueues: $(netcoreappWindowsQueues) + _publishTests: true NETFX_x86_Release: _BuildConfig: Release diff --git a/eng/publish.proj b/eng/publish.proj index 31f8a6c9..bef5b89 100644 --- a/eng/publish.proj +++ b/eng/publish.proj @@ -8,9 +8,10 @@ corefx - $(GitHubRepositoryName)-$(ManifestBuildId) - $(GitHubRepositoryName) - $(ArtifactsDir)AssetManifests\$(AssetManifestFileName).xml + $(GitHubRepositoryName)-$(ManifestBuildId).xml + $(GitHubRepositoryName).xml + $(ArtifactsDir)AssetManifests\ + $(AssetManifestDir)$(AssetManifestFileName) $(ArtifactsDir)/packages/ $(PackageOutputRoot)*.nupkg @@ -104,4 +105,56 @@ - \ No newline at end of file + + + + + + + + <_TestAssetVersion>$(PackageVersion)-$(VersionSuffix) + <_FileRelativePathBase>corefx-tests/$(_TestAssetVersion)/$(OSGroup).$(ArchGroup)/$(TargetGroup)/ + + + + <_ItemsToPush Remove="@(_ItemsToPush)" /> + <_ItemsToPush Include="$(FilesToPublishPattern)" /> + <_ItemsToPush> + $(_FileRelativePathBase)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/')) + + + + + + + + + <_ManifestToPush Remove="@(_ManifestToPush)" /> + <_ManifestToPush Include="$(AssetManifestFilePath)"> + $(_FileRelativePathBase)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/')) + + + + + + + + -- 2.7.4