From 86ae9ad0d3e4bd84956c6530b93785d0654d0984 Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Wed, 12 Jan 2022 16:36:33 -0800 Subject: [PATCH 01/19] Update pipeline --- azure-pipelines.yml | 267 +++++++++++----------------------- src/AppInstallerCLICore/pch.h | 4 +- 2 files changed, 85 insertions(+), 186 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6fa7b8b309..2de9218de0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,12 +16,8 @@ pool: vmImage: 'windows-latest' variables: - solution: 'src/AppInstallerCLI.sln' - buildPlatform: 'x86|x64' - buildConfiguration: 'Release' - testBuildPlatform: 'x86' - testBuildConfiguration: 'TestRelease' - appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\' + solution: 'src\AppInstallerCLI.sln' + appxPackageDir: '$(Build.ArtifactStagingDirectory)\AppxPackages\' # Do not set the build version for a PR build. @@ -44,25 +40,39 @@ jobs: timeoutInMinutes: 120 dependsOn: 'GetReleaseTag' condition: always() + + strategy: + matrix: + x86_release: + buildConfiguration: 'Release' + buildPlatform: 'x86' + testBuildConfiguration: 'TestRelease' + x64_release: + buildConfiguration: 'Release' + buildPlatform: 'x64' + testBuildConfiguration: 'TestRelease' + variables: BuildVer: $[counter(dependencies.GetReleaseTag.outputs['GetTag.tag'], 1)] + buildOutDir: $(Build.SourcesDirectory)\src\$(buildPlatform)\$(buildConfiguration) + steps: - task: NuGetToolInstaller@1 displayName: Install Nuget - + # Restores all projects, including native (vcxproj) projects - task: NuGetCommand@2 displayName: Restore Solution inputs: restoreSolution: '$(solution)' - + # Restore these UAP packages as https://github.com/NuGet/Home/issues/7796 leads to all UAP packages being skipped for restore. # Even though they don't need any actual restore action, they need the project.assets.json file to be created and a direct restore does that. - task: NuGetCommand@2 displayName: Restore AppInstallerCLIPackage inputs: restoreSolution: 'src\AppInstallerCLIPackage\AppInstallerCLIPackage.wapproj' - + - task: NuGetCommand@2 displayName: Restore AppInstallerTestMsixInstaller inputs: @@ -72,14 +82,14 @@ jobs: displayName: Restore PackagedTests inputs: restoreSolution: 'src\PackagedTests\PackagedTests.csproj' - + # Restores only .NET core projects, but is still necessary, as without this the IndexCreationTool and LocalhostWebServer projects fail to build - task: DotNetCoreCLI@2 displayName: DotNet Restore inputs: command: 'restore' projects: '**/*.csproj' - + - task: PowerShell@2 displayName: Update Binary Version condition: not(eq(variables['Build.Reason'], 'PullRequest')) @@ -87,44 +97,39 @@ jobs: filePath: 'src\binver\Update-BinVer.ps1' arguments: '-TargetFile binver\binver\version.h -BuildVersion $(BuildVer)' workingDirectory: 'src' - + # Build all solutions in the root directory. + # - task: VSBuild@1 displayName: Build Solution inputs: - platform: 'x86' + platform: '$(buildPlatform)' solution: '$(solution)' configuration: '$(buildConfiguration)' - msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" - /p:AppxPackageDir="$(appxPackageDir)" - /p:AppxBundle=Always + msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" + /p:AppxPackageDir="$(appxPackageDir)" + /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload' - task: VSBuild@1 displayName: Build Test Project inputs: - platform: 'x86' + platform: '$(buildConfiguration)' solution: '$(solution)' configuration: '$(testBuildConfiguration)' - msbuildArgs: '/p:AppxBundlePlatforms="$(testBuildPlatform)" - /p:AppxPackageDir="$(appxPackageDir)" - /p:AppxBundle=Always - /p:UapAppxPackageBuildMode=StoreUpload' - task: PublishBuildArtifacts@1 displayName: Publish WindowsPackageManager.dll Symbols inputs: - PathtoPublish: 'src\x64\Release\WindowsPackageManager\WindowsPackageManager.pdb' - ArtifactName: 'WindowsPackageManager.pdb' - publishLocation: 'Container' + PathtoPublish: '$(buildOutDir)\WindowsPackageManager\WindowsPackageManager.pdb' + ArtifactName: '$(buildPlatform)\WindowsPackageManager.pdb' - task: PowerShell@2 displayName: Install Tests Dependencies inputs: targetType: 'inline' script: | - Add-AppxPackage AppInstallerCLIPackage_0.0.2.0_Test\Dependencies\x86\Microsoft.VCLibs.x86.14.00.Desktop.appx - Add-AppxPackage AppInstallerCLIPackage_0.0.2.0_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.Desktop.appx + Add-AppxPackage AppInstallerCLIPackage_0.0.2.0_Test\Dependencies\$(buildPlatform)\Microsoft.VCLibs.$(buildPlatform).14.00.Desktop.appx workingDirectory: $(appxPackageDir) - task: VisualStudioTestPlatformInstaller@1 @@ -132,111 +137,52 @@ jobs: inputs: packageFeedSelector: 'nugetOrg' -# TODO: Convert tests to run based on the whether things have worked up to this point - -# - task: CmdLine@2 -# displayName: Run Unit Tests Unpackaged x64 -# inputs: -# script: | -# AppInstallerCLITests.exe -logto AICLI-Unpackaged-x64.log -s -r junit -o TEST-AppInstallerCLI-Unpackaged-x64.xml -# workingDirectory: 'src\x64\Release\AppInstallerCLITests\' -# condition: succeededOrFailed() - -# - task: PublishBuildArtifacts@1 -# displayName: Publish Unit Tests Unpackaged Log x64 -# inputs: -# PathtoPublish: 'src\x64\Release\AppInstallerCLITests\AICLI-Unpackaged-x64.log' -# ArtifactName: 'TestPassUnpackagedLog' -# publishLocation: 'Container' -# condition: succeededOrFailed() - -# - task: PublishBuildArtifacts@1 -# displayName: Publish Unit Tests Unpackaged Output x64 -# inputs: -# PathtoPublish: 'src\x64\Release\AppInstallerCLITests\TEST-AppInstallerCLI-Unpackaged-x64.xml' -# ArtifactName: 'TestPassUnpackagedOutput' -# publishLocation: 'Container' -# condition: succeededOrFailed() - - - task: PowerShell@2 - displayName: Run Unit Tests Packaged x64 + - task: CmdLine@2 + displayName: Run Unit Tests Unpackaged inputs: - filePath: 'src\AppInstallerCLITests\Run-TestsInPackage.ps1' - arguments: '-Args "~[pips]" -BuildRoot x64\Release -PackageRoot AppInstallerCLIPackage\bin\x64\Release -LogTarget x64\Release\AICLI-Packaged-x64.log -TestResultsTarget x64\Release\TEST-AppInstallerCLI-Packaged-x64.xml -ScriptWait' - workingDirectory: 'src' - condition: succeededOrFailed() - + script: | + AppInstallerCLITests.exe -logto AICLI-Unpackaged.log -s -r junit -o TEST-AppInstallerCLI-Unpackaged.xml + workingDirectory: '$(buildOutDir)\AppInstallerCLITests\' + continueOnError: true + - task: PublishBuildArtifacts@1 - displayName: Publish Unit Tests Packaged Log x64 + displayName: Publish Unit Tests Unpackaged Log inputs: - PathtoPublish: 'src\x64\Release\AICLI-Packaged-x64.log' - ArtifactName: 'TestPassPackagedLog' - publishLocation: 'Container' - condition: succeededOrFailed() - + PathtoPublish: '$(buildOutDir)\AppInstallerCLITests\AICLI-Unpackaged.log' + ArtifactName: '$(buildPlatform)\TestPassUnpackagedLog' + - task: PublishBuildArtifacts@1 - displayName: Publish Unit Tests Packaged Output x64 + displayName: Publish Unit Tests Unpackaged Output inputs: - PathtoPublish: 'src\x64\Release\TEST-AppInstallerCLI-Packaged-x64.xml' - ArtifactName: 'TestPassPackagedOutput' - publishLocation: 'Container' - condition: succeededOrFailed() + PathtoPublish: '$(buildOutDir)\AppInstallerCLITests\TEST-AppInstallerCLI-Unpackaged.xml' + ArtifactName: 'TestPassUnpackagedOutput' -# - task: CmdLine@2 -# displayName: Run Unit Tests Unpackaged x86 -# inputs: -# script: | -# AppInstallerCLITests.exe -logto AICLI-Unpackaged-x86.log -s -r junit -o TEST-AppInstallerCLI-Unpackaged-x86.xml -# workingDirectory: 'src\x86\Release\AppInstallerCLITests\' -# condition: succeededOrFailed() - -# - task: PublishBuildArtifacts@1 -# displayName: Publish Unit Tests Unpackaged Log x86 -# inputs: -# PathtoPublish: 'src\x86\Release\AppInstallerCLITests\AICLI-Unpackaged-x86.log' -# ArtifactName: 'TestPassUnpackagedLog' -# publishLocation: 'Container' -# condition: succeededOrFailed() - -# - task: PublishBuildArtifacts@1 -# displayName: Publish Unit Tests Unpackaged Output x86 -# inputs: -# PathtoPublish: 'src\x86\Release\AppInstallerCLITests\TEST-AppInstallerCLI-Unpackaged-x86.xml' -# ArtifactName: 'TestPassUnpackagedOutput' -# publishLocation: 'Container' -# condition: succeededOrFailed() - - task: PowerShell@2 - displayName: Run Unit Tests Packaged x86 + displayName: Run Unit Tests Packaged inputs: filePath: 'src\AppInstallerCLITests\Run-TestsInPackage.ps1' - arguments: '-Args "~[pips]" -BuildRoot x86\Release -PackageRoot AppInstallerCLIPackage\bin\x86\Release -LogTarget x86\Release\AICLI-Packaged-x86.log -TestResultsTarget x86\Release\TEST-AppInstallerCLI-Packaged-x86.xml -ScriptWait' + arguments: '-Args "~[pips]" -BuildRoot $(buildOutDir) -PackageRoot AppInstallerCLIPackage\bin\$(buildPlatform)\$(buildConfiguration) -LogTarget $(buildOutDir)\AICLI-Packaged.log -TestResultsTarget $(buildOutDir)\TEST-AppInstallerCLI-Packaged.xml -ScriptWait' workingDirectory: 'src' - condition: succeededOrFailed() - + continueOnError: true + - task: PublishBuildArtifacts@1 - displayName: Publish Unit Tests Packaged Log x86 + displayName: Publish Unit Tests Packaged Log inputs: - PathtoPublish: 'src\x86\Release\AICLI-Packaged-x86.log' - ArtifactName: 'TestPassPackagedLog' - publishLocation: 'Container' - condition: succeededOrFailed() - + PathtoPublish: '$(buildOutDir)\AICLI-Packaged.log' + ArtifactName: '$(buildPlatform)\TestPassPackagedLog' + - task: PublishBuildArtifacts@1 - displayName: Publish Unit Tests Packaged Output x86 + displayName: Publish Unit Tests Packaged Output inputs: - PathtoPublish: 'src\x86\Release\TEST-AppInstallerCLI-Packaged-x86.xml' - ArtifactName: 'TestPassPackagedOutput' - publishLocation: 'Container' - condition: succeededOrFailed() - + PathtoPublish: '$(buildOutDir)\TEST-AppInstallerCLI-Packaged.xml' + ArtifactName: '$(buildPlatfom)\TestPassPackagedOutput' + - task: PublishTestResults@2 displayName: Publish Unit Test Results inputs: testResultsFormat: 'JUnit' - testResultsFiles: '**/TEST-*.xml' + testResultsFiles: '$(buildOutDir)\TEST-*.xml' failTaskOnFailedTests: true - condition: succeededOrFailed() - task: DownloadSecureFile@1 name: AppInstallerTest @@ -248,59 +194,55 @@ jobs: name: HTTPSDevCert displayName: 'Download Kestrel Certificate' inputs: - secureFile: 'HTTPSDevCertV2.pfx' + secureFile: 'AppInstallerTest.pfx' - task: MSBuild@1 displayName: Build MSIX Test Installer File inputs: - platform: 'x86' - solution: 'src/AppInstallerTestMsixInstaller/AppInstallerTestMsixInstaller.wapproj' + platform: '$(buildPlatform)' + solution: 'src\AppInstallerTestMsixInstaller\AppInstallerTestMsixInstaller.wapproj' configuration: '$(buildConfiguration)' msbuildArguments: '/p:AppxPackageOutput="$(Build.ArtifactStagingDirectory)\AppInstallerTestMsixInstaller.msix" - /p:AppxBundle=Never - /p:UapAppxPackageBuildMode=SideLoadOnly + /p:AppxBundle=Never + /p:UapAppxPackageBuildMode=SideLoadOnly /p:AppxPackageSigningEnabled=false' - condition: succeededOrFailed() - task: PowerShell@2 displayName: Install Root Certificate inputs: filePath: 'src\LocalhostWebServer\InstallDevCert.ps1' arguments: '-pfxpath $(HTTPSDevCert.secureFilePath) -password microsoft' - condition: succeededOrFailed() - task: PowerShell@2 displayName: Launch LocalhostWebServer inputs: filePath: 'src\LocalhostWebServer\Run-LocalhostWebServer.ps1' - arguments: '-BuildRoot $(system.defaultWorkingDirectory)\src\x86\Release\LocalhostWebServer -StaticFileRoot $(Agent.TempDirectory)\TestLocalIndex -CertPath $(HTTPSDevCert.secureFilePath) -CertPassword microsoft' - condition: succeededOrFailed() + arguments: '-BuildRoot $(buildOutDir)\LocalhostWebServer -StaticFileRoot $(Agent.TempDirectory)\TestLocalIndex -CertPath $(HTTPSDevCert.secureFilePath) -CertPassword microsoft' - task: CopyFiles@2 - displayName: 'Copy x64 Files to Package Output' + displayName: 'Copy Files to Package Output' inputs: - SourceFolder: '$(system.defaultWorkingDirectory)\src\x64\Release\WindowsPackageManager' - TargetFolder: '$(system.defaultWorkingDirectory)\src\AppInstallerCLIPackage\bin\x64\Release' + SourceFolder: '$(buildOutDir)\WindowsPackageManager' + TargetFolder: 'src\AppInstallerCLIPackage\bin\$(buildPlatform)\$(buildConfiguration)' Contents: WindowsPackageManager.dll CleanTargetFolder: false OverWrite: true - condition: succeededOrFailed() - task: VSTest@2 - displayName: Run E2E Tests Packaged x64 + displayName: Run E2E Tests Packaged inputs: - testRunTitle: 'E2E Packaged x64' + testRunTitle: 'E2E Packaged' testSelector: 'testAssemblies' - testAssemblyVer2: 'src\x64\Release\AppInstallerCLIE2ETests\AppInstallerCLIE2ETests.dll' - runSettingsFile: 'src\x64\Release\AppInstallerCLIE2ETests\Test.runsettings' + testAssemblyVer2: '$(buildOutDir)\AppInstallerCLIE2ETests\AppInstallerCLIE2ETests.dll' + runSettingsFile: '$(buildOutDir)\AppInstallerCLIE2ETests\Test.runsettings' overrideTestrunParameters: '-PackagedContext true - -AICLIPackagePath $(system.defaultWorkingDirectory)\src\AppInstallerCLIPackage\bin\x64\Release + -AICLIPackagePath $(System.DefaultWorkingDirectory)\src\AppInstallerCLIPackage\bin\x64\Release -AICLIPath AppInstallerCLI\winget.exe -LooseFileRegistration true -InvokeCommandInDesktopPackage true -StaticFileRootPath $(Agent.TempDirectory)\TestLocalIndex -MsixTestInstallerPath $(Build.ArtifactStagingDirectory)\AppInstallerTestMsixInstaller.msix - -ExeTestInstallerPath $(system.defaultWorkingDirectory)\src\x64\Release\AppInstallerTestExeInstaller\AppInstallerTestExeInstaller.exe + -ExeTestInstallerPath $(System.DefaultWorkingDirectory)\src\x64\Release\AppInstallerTestExeInstaller\AppInstallerTestExeInstaller.exe -PackageCertificatePath $(AppInstallerTest.secureFilePath)' condition: succeededOrFailed() @@ -309,89 +251,46 @@ jobs: inputs: PathtoPublish: 'C:\Users\VssAdministrator\AppData\Local\Temp\E2ETestLogs' ArtifactName: 'E2ETestPackagedx64Log' - publishLocation: 'Container' - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy x86 Files to Package Output' - inputs: - SourceFolder: '$(system.defaultWorkingDirectory)\src\x86\Release\WindowsPackageManager' - TargetFolder: '$(system.defaultWorkingDirectory)\src\AppInstallerCLIPackage\bin\x86\Release' - Contents: WindowsPackageManager.dll - CleanTargetFolder: false - OverWrite: true - condition: succeededOrFailed() - - - task: VSTest@2 - displayName: Run E2E Tests Packaged x86 - inputs: - testRunTitle: 'E2E Packaged x86' - testSelector: 'testAssemblies' - testAssemblyVer2: 'src\x86\Release\AppInstallerCLIE2ETests\AppInstallerCLIE2ETests.dll' - runSettingsFile: 'src\x86\Release\AppInstallerCLIE2ETests\Test.runsettings' - overrideTestrunParameters: '-PackagedContext true - -AICLIPackagePath $(system.defaultWorkingDirectory)\src\AppInstallerCLIPackage\bin\x86\Release - -AICLIPath AppInstallerCLI\winget.exe - -LooseFileRegistration true - -InvokeCommandInDesktopPackage true - -StaticFileRootPath $(Agent.TempDirectory)\TestLocalIndex - -MsixTestInstallerPath $(Build.ArtifactStagingDirectory)\AppInstallerTestMsixInstaller.msix - -ExeTestInstallerPath $(system.defaultWorkingDirectory)\src\x86\Release\AppInstallerTestExeInstaller\AppInstallerTestExeInstaller.exe - -PackageCertificatePath $(AppInstallerTest.secureFilePath)' - condition: succeededOrFailed() - - - task: PublishBuildArtifacts@1 - displayName: Publish E2E Tests Packaged x86 Log - inputs: - PathtoPublish: 'C:\Users\VssAdministrator\AppData\Local\Packages\WinGetDevCLI_8wekyb3d8bbwe\LocalState\DiagOutputDir' - ArtifactName: 'E2ETestPackagedx86Log' - publishLocation: 'Container' - condition: succeededOrFailed() - task: VSTest@2 displayName: Run Com Interface Tests inputs: testRunTitle: 'Com Interface Tests' - platform: 'x86' + platform: '$(buildPlatform)' testSelector: 'testAssemblies' testAssemblyVer2: | - src\x86\Release\PackagedTests\PackagedTests.build.appxrecipe - runSettingsFile: 'src\x86\Release\PackagedTests\Test.runsettings' - condition: succeededOrFailed() + $(buildOutDir)\PackagedTests\PackagedTests.build.appxrecipe + runSettingsFile: '$(buildOutDir)\PackagedTests\Test.runsettings' - task: CopyFiles@2 displayName: 'Copy Files: WinGetUtilInterop.UnitTests' inputs: SourceFolder: '$(Build.SourcesDirectory)\src\WinGetUtilInterop.UnitTests\bin\$(BuildConfiguration)\netcoreapp3.1' - TargetFolder: '$(build.artifactstagingdirectory)\WinGetUtilInterop.UnitTests\' + TargetFolder: '$(Build.ArtifactStagingDiretory)\WinGetUtilInterop.UnitTests\' CleanTargetFolder: true OverWrite: true - condition: succeededOrFailed() - task: VSTest@2 displayName: 'Run tests: WinGetUtilInterop.UnitTests' inputs: testSelector: 'testAssemblies' testAssemblyVer2: 'WinGetUtilInterop.UnitTests.dll' - searchFolder: '$(build.artifactstagingdirectory)\WinGetUtilInterop.UnitTests' + searchFolder: '$(Build.ArtifactStagingDirectory)\WinGetUtilInterop.UnitTests' codeCoverageEnabled: true platform: 'Any CPU' configuration: '$(BuildConfiguration)' - condition: succeededOrFailed() - task: PublishBuildArtifacts@1 displayName: Publish Util Binary inputs: - PathtoPublish: 'src\x64\Release\WinGetUtil\WinGetUtil.dll' - ArtifactName: 'WinGetUtil.dll' - publishLocation: 'Container' + PathtoPublish: '$(buildOutDir)\WinGetUtil\WinGetUtil.dll' + ArtifactName: '$(buildPlatform)\WinGetUtil.dll' - task: PublishBuildArtifacts@1 displayName: Publish Util Symbols inputs: - PathtoPublish: 'src\x64\Release\WinGetUtil\WinGetUtil.pdb' - ArtifactName: 'WinGetUtil.pdb' - publishLocation: 'Container' + PathtoPublish: '$(buildOutDir)\WinGetUtil\WinGetUtil.pdb' + ArtifactName: '$(buildPlatform)\WinGetUtil.pdb' - task: ComponentGovernanceComponentDetection@0 displayName: Component Governance @@ -404,7 +303,7 @@ jobs: - task: BinSkim@3 displayName: 'Run BinSkim ' inputs: - arguments: 'analyze "$(system.defaultWorkingDirectory)\src\AppInstaller*CLI.exe" "$(system.defaultWorkingDirectory)\src\WinGet*Util.dll" --config default --recurse' + arguments: 'analyze "$(System.DefaultWorkingDirectory)\src\AppInstaller*CLI.exe" "$(System.DefaultWorkingDirectory)\src\WinGet*Util.dll" --config default --recurse' - task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@2 displayName: 'Publish Security Analysis Logs' diff --git a/src/AppInstallerCLICore/pch.h b/src/AppInstallerCLICore/pch.h index d4745a3f49..30c4e716ce 100644 --- a/src/AppInstallerCLICore/pch.h +++ b/src/AppInstallerCLICore/pch.h @@ -53,12 +53,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include -#include +#include From 6782de771e635f67c2332a3ffeab9aa8ebab7d4f Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Wed, 12 Jan 2022 18:30:35 -0800 Subject: [PATCH 02/19] Add binlog --- azure-pipelines.yml | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2de9218de0..afe755af3a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -99,7 +99,6 @@ jobs: workingDirectory: 'src' # Build all solutions in the root directory. - # - task: VSBuild@1 displayName: Build Solution inputs: @@ -109,8 +108,15 @@ jobs: msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always - /p:UapAppxPackageBuildMode=StoreUpload' + /p:UapAppxPackageBuildMode=StoreUpload + /bl $(Build.ArtifactStagingDirectory)\binlog' + - task: PublishBuildArtifacts@1 + displayName: Publish MSBuild binlog + inputs: + PathtoPublish: $(Build.ArtifactStagingDirectory)\binlog + ArtifactName: '$(buildPlatform)\msbuild.binlog' + condition: succeededOrFailed() - task: VSBuild@1 displayName: Build Test Project inputs: @@ -141,47 +147,47 @@ jobs: displayName: Run Unit Tests Unpackaged inputs: script: | - AppInstallerCLITests.exe -logto AICLI-Unpackaged.log -s -r junit -o TEST-AppInstallerCLI-Unpackaged.xml + AppInstallerCLITests.exe -logto $(Build.ArtifactStagingDirectory)\AICLI-Unpackaged.log -s -r junit -o $(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Unpackaged.xml workingDirectory: '$(buildOutDir)\AppInstallerCLITests\' continueOnError: true - task: PublishBuildArtifacts@1 displayName: Publish Unit Tests Unpackaged Log inputs: - PathtoPublish: '$(buildOutDir)\AppInstallerCLITests\AICLI-Unpackaged.log' + PathtoPublish: '$(Build.ArtifactStagingDirectory)\AICLI-Unpackaged.log' ArtifactName: '$(buildPlatform)\TestPassUnpackagedLog' - task: PublishBuildArtifacts@1 displayName: Publish Unit Tests Unpackaged Output inputs: - PathtoPublish: '$(buildOutDir)\AppInstallerCLITests\TEST-AppInstallerCLI-Unpackaged.xml' + PathtoPublish: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Unpackaged.xml' ArtifactName: 'TestPassUnpackagedOutput' - task: PowerShell@2 displayName: Run Unit Tests Packaged inputs: filePath: 'src\AppInstallerCLITests\Run-TestsInPackage.ps1' - arguments: '-Args "~[pips]" -BuildRoot $(buildOutDir) -PackageRoot AppInstallerCLIPackage\bin\$(buildPlatform)\$(buildConfiguration) -LogTarget $(buildOutDir)\AICLI-Packaged.log -TestResultsTarget $(buildOutDir)\TEST-AppInstallerCLI-Packaged.xml -ScriptWait' + arguments: '-Args "~[pips]" -BuildRoot $(buildOutDir) -PackageRoot AppInstallerCLIPackage\bin\$(buildPlatform)\$(buildConfiguration) -LogTarget $(Build.ArtifactStagingDirectory)\AICLI-Packaged.log -TestResultsTarget $(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Packaged.xml -ScriptWait' workingDirectory: 'src' continueOnError: true - task: PublishBuildArtifacts@1 displayName: Publish Unit Tests Packaged Log inputs: - PathtoPublish: '$(buildOutDir)\AICLI-Packaged.log' + PathtoPublish: '$(Build.ArtifactStagingDirectory)\AICLI-Packaged.log' ArtifactName: '$(buildPlatform)\TestPassPackagedLog' - task: PublishBuildArtifacts@1 displayName: Publish Unit Tests Packaged Output inputs: - PathtoPublish: '$(buildOutDir)\TEST-AppInstallerCLI-Packaged.xml' + PathtoPublish: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Packaged.xml' ArtifactName: '$(buildPlatfom)\TestPassPackagedOutput' - task: PublishTestResults@2 displayName: Publish Unit Test Results inputs: testResultsFormat: 'JUnit' - testResultsFiles: '$(buildOutDir)\TEST-*.xml' + testResultsFiles: '$(Build.ArtifactStagingDirectory)\TEST-*.xml' failTaskOnFailedTests: true - task: DownloadSecureFile@1 @@ -236,21 +242,20 @@ jobs: testAssemblyVer2: '$(buildOutDir)\AppInstallerCLIE2ETests\AppInstallerCLIE2ETests.dll' runSettingsFile: '$(buildOutDir)\AppInstallerCLIE2ETests\Test.runsettings' overrideTestrunParameters: '-PackagedContext true - -AICLIPackagePath $(System.DefaultWorkingDirectory)\src\AppInstallerCLIPackage\bin\x64\Release + -AICLIPackagePath $(System.DefaultWorkingDirectory)\src\AppInstallerCLIPackage\bin\$(buildPlatform)\$(buildConfiguration) -AICLIPath AppInstallerCLI\winget.exe -LooseFileRegistration true -InvokeCommandInDesktopPackage true -StaticFileRootPath $(Agent.TempDirectory)\TestLocalIndex -MsixTestInstallerPath $(Build.ArtifactStagingDirectory)\AppInstallerTestMsixInstaller.msix - -ExeTestInstallerPath $(System.DefaultWorkingDirectory)\src\x64\Release\AppInstallerTestExeInstaller\AppInstallerTestExeInstaller.exe + -ExeTestInstallerPath $(buildOutDir)\AppInstallerTestExeInstaller\AppInstallerTestExeInstaller.exe -PackageCertificatePath $(AppInstallerTest.secureFilePath)' - condition: succeededOrFailed() - task: PublishBuildArtifacts@1 - displayName: Publish E2E Tests Packaged x64 Log + displayName: Publish E2E Tests Packaged Log inputs: PathtoPublish: 'C:\Users\VssAdministrator\AppData\Local\Temp\E2ETestLogs' - ArtifactName: 'E2ETestPackagedx64Log' + ArtifactName: '$(buildPlatform)\E2ETestPackagedLog' - task: VSTest@2 displayName: Run Com Interface Tests From 86540a68f3addee62f4f809693fa97cd3c5e5f2b Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Thu, 13 Jan 2022 10:08:32 -0800 Subject: [PATCH 03/19] Fix binlog --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index afe755af3a..efdccea603 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -109,7 +109,7 @@ jobs: /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload - /bl $(Build.ArtifactStagingDirectory)\binlog' + /bl:$(Build.ArtifactStagingDirectory)\binlog' - task: PublishBuildArtifacts@1 displayName: Publish MSBuild binlog From 69e705d15a754598b09f2b859e92b53fb5f62214 Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Thu, 13 Jan 2022 10:17:57 -0800 Subject: [PATCH 04/19] Fix binlog --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index efdccea603..57cdb782da 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -109,12 +109,12 @@ jobs: /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload - /bl:$(Build.ArtifactStagingDirectory)\binlog' + -bl:$(Build.ArtifactStagingDirectory)\msbuild.binlog' - task: PublishBuildArtifacts@1 displayName: Publish MSBuild binlog inputs: - PathtoPublish: $(Build.ArtifactStagingDirectory)\binlog + PathtoPublish: $(Build.ArtifactStagingDirectory)\msbuild.binlog ArtifactName: '$(buildPlatform)\msbuild.binlog' condition: succeededOrFailed() - task: VSBuild@1 From b0ec59bfb10b3c5856b4d0f0ce2ab2bd2ff74f6e Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Thu, 13 Jan 2022 10:43:45 -0800 Subject: [PATCH 05/19] Build both platforms --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 57cdb782da..f350b6917b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -105,7 +105,7 @@ jobs: platform: '$(buildPlatform)' solution: '$(solution)' configuration: '$(buildConfiguration)' - msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" + msbuildArgs: '/p:AppxBundlePlatforms="x86|x64" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload From 8c8ce86b6353b08865d4d03fbca463617db64e98 Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Thu, 13 Jan 2022 10:44:33 -0800 Subject: [PATCH 06/19] Reorder args --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f350b6917b..e83c409911 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -105,11 +105,11 @@ jobs: platform: '$(buildPlatform)' solution: '$(solution)' configuration: '$(buildConfiguration)' - msbuildArgs: '/p:AppxBundlePlatforms="x86|x64" + msbuildArgs: '-bl:$(Build.ArtifactStagingDirectory)\msbuild.binlog + /p:AppxBundlePlatforms="x86|x64" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always - /p:UapAppxPackageBuildMode=StoreUpload - -bl:$(Build.ArtifactStagingDirectory)\msbuild.binlog' + /p:UapAppxPackageBuildMode=StoreUpload' - task: PublishBuildArtifacts@1 displayName: Publish MSBuild binlog From 9ca4deb053c1ce597d68c8140affcb51ef38ab34 Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Thu, 13 Jan 2022 10:53:28 -0800 Subject: [PATCH 07/19] Fix string --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e83c409911..3bda1a3f8e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,7 @@ pool: variables: solution: 'src\AppInstallerCLI.sln' - appxPackageDir: '$(Build.ArtifactStagingDirectory)\AppxPackages\' + appxPackageDir: '$(Build.ArtifactStagingDirectory)/AppxPackages/' # Do not set the build version for a PR build. @@ -106,7 +106,7 @@ jobs: solution: '$(solution)' configuration: '$(buildConfiguration)' msbuildArgs: '-bl:$(Build.ArtifactStagingDirectory)\msbuild.binlog - /p:AppxBundlePlatforms="x86|x64" + /p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload' @@ -148,7 +148,7 @@ jobs: inputs: script: | AppInstallerCLITests.exe -logto $(Build.ArtifactStagingDirectory)\AICLI-Unpackaged.log -s -r junit -o $(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Unpackaged.xml - workingDirectory: '$(buildOutDir)\AppInstallerCLITests\' + workingDirectory: '$(buildOutDir)\AppInstallerCLITests' continueOnError: true - task: PublishBuildArtifacts@1 From 3e0f77b1fb9a04342dee6e2d38cb56ea2cb191a4 Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Thu, 13 Jan 2022 11:13:35 -0800 Subject: [PATCH 08/19] Fix test project platform --- azure-pipelines.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3bda1a3f8e..747c0a1091 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -105,22 +105,15 @@ jobs: platform: '$(buildPlatform)' solution: '$(solution)' configuration: '$(buildConfiguration)' - msbuildArgs: '-bl:$(Build.ArtifactStagingDirectory)\msbuild.binlog - /p:AppxBundlePlatforms="$(buildPlatform)" + msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload' - - task: PublishBuildArtifacts@1 - displayName: Publish MSBuild binlog - inputs: - PathtoPublish: $(Build.ArtifactStagingDirectory)\msbuild.binlog - ArtifactName: '$(buildPlatform)\msbuild.binlog' - condition: succeededOrFailed() - task: VSBuild@1 displayName: Build Test Project inputs: - platform: '$(buildConfiguration)' + platform: '$(buildPlatform)' solution: '$(solution)' configuration: '$(testBuildConfiguration)' From 3be73e5c09925393cbe0b5572a947a806d5cb029 Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Thu, 13 Jan 2022 11:53:42 -0800 Subject: [PATCH 09/19] Add binlog; comment unpackaged tests --- azure-pipelines.yml | 47 ++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 747c0a1091..1083af3552 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -105,11 +105,18 @@ jobs: platform: '$(buildPlatform)' solution: '$(solution)' configuration: '$(buildConfiguration)' - msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" + msbuildArgs: '/bl:$(Build.ArtifactStagingDirectory)\msbuild.binlog + /p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload' + - task: PublishBuildArtifacts@1 + displayName: Publish MSBuild logs + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)\msbuild.binlog' + ArtifactName: '$(buildPlatform)\msbuild.binlog' + - task: VSBuild@1 displayName: Build Test Project inputs: @@ -136,25 +143,25 @@ jobs: inputs: packageFeedSelector: 'nugetOrg' - - task: CmdLine@2 - displayName: Run Unit Tests Unpackaged - inputs: - script: | - AppInstallerCLITests.exe -logto $(Build.ArtifactStagingDirectory)\AICLI-Unpackaged.log -s -r junit -o $(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Unpackaged.xml - workingDirectory: '$(buildOutDir)\AppInstallerCLITests' - continueOnError: true - - - task: PublishBuildArtifacts@1 - displayName: Publish Unit Tests Unpackaged Log - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\AICLI-Unpackaged.log' - ArtifactName: '$(buildPlatform)\TestPassUnpackagedLog' - - - task: PublishBuildArtifacts@1 - displayName: Publish Unit Tests Unpackaged Output - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Unpackaged.xml' - ArtifactName: 'TestPassUnpackagedOutput' + # - task: CmdLine@2 + # displayName: Run Unit Tests Unpackaged + # inputs: + # script: | + # AppInstallerCLITests.exe -logto $(Build.ArtifactStagingDirectory)\AICLI-Unpackaged.log -s -r junit -o $(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Unpackaged.xml + # workingDirectory: '$(buildOutDir)\AppInstallerCLITests' + # continueOnError: true + + # - task: PublishBuildArtifacts@1 + # displayName: Publish Unit Tests Unpackaged Log + # inputs: + # PathtoPublish: '$(Build.ArtifactStagingDirectory)\AICLI-Unpackaged.log' + # ArtifactName: '$(buildPlatform)\TestPassUnpackagedLog' + + # - task: PublishBuildArtifacts@1 + # displayName: Publish Unit Tests Unpackaged Output + # inputs: + # PathtoPublish: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Unpackaged.xml' + # ArtifactName: 'TestPassUnpackagedOutput' - task: PowerShell@2 displayName: Run Unit Tests Packaged From 03e506bd6b73654d5bfef711e51fb11d5a07c057 Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Thu, 13 Jan 2022 12:23:16 -0800 Subject: [PATCH 10/19] Restore cert --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1083af3552..846d011f5b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -200,7 +200,7 @@ jobs: name: HTTPSDevCert displayName: 'Download Kestrel Certificate' inputs: - secureFile: 'AppInstallerTest.pfx' + secureFile: 'HTTPSDevCertV2.pfx' - task: MSBuild@1 displayName: Build MSIX Test Installer File From d589ce76193c1150521245f59cb3441f220a20ef Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Thu, 13 Jan 2022 13:34:30 -0800 Subject: [PATCH 11/19] Spelling --- .github/actions/spelling/allow.txt | 1 + azure-pipelines.yml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt index 83b120e228..92342b3c0e 100644 --- a/.github/actions/spelling/allow.txt +++ b/.github/actions/spelling/allow.txt @@ -37,6 +37,7 @@ auxdata azureedge backend bcrypt +binlog binver Bitmask Blog diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 846d011f5b..f40723f3f0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -181,7 +181,7 @@ jobs: displayName: Publish Unit Tests Packaged Output inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Packaged.xml' - ArtifactName: '$(buildPlatfom)\TestPassPackagedOutput' + ArtifactName: '$(buildPlatform)\TestPassPackagedOutput' - task: PublishTestResults@2 displayName: Publish Unit Test Results @@ -271,7 +271,7 @@ jobs: displayName: 'Copy Files: WinGetUtilInterop.UnitTests' inputs: SourceFolder: '$(Build.SourcesDirectory)\src\WinGetUtilInterop.UnitTests\bin\$(BuildConfiguration)\netcoreapp3.1' - TargetFolder: '$(Build.ArtifactStagingDiretory)\WinGetUtilInterop.UnitTests\' + TargetFolder: '$(Build.ArtifactStagingDirectory)\WinGetUtilInterop.UnitTests\' CleanTargetFolder: true OverWrite: true From 8d62dbc11e8704644f2137e233cb393072ab1266 Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Thu, 13 Jan 2022 15:40:09 -0800 Subject: [PATCH 12/19] Add MSBuild logs for test project --- azure-pipelines.yml | 62 +++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f40723f3f0..c156f76426 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -111,24 +111,26 @@ jobs: /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload' - - task: PublishBuildArtifacts@1 - displayName: Publish MSBuild logs - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\msbuild.binlog' - ArtifactName: '$(buildPlatform)\msbuild.binlog' - - task: VSBuild@1 displayName: Build Test Project inputs: platform: '$(buildPlatform)' solution: '$(solution)' configuration: '$(testBuildConfiguration)' + msbuildArgs: '/bl:$(Build.ArtifactStagingDirectory)\msbuild-testProject.binlog' + + - task: PublishPipelineArtifact@1 + displayName: Publish MSBuild logs + inputs: + targetPath: '$(Build.ArtifactStagingDirectory)\msbuild*.binlog' + artifactName: '$(buildPlatform)/' + condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 + - task: PublishPipelineArtifact@1 displayName: Publish WindowsPackageManager.dll Symbols inputs: - PathtoPublish: '$(buildOutDir)\WindowsPackageManager\WindowsPackageManager.pdb' - ArtifactName: '$(buildPlatform)\WindowsPackageManager.pdb' + targetPath: '$(buildOutDir)\WindowsPackageManager\WindowsPackageManager.pdb' + artifactName: '$(buildPlatform)/WindowsPackageManager.pdb' - task: PowerShell@2 displayName: Install Tests Dependencies @@ -151,17 +153,17 @@ jobs: # workingDirectory: '$(buildOutDir)\AppInstallerCLITests' # continueOnError: true - # - task: PublishBuildArtifacts@1 + # - task: PublishPipelineArtifact@1 # displayName: Publish Unit Tests Unpackaged Log # inputs: - # PathtoPublish: '$(Build.ArtifactStagingDirectory)\AICLI-Unpackaged.log' - # ArtifactName: '$(buildPlatform)\TestPassUnpackagedLog' + # targetPath: '$(Build.ArtifactStagingDirectory)\AICLI-Unpackaged.log' + # artifactName: '$(buildPlatform)/TestPassUnpackagedLog' - # - task: PublishBuildArtifacts@1 + # - task: PublishPipelineArtifact@1 # displayName: Publish Unit Tests Unpackaged Output # inputs: - # PathtoPublish: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Unpackaged.xml' - # ArtifactName: 'TestPassUnpackagedOutput' + # targetPath: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Unpackaged.xml' + # artifactName: '$(buildPlatform)/TestPassUnpackagedOutput' - task: PowerShell@2 displayName: Run Unit Tests Packaged @@ -171,17 +173,17 @@ jobs: workingDirectory: 'src' continueOnError: true - - task: PublishBuildArtifacts@1 + - task: PublishPipelineArtifact@1 displayName: Publish Unit Tests Packaged Log inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\AICLI-Packaged.log' - ArtifactName: '$(buildPlatform)\TestPassPackagedLog' + targetPath: '$(Build.ArtifactStagingDirectory)\AICLI-Packaged.log' + artifactName: '$(buildPlatform)/TestPassPackagedLog' - - task: PublishBuildArtifacts@1 + - task: PublishPipelineArtifact@1 displayName: Publish Unit Tests Packaged Output inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Packaged.xml' - ArtifactName: '$(buildPlatform)\TestPassPackagedOutput' + targetPath: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Packaged.xml' + artifactName: '$(buildPlatform)/TestPassPackagedOutput' - task: PublishTestResults@2 displayName: Publish Unit Test Results @@ -251,11 +253,11 @@ jobs: -ExeTestInstallerPath $(buildOutDir)\AppInstallerTestExeInstaller\AppInstallerTestExeInstaller.exe -PackageCertificatePath $(AppInstallerTest.secureFilePath)' - - task: PublishBuildArtifacts@1 + - task: PublishPipelineArtifact@1 displayName: Publish E2E Tests Packaged Log inputs: - PathtoPublish: 'C:\Users\VssAdministrator\AppData\Local\Temp\E2ETestLogs' - ArtifactName: '$(buildPlatform)\E2ETestPackagedLog' + targetPath: 'C:\Users\VssAdministrator\AppData\Local\Temp\E2ETestLogs' + artifactName: '$(buildPlatform)/E2ETestPackagedLog' - task: VSTest@2 displayName: Run Com Interface Tests @@ -285,17 +287,17 @@ jobs: platform: 'Any CPU' configuration: '$(BuildConfiguration)' - - task: PublishBuildArtifacts@1 + - task: PublishPipelineArtifact@1 displayName: Publish Util Binary inputs: - PathtoPublish: '$(buildOutDir)\WinGetUtil\WinGetUtil.dll' - ArtifactName: '$(buildPlatform)\WinGetUtil.dll' + targetPath: '$(buildOutDir)\WinGetUtil\WinGetUtil.dll' + artifactName: '$(buildPlatform)/WinGetUtil.dll' - - task: PublishBuildArtifacts@1 + - task: PublishPipelineArtifact@1 displayName: Publish Util Symbols inputs: - PathtoPublish: '$(buildOutDir)\WinGetUtil\WinGetUtil.pdb' - ArtifactName: '$(buildPlatform)\WinGetUtil.pdb' + targetPath: '$(buildOutDir)\WinGetUtil\WinGetUtil.pdb' + artifactName: '$(buildPlatform)/WinGetUtil.pdb' - task: ComponentGovernanceComponentDetection@0 displayName: Component Governance From 8824755ac89b85f1b42fa12e985c242420fc916a Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Thu, 13 Jan 2022 16:24:55 -0800 Subject: [PATCH 13/19] Fix publish MSBuild logs --- azure-pipelines.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c156f76426..4ca9d2370f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -123,14 +123,14 @@ jobs: displayName: Publish MSBuild logs inputs: targetPath: '$(Build.ArtifactStagingDirectory)\msbuild*.binlog' - artifactName: '$(buildPlatform)/' + artifactName: '$(buildPlatform)\MSBuild' condition: succeededOrFailed() - task: PublishPipelineArtifact@1 displayName: Publish WindowsPackageManager.dll Symbols inputs: targetPath: '$(buildOutDir)\WindowsPackageManager\WindowsPackageManager.pdb' - artifactName: '$(buildPlatform)/WindowsPackageManager.pdb' + artifactName: '$(buildPlatform)\WindowsPackageManager.pdb' - task: PowerShell@2 displayName: Install Tests Dependencies @@ -157,13 +157,13 @@ jobs: # displayName: Publish Unit Tests Unpackaged Log # inputs: # targetPath: '$(Build.ArtifactStagingDirectory)\AICLI-Unpackaged.log' - # artifactName: '$(buildPlatform)/TestPassUnpackagedLog' + # artifactName: '$(buildPlatform)\TestPassUnpackagedLog' # - task: PublishPipelineArtifact@1 # displayName: Publish Unit Tests Unpackaged Output # inputs: # targetPath: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Unpackaged.xml' - # artifactName: '$(buildPlatform)/TestPassUnpackagedOutput' + # artifactName: '$(buildPlatform)\TestPassUnpackagedOutput' - task: PowerShell@2 displayName: Run Unit Tests Packaged @@ -177,13 +177,13 @@ jobs: displayName: Publish Unit Tests Packaged Log inputs: targetPath: '$(Build.ArtifactStagingDirectory)\AICLI-Packaged.log' - artifactName: '$(buildPlatform)/TestPassPackagedLog' + artifactName: '$(buildPlatform)\TestPassPackagedLog' - task: PublishPipelineArtifact@1 displayName: Publish Unit Tests Packaged Output inputs: targetPath: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Packaged.xml' - artifactName: '$(buildPlatform)/TestPassPackagedOutput' + artifactName: '$(buildPlatform)\TestPassPackagedOutput' - task: PublishTestResults@2 displayName: Publish Unit Test Results @@ -257,7 +257,7 @@ jobs: displayName: Publish E2E Tests Packaged Log inputs: targetPath: 'C:\Users\VssAdministrator\AppData\Local\Temp\E2ETestLogs' - artifactName: '$(buildPlatform)/E2ETestPackagedLog' + artifactName: '$(buildPlatform)\E2ETestPackagedLog' - task: VSTest@2 displayName: Run Com Interface Tests @@ -291,13 +291,13 @@ jobs: displayName: Publish Util Binary inputs: targetPath: '$(buildOutDir)\WinGetUtil\WinGetUtil.dll' - artifactName: '$(buildPlatform)/WinGetUtil.dll' + artifactName: '$(buildPlatform)\WinGetUtil.dll' - task: PublishPipelineArtifact@1 displayName: Publish Util Symbols inputs: targetPath: '$(buildOutDir)\WinGetUtil\WinGetUtil.pdb' - artifactName: '$(buildPlatform)/WinGetUtil.pdb' + artifactName: '$(buildPlatform)\WinGetUtil.pdb' - task: ComponentGovernanceComponentDetection@0 displayName: Component Governance From a6e851344e438d07aab5c29b90c2b289ab3ce5ee Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Thu, 13 Jan 2022 16:52:19 -0800 Subject: [PATCH 14/19] Fix artifact names --- azure-pipelines.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4ca9d2370f..0d232e2e07 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -123,14 +123,14 @@ jobs: displayName: Publish MSBuild logs inputs: targetPath: '$(Build.ArtifactStagingDirectory)\msbuild*.binlog' - artifactName: '$(buildPlatform)\MSBuild' + artifactName: '$(buildPlatform)_MSBuild' condition: succeededOrFailed() - task: PublishPipelineArtifact@1 displayName: Publish WindowsPackageManager.dll Symbols inputs: targetPath: '$(buildOutDir)\WindowsPackageManager\WindowsPackageManager.pdb' - artifactName: '$(buildPlatform)\WindowsPackageManager.pdb' + artifactName: '$(buildPlatform)_WindowsPackageManager.pdb' - task: PowerShell@2 displayName: Install Tests Dependencies @@ -157,13 +157,13 @@ jobs: # displayName: Publish Unit Tests Unpackaged Log # inputs: # targetPath: '$(Build.ArtifactStagingDirectory)\AICLI-Unpackaged.log' - # artifactName: '$(buildPlatform)\TestPassUnpackagedLog' + # artifactName: '$(buildPlatform)_TestPassUnpackagedLog' # - task: PublishPipelineArtifact@1 # displayName: Publish Unit Tests Unpackaged Output # inputs: # targetPath: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Unpackaged.xml' - # artifactName: '$(buildPlatform)\TestPassUnpackagedOutput' + # artifactName: '$(buildPlatform)_TestPassUnpackagedOutput' - task: PowerShell@2 displayName: Run Unit Tests Packaged @@ -177,13 +177,13 @@ jobs: displayName: Publish Unit Tests Packaged Log inputs: targetPath: '$(Build.ArtifactStagingDirectory)\AICLI-Packaged.log' - artifactName: '$(buildPlatform)\TestPassPackagedLog' + artifactName: '$(buildPlatform)_TestPassPackagedLog' - task: PublishPipelineArtifact@1 displayName: Publish Unit Tests Packaged Output inputs: targetPath: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Packaged.xml' - artifactName: '$(buildPlatform)\TestPassPackagedOutput' + artifactName: '$(buildPlatform)_TestPassPackagedOutput' - task: PublishTestResults@2 displayName: Publish Unit Test Results @@ -257,7 +257,7 @@ jobs: displayName: Publish E2E Tests Packaged Log inputs: targetPath: 'C:\Users\VssAdministrator\AppData\Local\Temp\E2ETestLogs' - artifactName: '$(buildPlatform)\E2ETestPackagedLog' + artifactName: '$(buildPlatform)_E2ETestPackagedLog' - task: VSTest@2 displayName: Run Com Interface Tests @@ -291,13 +291,13 @@ jobs: displayName: Publish Util Binary inputs: targetPath: '$(buildOutDir)\WinGetUtil\WinGetUtil.dll' - artifactName: '$(buildPlatform)\WinGetUtil.dll' + artifactName: '$(buildPlatform)_WinGetUtil.dll' - task: PublishPipelineArtifact@1 displayName: Publish Util Symbols inputs: targetPath: '$(buildOutDir)\WinGetUtil\WinGetUtil.pdb' - artifactName: '$(buildPlatform)\WinGetUtil.pdb' + artifactName: '$(buildPlatform)_WinGetUtil.pdb' - task: ComponentGovernanceComponentDetection@0 displayName: Component Governance From dd8fde0058d3d639dec9bf0615562bc5d761d32b Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Thu, 13 Jan 2022 17:36:39 -0800 Subject: [PATCH 15/19] Simplify artifact publish --- azure-pipelines.yml | 71 ++++++++++++++------------------------------- 1 file changed, 21 insertions(+), 50 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0d232e2e07..ea2f4d6baf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -55,6 +55,7 @@ jobs: variables: BuildVer: $[counter(dependencies.GetReleaseTag.outputs['GetTag.tag'], 1)] buildOutDir: $(Build.SourcesDirectory)\src\$(buildPlatform)\$(buildConfiguration) + artifactsDir: $(Build.ArtifactStagingDirectory)\$(buildPlatform) steps: - task: NuGetToolInstaller@1 @@ -105,7 +106,7 @@ jobs: platform: '$(buildPlatform)' solution: '$(solution)' configuration: '$(buildConfiguration)' - msbuildArgs: '/bl:$(Build.ArtifactStagingDirectory)\msbuild.binlog + msbuildArgs: '/bl:$(artifactsDir)\msbuild.binlog /p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always @@ -117,20 +118,13 @@ jobs: platform: '$(buildPlatform)' solution: '$(solution)' configuration: '$(testBuildConfiguration)' - msbuildArgs: '/bl:$(Build.ArtifactStagingDirectory)\msbuild-testProject.binlog' + msbuildArgs: '/bl:$(artifactsDir)\msbuild-testProject.binlog' - - task: PublishPipelineArtifact@1 - displayName: Publish MSBuild logs - inputs: - targetPath: '$(Build.ArtifactStagingDirectory)\msbuild*.binlog' - artifactName: '$(buildPlatform)_MSBuild' - condition: succeededOrFailed() - - - task: PublishPipelineArtifact@1 - displayName: Publish WindowsPackageManager.dll Symbols + - task: CopyFiles@2 + displayName: 'Copy WindowsPackageManager.dll Symbols to artifacts folder' inputs: - targetPath: '$(buildOutDir)\WindowsPackageManager\WindowsPackageManager.pdb' - artifactName: '$(buildPlatform)_WindowsPackageManager.pdb' + Contents: '$(buildOutDir)\WindowsPackageManager\WindowsPackageManager.pdb' + TargetFolder: '$(artifactsDir)' - task: PowerShell@2 displayName: Install Tests Dependencies @@ -149,42 +143,18 @@ jobs: # displayName: Run Unit Tests Unpackaged # inputs: # script: | - # AppInstallerCLITests.exe -logto $(Build.ArtifactStagingDirectory)\AICLI-Unpackaged.log -s -r junit -o $(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Unpackaged.xml + # AppInstallerCLITests.exe -logto $(artifactsDir)\AICLI-Unpackaged.log -s -r junit -o $(artifactsDir)\TEST-AppInstallerCLI-Unpackaged.xml # workingDirectory: '$(buildOutDir)\AppInstallerCLITests' # continueOnError: true - # - task: PublishPipelineArtifact@1 - # displayName: Publish Unit Tests Unpackaged Log - # inputs: - # targetPath: '$(Build.ArtifactStagingDirectory)\AICLI-Unpackaged.log' - # artifactName: '$(buildPlatform)_TestPassUnpackagedLog' - - # - task: PublishPipelineArtifact@1 - # displayName: Publish Unit Tests Unpackaged Output - # inputs: - # targetPath: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Unpackaged.xml' - # artifactName: '$(buildPlatform)_TestPassUnpackagedOutput' - - task: PowerShell@2 displayName: Run Unit Tests Packaged inputs: filePath: 'src\AppInstallerCLITests\Run-TestsInPackage.ps1' - arguments: '-Args "~[pips]" -BuildRoot $(buildOutDir) -PackageRoot AppInstallerCLIPackage\bin\$(buildPlatform)\$(buildConfiguration) -LogTarget $(Build.ArtifactStagingDirectory)\AICLI-Packaged.log -TestResultsTarget $(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Packaged.xml -ScriptWait' + arguments: '-Args "~[pips]" -BuildRoot $(buildOutDir) -PackageRoot AppInstallerCLIPackage\bin\$(buildPlatform)\$(buildConfiguration) -LogTarget $(artifactsDir)\AICLI-Packaged.log -TestResultsTarget $(artifactsDir)\TEST-AppInstallerCLI-Packaged.xml -ScriptWait' workingDirectory: 'src' continueOnError: true - - task: PublishPipelineArtifact@1 - displayName: Publish Unit Tests Packaged Log - inputs: - targetPath: '$(Build.ArtifactStagingDirectory)\AICLI-Packaged.log' - artifactName: '$(buildPlatform)_TestPassPackagedLog' - - - task: PublishPipelineArtifact@1 - displayName: Publish Unit Tests Packaged Output - inputs: - targetPath: '$(Build.ArtifactStagingDirectory)\TEST-AppInstallerCLI-Packaged.xml' - artifactName: '$(buildPlatform)_TestPassPackagedOutput' - - task: PublishTestResults@2 displayName: Publish Unit Test Results inputs: @@ -253,11 +223,11 @@ jobs: -ExeTestInstallerPath $(buildOutDir)\AppInstallerTestExeInstaller\AppInstallerTestExeInstaller.exe -PackageCertificatePath $(AppInstallerTest.secureFilePath)' - - task: PublishPipelineArtifact@1 - displayName: Publish E2E Tests Packaged Log + - task: CopyFiles@2 + displayName: 'Copy E2E Tests Package Log to artifacts folder' inputs: - targetPath: 'C:\Users\VssAdministrator\AppData\Local\Temp\E2ETestLogs' - artifactName: '$(buildPlatform)_E2ETestPackagedLog' + SourceFolder: 'C:\Users\VssAdministrator\AppData\Local\Temp\E2ETestLogs' + TargetFolder: '$(artifactsDir)\E2ETestsPackagedLog' - task: VSTest@2 displayName: Run Com Interface Tests @@ -287,17 +257,18 @@ jobs: platform: 'Any CPU' configuration: '$(BuildConfiguration)' - - task: PublishPipelineArtifact@1 - displayName: Publish Util Binary + - task: CopyFiles@2 + displayName: 'Copy Util to artifacts folder' inputs: - targetPath: '$(buildOutDir)\WinGetUtil\WinGetUtil.dll' - artifactName: '$(buildPlatform)_WinGetUtil.dll' + Contents: '$(buildOutDir)\WinGetUtil\WinGetUtil.dll + $(buildOutDir)\WinGetUtil\WinGetUtil.pdb' + TargetFolder: '$(artifactsDir)' - task: PublishPipelineArtifact@1 - displayName: Publish Util Symbols + displayName: Publish Pipeline Artifacts inputs: - targetPath: '$(buildOutDir)\WinGetUtil\WinGetUtil.pdb' - artifactName: '$(buildPlatform)_WinGetUtil.pdb' + targetPath: '$(artifactsDir)' + condition: always() - task: ComponentGovernanceComponentDetection@0 displayName: Component Governance From 208a846bd203e0f4d8e7b2bc8621123b70c093de Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Fri, 14 Jan 2022 10:47:48 -0800 Subject: [PATCH 16/19] Add back appx msbuildargs --- azure-pipelines.yml | 6 +++++- src/PackagedTests/PackagedTests.csproj | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ea2f4d6baf..5d286846cc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -118,7 +118,11 @@ jobs: platform: '$(buildPlatform)' solution: '$(solution)' configuration: '$(testBuildConfiguration)' - msbuildArgs: '/bl:$(artifactsDir)\msbuild-testProject.binlog' + msbuildArgs: '/bl:$(artifactsDir)\msbuild-testProject.binlog + /p:AppxBundlePlatforms="$(buildPlatform)" + /p:AppxPackageDir="$(appxPackageDir)" + /p:AppxBundle=Always + /p:UapAppxPackageBuildMode=StoreUpload' - task: CopyFiles@2 displayName: 'Copy WindowsPackageManager.dll Symbols to artifacts folder' diff --git a/src/PackagedTests/PackagedTests.csproj b/src/PackagedTests/PackagedTests.csproj index d3ace89322..e049ca2853 100644 --- a/src/PackagedTests/PackagedTests.csproj +++ b/src/PackagedTests/PackagedTests.csproj @@ -28,8 +28,6 @@ false true TRACE;NETFX_CORE;WINDOWS_UWP - Always - x64 x86 From 4c01b7e181d029872ed018b94a6575ddf1556a9f Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Fri, 14 Jan 2022 12:14:45 -0800 Subject: [PATCH 17/19] Fix E2E test logs copy --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5d286846cc..258e6c31b4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -230,8 +230,9 @@ jobs: - task: CopyFiles@2 displayName: 'Copy E2E Tests Package Log to artifacts folder' inputs: - SourceFolder: 'C:\Users\VssAdministrator\AppData\Local\Temp\E2ETestLogs' + SourceFolder: '$(temp)\E2ETestLogs' TargetFolder: '$(artifactsDir)\E2ETestsPackagedLog' + continueOnError: true - task: VSTest@2 displayName: Run Com Interface Tests From 5f4bccd018eeea16a20250543ee0ffb347ba233b Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Fri, 14 Jan 2022 13:08:43 -0800 Subject: [PATCH 18/19] Fix E2E test logs copy --- azure-pipelines.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 258e6c31b4..e8d8bdca32 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -227,12 +227,13 @@ jobs: -ExeTestInstallerPath $(buildOutDir)\AppInstallerTestExeInstaller\AppInstallerTestExeInstaller.exe -PackageCertificatePath $(AppInstallerTest.secureFilePath)' + # TODO: This does not seem to be matching the logs for x86 - task: CopyFiles@2 displayName: 'Copy E2E Tests Package Log to artifacts folder' inputs: - SourceFolder: '$(temp)\E2ETestLogs' + SourceFolder: '$(temp)' + Contents: 'E2ETestLogs\**' TargetFolder: '$(artifactsDir)\E2ETestsPackagedLog' - continueOnError: true - task: VSTest@2 displayName: Run Com Interface Tests From 1a8ec86f8095811b48d906d9254595cdf2f90e82 Mon Sep 17 00:00:00 2001 From: Flor Elisa Chacon Ochoa Date: Fri, 14 Jan 2022 16:49:10 -0800 Subject: [PATCH 19/19] Fix x86 E2E test logs copy --- azure-pipelines.yml | 4 +--- src/AppInstallerCLIE2ETests/SetUpFixture.cs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e8d8bdca32..e8623b5717 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -227,12 +227,10 @@ jobs: -ExeTestInstallerPath $(buildOutDir)\AppInstallerTestExeInstaller\AppInstallerTestExeInstaller.exe -PackageCertificatePath $(AppInstallerTest.secureFilePath)' - # TODO: This does not seem to be matching the logs for x86 - task: CopyFiles@2 displayName: 'Copy E2E Tests Package Log to artifacts folder' inputs: - SourceFolder: '$(temp)' - Contents: 'E2ETestLogs\**' + SourceFolder: '$(temp)\E2ETestLogs' TargetFolder: '$(artifactsDir)\E2ETestsPackagedLog' - task: VSTest@2 diff --git a/src/AppInstallerCLIE2ETests/SetUpFixture.cs b/src/AppInstallerCLIE2ETests/SetUpFixture.cs index 61f9a9e0b3..491af06af5 100644 --- a/src/AppInstallerCLIE2ETests/SetUpFixture.cs +++ b/src/AppInstallerCLIE2ETests/SetUpFixture.cs @@ -143,7 +143,7 @@ private bool EnableDevMode(bool enable) else { var value = appModelUnlockKey.GetValue("AllowDevelopmentWithoutDevLicense"); - if (value != null && ((UInt32)value) != 0) + if (value != null && ((Int32)value) != 0) { appModelUnlockKey.SetValue("AllowDevelopmentWithoutDevLicense", 0, RegistryValueKind.DWord); return true;