Skip to content

Commit

Permalink
template
Browse files Browse the repository at this point in the history
  • Loading branch information
msftrubengu committed Jul 21, 2023
1 parent b4a64f1 commit 45c8fac
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 22 deletions.
22 changes: 4 additions & 18 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,6 @@ jobs:
/p:UapAppxPackageBuildMode=SideLoadOnly
/p:AppxPackageSigningEnabled=false'

- task: PowerShell@2
displayName: Install Root Certificate
inputs:
filePath: 'src\LocalhostWebServer\InstallDevCert.ps1'
arguments: '-pfxpath $(HTTPSDevCert.secureFilePath) -password microsoft'

- task: PowerShell@2
displayName: Launch LocalhostWebServer
inputs:
filePath: 'src\LocalhostWebServer\Run-LocalhostWebServer.ps1'
arguments: '-BuildRoot $(buildOutDir)\LocalhostWebServer -StaticFileRoot $(Agent.TempDirectory)\TestLocalIndex -CertPath $(HTTPSDevCert.secureFilePath) -CertPassword microsoft -OutCertFile $(Agent.TempDirectory)\servercert.cer -LocalSourceJson $(Build.SourcesDirectory)\src\AppInstallerCLIE2ETests\TestData\localsource.json'

- task: PowerShell@2
displayName: 'Set program files directory'
inputs:
Expand Down Expand Up @@ -240,12 +228,10 @@ jobs:
TargetFolder: '$(platformProgramFiles)\dotnet'
Contents: Microsoft.Management.Deployment.winmd

- task: PowerShell@2
displayName: Setup Local PS Repository
inputs:
filePath: 'src\AppInstallerCLIE2ETests\TestData\Configuration\Init-TestRepository.ps1'
arguments: '-Force'
pwsh: true
- template: templates/e2e-setup.yml
parameters:
source: $(Build.SourcesDirectory)
buildOutDir: $(buildOutDir)

- template: templates/e2e-test.template.yml
parameters:
Expand Down
38 changes: 38 additions & 0 deletions templates/e2e-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Configures local test source and local PowerShell repository.
parameters:
- name: source
type: string
- name: buildOutDir
type: string

steps:
- task: DownloadSecureFile@1
name: AppInstallerTest
displayName: 'Download Source Package Certificate'
inputs:
secureFile: 'AppInstallerTest.pfx'

- task: DownloadSecureFile@1
name: HTTPSDevCert
displayName: 'Download Kestrel Certificate'
inputs:
secureFile: 'HTTPSDevCertV2.pfx'

- task: PowerShell@2
displayName: Install Root Certificate
inputs:
filePath: '${{ parameters.source }}\src\LocalhostWebServer\InstallDevCert.ps1'
arguments: '-pfxpath $(HTTPSDevCert.secureFilePath) -password microsoft'

- task: PowerShell@2
displayName: Launch LocalhostWebServer
inputs:
filePath: '${{ parameters.source }}\src\LocalhostWebServer\Run-LocalhostWebServer.ps1'
arguments: '-BuildRoot ${{ parameters.buildOutDir }}\LocalhostWebServer -StaticFileRoot $(Agent.TempDirectory)\TestLocalIndex -CertPath $(HTTPSDevCert.secureFilePath) -CertPassword microsoft -OutCertFile $(Agent.TempDirectory)\servercert.cer -LocalSourceJson ${{ parameters.source }}\src\AppInstallerCLIE2ETests\TestData\localsource.json'

- task: PowerShell@2
displayName: Setup Local PS Repository
inputs:
filePath: '${{ parameters.source }}\src\AppInstallerCLIE2ETests\TestData\Configuration\Init-TestRepository.ps1'
arguments: '-Force'
pwsh: true
8 changes: 4 additions & 4 deletions templates/e2e-test.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ steps:
-InvokeCommandInDesktopPackage true
-StaticFileRootPath $(Agent.TempDirectory)\TestLocalIndex
-PowerShellModulePath $(buildOutDir)\PowerShell\Microsoft.WinGet.Client\Microsoft.WinGet.Client.psd1
-LocalServerCertPath $(Agent.TempDirectory)\servercert.cer'
-SkipTestSource true
-LocalServerCertPath $(Agent.TempDirectory)\servercert.cer
-SkipTestSource true'
${{ else }}:
overrideTestrunParameters: '-PackagedContext false
-AICLIPath $(packageLayoutDir)\AppInstallerCLI\winget.exe
-InvokeCommandInDesktopPackage false
-StaticFileRootPath $(Agent.TempDirectory)\TestLocalIndex
-PowerShellModulePath $(buildOutDir)\PowerShell\Microsoft.WinGet.Client\Microsoft.WinGet.Client.psd1
-LocalServerCertPath $(Agent.TempDirectory)\servercert.cer'
-SkipTestSource true
-LocalServerCertPath $(Agent.TempDirectory)\servercert.cer
-SkipTestSource true'

- task: CmdLine@2
displayName: Complete COM trace for ${{ parameters.title }}
Expand Down

0 comments on commit 45c8fac

Please sign in to comment.