Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/microsoft/winget-cli into…
Browse files Browse the repository at this point in the history
… user/t-jabbott/powershell
  • Loading branch information
jontab committed Jul 21, 2022
2 parents 8aa5a4e + 156282c commit d8e4fe4
Show file tree
Hide file tree
Showing 36 changed files with 1,716 additions and 139 deletions.
21 changes: 15 additions & 6 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
abcd
accepteula
acl
activatable
adjacents
adml
admx
Expand All @@ -12,7 +11,7 @@ aicli
AICLIC
ajor
alreadyinstalled
amd
Amd
amrutha
anonymized
APARTMENTTHREADED
Expand Down Expand Up @@ -77,6 +76,8 @@ ci
cinq
CLIE
cloudapp
cls
clsctx
clsid
COINIT
COMGLB
Expand Down Expand Up @@ -118,6 +119,7 @@ endian
enums
EQU
ERANGE
errmsg
errno
ESRB
etest
Expand All @@ -129,6 +131,8 @@ fd
fdw
fedorapeople
fileinuse
Filtercriteria
Finalizers
fintimes
Fixfor
flargle
Expand Down Expand Up @@ -167,14 +171,18 @@ htm
IARP
IAttachment
IConfiguration
ICreate
idx
IEnum
IFACEMETHODIMP
IFile
IFind
IGlobal
IHelp
IHost
IID
iid
IInstall
IInstance
IISOn
img
IMutable
Expand All @@ -196,6 +204,7 @@ ISQ
issuecomment
ISVs
itr
IUninstall
IVector
IWeb
IZone
Expand Down Expand Up @@ -266,6 +275,7 @@ myinstalldir
mylog
mysilent
mysilentwithprogress
nameof
NESTEDINSTALLER
NETFX
netlify
Expand All @@ -287,12 +297,10 @@ objbase
objidl
ofile
Outptr
OSVERSION
Packagedx
PACL
packageinuse
PARAMETERMAP
paramref
PACL
pathparts
Patil
pb
Expand Down Expand Up @@ -406,6 +414,7 @@ trimstart
TState
TStatus
typeof
typeparam
UCase
ucasemap
UChars
Expand Down
58 changes: 43 additions & 15 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,22 +217,50 @@ jobs:
CleanTargetFolder: false
OverWrite: true

- task: VSTest@2
displayName: Run E2E Tests Packaged
- template: templates/e2e-test.template.yml
parameters:
title: "E2E Tests Packaged"
isPackaged: true
filter: "TestCategory!=InProcess&TestCategory!=OutOfProcess"

- template: templates/e2e-test.template.yml
parameters:
title: "COM API E2E Tests (In-process)"
isPackaged: false
filter: "TestCategory=InProcess"

- task: PowerShell@2
displayName: 'Set program files directory'
inputs:
testRunTitle: 'E2E Packaged'
testSelector: 'testAssemblies'
testAssemblyVer2: '$(buildOutDir)\AppInstallerCLIE2ETests\AppInstallerCLIE2ETests.dll'
runSettingsFile: '$(buildOutDir)\AppInstallerCLIE2ETests\Test.runsettings'
overrideTestrunParameters: '-PackagedContext true
-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 $(buildOutDir)\AppInstallerTestExeInstaller\AppInstallerTestExeInstaller.exe
-PackageCertificatePath $(AppInstallerTest.secureFilePath)'
targetType: 'inline'
script: |
if ("$(buildPlatform)" -eq "x86") {
Write-Host "##vso[task.setvariable variable=platformProgramFiles;]${env:ProgramFiles(x86)}"
} else {
Write-Host "##vso[task.setvariable variable=platformProgramFiles;]${env:ProgramFiles}"
}
# Winmd accessed by test runner process (dotnet.exe)
- task: CopyFiles@2
displayName: 'Copy winmd to dotnet directory'
inputs:
SourceFolder: '$(buildOutDir)\Microsoft.Management.Deployment'
TargetFolder: '$(platformProgramFiles)\dotnet'
Contents: Microsoft.Management.Deployment.winmd

# Winmd accessed by WinGetServer process (WindowsPackageManagerServer.exe)
- task: CopyFiles@2
displayName: 'Copy winmd to Package Output'
inputs:
SourceFolder: '$(buildOutDir)\Microsoft.Management.Deployment'
TargetFolder: 'src\AppInstallerCLIPackage\bin\$(buildPlatform)\$(buildConfiguration)'
Contents: Microsoft.Management.Deployment.winmd

- template: templates/e2e-test.template.yml
parameters:
title: "COM API E2E Tests (Out-of-process)"
isPackaged: true
filter: "TestCategory=OutOfProcess"

- task: CopyFiles@2
displayName: 'Copy E2E Tests Package Log to artifacts folder'
Expand Down
28 changes: 28 additions & 0 deletions src/AppInstallerCLI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PowerShell", "PowerShell",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.WinGet.Client", "PowerShell\Microsoft.WinGet.Client\Microsoft.WinGet.Client.csproj", "{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Management.Deployment.Projection", "Microsoft.Management.Deployment.Projection\Microsoft.Management.Deployment.Projection.csproj", "{0B104762-5CD8-47EE-A904-71C1C3F84DCD}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UndockedRegFreeWinRT", "UndockedRegFreeWinRT\UndockedRegFreeWinRT\UndockedRegFreeWinRT.vcxproj", "{31ED69A8-5310-45A9-953F-56C351D2C3E1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Detours", "UndockedRegFreeWinRT\detours\detours.vcxproj", "{787EC629-C0FB-4BA9-9746-4A82CD06B73E}"
Expand Down Expand Up @@ -1066,6 +1068,32 @@ Global
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|x64.Build.0 = Debug|x64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|x86.ActiveCfg = Debug|x86
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|x86.Build.0 = Debug|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|Any CPU.ActiveCfg = Debug|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|ARM.ActiveCfg = Debug|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|ARM64.ActiveCfg = Debug|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|x64.ActiveCfg = Debug|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|x64.Build.0 = Debug|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|x86.ActiveCfg = Debug|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|x86.Build.0 = Debug|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|Any CPU.ActiveCfg = TestOnly|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|Any CPU.Build.0 = TestOnly|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|ARM.ActiveCfg = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|ARM64.ActiveCfg = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|x64.ActiveCfg = Release|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|x86.ActiveCfg = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|Any CPU.ActiveCfg = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|ARM.ActiveCfg = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|ARM64.ActiveCfg = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|x64.ActiveCfg = Release|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|x64.Build.0 = Release|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|x86.ActiveCfg = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|x86.Build.0 = Release|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|Any CPU.ActiveCfg = TestOnly|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|Any CPU.Build.0 = TestOnly|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|ARM.ActiveCfg = TestOnly|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|ARM64.ActiveCfg = TestOnly|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|x64.ActiveCfg = Release|x64
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|x86.ActiveCfg = Release|x86
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Debug|Any CPU.ActiveCfg = Debug|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Debug|ARM.ActiveCfg = Debug|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Debug|ARM64.ActiveCfg = Debug|Win32
Expand Down
18 changes: 18 additions & 0 deletions src/AppInstallerCLIE2ETests/AppInstallerCLIE2ETests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@
<ItemGroup>
<PackageReference Include="Microsoft.Msix.Utils" Version="2.0.3" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="1.6.4" />
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
</ItemGroup>

<!-- CsWinRT properties -->
<PropertyGroup>
<CsWinRTWindowsMetadata>10.0.17763.0</CsWinRTWindowsMetadata>
</PropertyGroup>

<ItemGroup>
<Content Include="TestData\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -30,6 +36,13 @@

<ItemGroup>
<ProjectReference Include="..\IndexCreationTool\IndexCreationTool.csproj" />
<ProjectReference Include="..\Microsoft.Management.Deployment.Projection\Microsoft.Management.Deployment.Projection.csproj" />
<ProjectReference Include="..\Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.vcxproj">
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\WindowsPackageManager\WindowsPackageManager.vcxproj">
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>

<ItemGroup>
Expand All @@ -38,4 +51,9 @@
</None>
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<!-- Rename dll to align with the expected search pattern performed by CsWinRT -->
<Copy SourceFiles="$(TargetDir)..\Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.dll" DestinationFiles="$(TargetDir)Microsoft.Management.Deployment.dll" />
<Copy SourceFiles="$(TargetDir)..\WindowsPackageManager\WindowsPackageManager.dll" DestinationFiles="$(TargetDir)WindowsPackageManager.dll" />
</Target>
</Project>
9 changes: 2 additions & 7 deletions src/AppInstallerCLIE2ETests/BaseCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace AppInstallerCLIE2ETests
{
using System;
using System.IO;
using System.Threading;
using Newtonsoft.Json.Linq;
using NUnit.Framework;

Expand All @@ -20,16 +19,12 @@ public void BaseSetup()
[OneTimeTearDown]
public void BaseTeardown()
{
TestCommon.RunAICLICommand("source reset", "--force");
TestCommon.TearDownTestSource();
}

public void ResetTestSource()
{
TestCommon.RunAICLICommand("source reset", "--force");
TestCommon.RunAICLICommand("source remove", Constants.DefaultWingetSourceName);
TestCommon.RunAICLICommand("source remove", Constants.DefaultMSStoreSourceName);
TestCommon.RunAICLICommand("source add", $"{Constants.TestSourceName} {Constants.TestSourceUrl}");
Thread.Sleep(2000);
TestCommon.SetupTestSource();
}

public void ConfigureFeature(string featureName, bool status)
Expand Down
16 changes: 16 additions & 0 deletions src/AppInstallerCLIE2ETests/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,36 @@ public class Constants
public const string WinGetUtil = "WinGetUtil";
public const string E2ETestLogsPath = @"Packages\WinGetDevCLI_8wekyb3d8bbwe\LocalState\DiagOutputDir";

// Installer filename
public const string TestCommandExe = "testCommand.exe";
public const string AppInstallerTestExeInstallerExe = "AppInstallerTestExeInstaller.exe";

// Test installers' package IDs
public const string ExeInstallerPackageId = "AppInstallerTest.TestExeInstaller";
public const string MsiInstallerPackageId = "AppInstallerTest.TestMsiInstaller";
public const string MsixInstallerPackageId = "AppInstallerTest.TestMsixInstaller";
public const string PortableExePackageId = "AppInstallerTest.TestPortableExe";
public const string PortableExeWithCommandPackageId = "AppInstallerTest.TestPortableExeWithCommand";

public const string MsiInstallerProductCode = "{A5D36CF1-1993-4F63-BFB4-3ACD910D36A1}";
public const string MsixInstallerName = "6c6338fe-41b7-46ca-8ba6-b5ad5312bb0e";
public const string MsixInstallerPackageFamilyName = "6c6338fe-41b7-46ca-8ba6-b5ad5312bb0e_8wekyb3d8bbwe";

public const string TestExeInstalledFileName = "TestExeInstalled.txt";
public const string TestExeUninstallerFileName = "UninstallTestExe.bat";
public const string TestExeUninstalledFileName = "TestExeUninstalled.txt";

// Locations
public const string LocalAppData = "LocalAppData";

// Package dir
public const string PortableExePackageDirName = $"{PortableExePackageId}_{TestSourceIdentifier}";
public const string PortableExeWithCommandPackageDirName = $"{PortableExeWithCommandPackageId}_{TestSourceIdentifier}";

// Registry keys
public const string WinGetPackageIdentifier = "WinGetPackageIdentifier";
public const string WinGetSourceIdentifier = "WinGetSourceIdentifier";

public class ErrorCode
{
public const int S_OK = 0;
Expand Down
Loading

0 comments on commit d8e4fe4

Please sign in to comment.