Skip to content

Commit

Permalink
(GH-686) Upgrade Scenarios for Prereleases
Browse files Browse the repository at this point in the history
- upgrade existing package with prerelease available but without
prerelease specified
- Upgrading an existing package with prerelease available and
prerelease specified
- Upgrade installed prerelease without prerelease specified
- Upgrade installed prerelease with prerelease available with
`--exclude-prerelease`
- Upgrade all with prereleases installed
- Upgrade all with prereleases installed with `--exclude-prerelease`
specified
  • Loading branch information
ferventcoder committed Mar 19, 2017
1 parent 3ce7e90 commit 25ab95f
Show file tree
Hide file tree
Showing 21 changed files with 790 additions and 1 deletion.
80 changes: 79 additions & 1 deletion Scenarios.md
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@

* should throw an error that it is not allowed

### ChocolateyUpgradeCommand [ 29 Scenario(s), 226 Observation(s) ]
### ChocolateyUpgradeCommand [ 35 Scenario(s), 286 Observation(s) ]

#### when force upgrading a package

Expand Down Expand Up @@ -938,6 +938,20 @@
* should report for all non skipped packages
* should skip packages in except list

#### when upgrading all packages with prereleases installed

* should report for all installed packages
* should skip packages without upgrades
* should upgrade packages with upgrades
* should upgrade upgradepackage

#### when upgrading all packages with prereleases installed with excludeprerelease specified

* should not upgrade upgradepackage
* should report for all installed packages
* should skip packages without upgrades
* should upgrade packages with upgrades

#### when upgrading an existing package happy path

* config should match package result name
Expand All @@ -958,6 +972,70 @@
* should upgrade the package
* should upgrade where install location reports

#### when upgrading an existing package with prerelease available and prerelease specified

* config should match package result name
* should contain a warning message that it upgraded successfully
* should contain a warning message with old and new versions
* should contain newer version in directory
* should delete the rollback
* should have a successful package result
* should have executed chocolateyBeforeModify before chocolateyInstall
* should have executed chocolateyBeforeModify script for original package
* should have executed chocolateyInstall script for new package
* should match the upgrade version of the new beta
* should not have executed chocolateyBeforeModify script for new package
* should not have executed chocolateyUninstall script for original package
* should not have inconclusive package result
* should not have warning package result
* should upgrade a package in the lib directory
* should upgrade the package
* should upgrade where install location reports

#### when upgrading an existing package with prerelease available without prerelease specified

* should be the same version of the package
* should contain a message that no packages were upgraded
* should contain a message that you have the latest version available
* should have a successful package result
* should have inconclusive package result
* should match the original package version
* should not create a rollback
* should not have warning package result
* should not remove the package from the lib directory

#### when upgrading an existing prerelease package with prerelease available with excludeprelease and without prerelease specified

* should be the same version of the package
* should contain a message that no packages were upgraded
* should contain a message that you have the latest version available
* should have a successful package result
* should have inconclusive package result
* should not create a rollback
* should not have warning package result
* should not remove the package from the lib directory
* should only find the last stable version

#### when upgrading an existing prerelease package without prerelease specified

* config should match package result name
* should contain a warning message that it upgraded successfully
* should contain a warning message with old and new versions
* should contain newer version in directory
* should delete the rollback
* should have a successful package result
* should have executed chocolateyBeforeModify before chocolateyInstall
* should have executed chocolateyBeforeModify script for original package
* should have executed chocolateyInstall script for new package
* should match the upgrade version of the new beta
* should not have executed chocolateyBeforeModify script for new package
* should not have executed chocolateyUninstall script for original package
* should not have inconclusive package result
* should not have warning package result
* should upgrade a package in the lib directory
* should upgrade the package
* should upgrade where install location reports

#### when upgrading packages with packages config

* should throw an error that it is not allowed
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,48 @@
<None Include="context\upgradepackage\1.1.0\upgradepackage.nuspec">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta2\tools\chocolateyBeforeModify.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta2\tools\chocolateyinstall.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta2\tools\chocolateyuninstall.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta2\tools\console.exe.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta2\tools\console.exe.config.install.xdt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta2\tools\graphical.exe.gui">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta2\upgradepackage.nuspec">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta\tools\chocolateyBeforeModify.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta\tools\chocolateyinstall.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta\tools\chocolateyuninstall.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta\tools\console.exe.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta\tools\console.exe.config.install.xdt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta\tools\graphical.exe.gui">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta\upgradepackage.nuspec">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
Expand Down Expand Up @@ -422,6 +464,18 @@
<Content Include="context\exactpackage\exactpackage\1.0.0\tools\purpose.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="context\upgradepackage\1.1.1-beta2\tools\console.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta2\tools\graphical.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta\tools\console.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="context\upgradepackage\1.1.1-beta\tools\graphical.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Content Include="infrastructure\filesystem\CopyMe.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Write-Output "$env:PackageName $env:PackageVersion Before Modification"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Write-Output "$env:PackageName $env:PackageVersion Installed"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Write-Output "$env:PackageName $env:PackageVersion Uninstalled"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.1-beta
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="test" value="default 1.1.0"/>
<add key="testReplace" value="default 1.1.0"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings xdt:Transform="InsertIfMissing">
<add key="test" value="1.1.0" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
<add key="testReplace" value="1.1.0" xdt:Locator="Match(key)" xdt:Transform="Replace"/>
<add key="insert" value="1.1.0" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing"/>
<add key="insertNew" value="1.1.0" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing"/>
</appSettings>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.1-beta
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>upgradepackage</id>
<version>1.1.1-beta</version>
<title>upgradepackage</title>
<authors>__REPLACE_AUTHORS_OF_SOFTWARE__</authors>
<owners>__REPLACE_YOUR_NAME__</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>__REPLACE__</description>
<summary>__REPLACE__</summary>
<releaseNotes />
<tags>upgradepackage admin</tags>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Write-Output "$env:PackageName $env:PackageVersion Before Modification"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Write-Output "$env:PackageName $env:PackageVersion Installed"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Write-Output "$env:PackageName $env:PackageVersion Uninstalled"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.1-beta2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="test" value="default 1.1.0"/>
<add key="testReplace" value="default 1.1.0"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings xdt:Transform="InsertIfMissing">
<add key="test" value="1.1.0" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
<add key="testReplace" value="1.1.0" xdt:Locator="Match(key)" xdt:Transform="Replace"/>
<add key="insert" value="1.1.0" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing"/>
<add key="insertNew" value="1.1.0" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing"/>
</appSettings>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.1-beta2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>upgradepackage</id>
<version>1.1.1-beta2</version>
<title>upgradepackage</title>
<authors>__REPLACE_AUTHORS_OF_SOFTWARE__</authors>
<owners>__REPLACE_YOUR_NAME__</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>__REPLACE__</description>
<summary>__REPLACE__</summary>
<releaseNotes />
<tags>upgradepackage admin</tags>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
Loading

0 comments on commit 25ab95f

Please sign in to comment.