Skip to content

Commit

Permalink
R11PIT-846: Rename flag (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
OS-tiagobarroso authored Nov 15, 2022
1 parent a4c9f6a commit 00e2612
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/Outsystems.SetupTools/Functions/Install-OSServerPreReqs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ function Install-OSServerPreReqs
.PARAMETER SourcePath
Specifies a local path having the pre-requisites binaries.
.PARAMETER OnlyMostRecentHostingBundlePackage
.PARAMETER RemovePreviousHostingBundlePackages
Specifies whether the installer should remove previous installations of the Hosting Bundle.
Accepted values: $false and $true. By default this is set to $false.
.PARAMETER SkipRuntimePackages
Specifies whether the installer should skip the installation of .NET Core Runtime and the ASP.NET Runtime.
Accepted values: $false and $true. By default this is set to $false.
Accepted values: $false and $true. By default this is set to $true.
.EXAMPLE
Install-OSServerPreReqs -MajorVersion "10"
Expand Down Expand Up @@ -73,10 +73,10 @@ function Install-OSServerPreReqs
[string]$PatchVersion = "0",

[Parameter()]
[bool]$OnlyMostRecentHostingBundlePackage = $false,
[bool]$RemovePreviousHostingBundlePackages = $false,

[Parameter()]
[bool]$SkipRuntimePackages = $false
[bool]$SkipRuntimePackages = $true
)

begin
Expand Down Expand Up @@ -521,7 +521,7 @@ function Install-OSServerPreReqs
}
}

if ($mostRecentHostingBundleVersion -and $OnlyMostRecentHostingBundlePackage)
if ($mostRecentHostingBundleVersion -and $RemovePreviousHostingBundlePackages)
{
$isInstalled = IsDotNetCoreUninstallToolInstalled
if (-not $isInstalled)
Expand Down
16 changes: 8 additions & 8 deletions test/unit/Install-OSServerPreReqs.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1259,9 +1259,9 @@ InModuleScope -ModuleName OutSystems.SetupTools {
It 'Should not throw' { { Install-OSServerPreReqs -MajorVersion '11' -MinorVersion '17' -PatchVersion '1' -ErrorVariable err -ErrorAction SilentlyContinue } | Should Not throw }
}

Context 'When trying to install prerequisites for a OS 11 version in Minor version 17 and Patch version newer than 1 (11.17.2) with OnlyMostRecentHostingBundlePackage flag active' {
Context 'When trying to install prerequisites for a OS 11 version in Minor version 17 and Patch version newer than 1 (11.17.2) with RemovePreviousHostingBundlePackages flag active' {

$result = Install-OSServerPreReqs -MajorVersion '11' -MinorVersion '17' -PatchVersion '2' -OnlyMostRecentHostingBundlePackage $true -ErrorVariable err -ErrorAction SilentlyContinue
$result = Install-OSServerPreReqs -MajorVersion '11' -MinorVersion '17' -PatchVersion '2' -RemovePreviousHostingBundlePackages $true -ErrorVariable err -ErrorAction SilentlyContinue

It 'Should run the .NET installation' { Assert-MockCalled @assRunInstallDotNet }
It 'Should run the BuildTools installation' { Assert-MockCalled @assRunInstallBuildTools }
Expand All @@ -1285,9 +1285,9 @@ InModuleScope -ModuleName OutSystems.SetupTools {
It 'Should not throw' { { Install-OSServerPreReqs -MajorVersion '11' -MinorVersion '17' -PatchVersion '2' -ErrorVariable err -ErrorAction SilentlyContinue } | Should Not throw }
}

Context 'When trying to install prerequisites for a OS 11 version in Minor version 17 and Patch version older than 1 (11.17.0) with OnlyMostRecentHostingBundlePackage flag active' {
Context 'When trying to install prerequisites for a OS 11 version in Minor version 17 and Patch version older than 1 (11.17.0) with RemovePreviousHostingBundlePackages flag active' {

$result = Install-OSServerPreReqs -MajorVersion '11' -MinorVersion '17' -PatchVersion '0' -OnlyMostRecentHostingBundlePackage $true -ErrorVariable err -ErrorAction SilentlyContinue
$result = Install-OSServerPreReqs -MajorVersion '11' -MinorVersion '17' -PatchVersion '0' -RemovePreviousHostingBundlePackages $true -ErrorVariable err -ErrorAction SilentlyContinue

It 'Should run the .NET installation' { Assert-MockCalled @assRunInstallDotNet }
It 'Should run the BuildTools installation' { Assert-MockCalled @assRunInstallBuildTools }
Expand All @@ -1311,9 +1311,9 @@ InModuleScope -ModuleName OutSystems.SetupTools {
It 'Should not throw' { { Install-OSServerPreReqs -MajorVersion '11' -MinorVersion '17' -PatchVersion '0' -ErrorVariable err -ErrorAction SilentlyContinue } | Should Not throw }
}

Context 'When trying to install prerequisites for a OS 11 version in Minor version 17 and Patch version 1 (11.17.1) with OnlyMostRecentHostingBundlePackage flag active' {
Context 'When trying to install prerequisites for a OS 11 version in Minor version 17 and Patch version 1 (11.17.1) with RemovePreviousHostingBundlePackages flag active' {

$result = Install-OSServerPreReqs -MajorVersion '11' -MinorVersion '17' -PatchVersion '1' -OnlyMostRecentHostingBundlePackage $true -ErrorVariable err -ErrorAction SilentlyContinue
$result = Install-OSServerPreReqs -MajorVersion '11' -MinorVersion '17' -PatchVersion '1' -RemovePreviousHostingBundlePackages $true -ErrorVariable err -ErrorAction SilentlyContinue

It 'Should run the .NET installation' { Assert-MockCalled @assRunInstallDotNet }
It 'Should run the BuildTools installation' { Assert-MockCalled @assRunInstallBuildTools }
Expand Down Expand Up @@ -1363,9 +1363,9 @@ InModuleScope -ModuleName OutSystems.SetupTools {
It 'Should not throw' { { Install-OSServerPreReqs -MajorVersion '11' -ErrorVariable err -ErrorAction SilentlyContinue } | Should Not throw }
}

Context 'When trying to install prerequisites for a OS 11 version without passing the optional Minor and Patch Versions and with OnlyMostRecentHostingBundlePackage flag active' {
Context 'When trying to install prerequisites for a OS 11 version without passing the optional Minor and Patch Versions and with RemovePreviousHostingBundlePackages flag active' {

$result = Install-OSServerPreReqs -MajorVersion '11' -OnlyMostRecentHostingBundlePackage $true -ErrorVariable err -ErrorAction SilentlyContinue
$result = Install-OSServerPreReqs -MajorVersion '11' -RemovePreviousHostingBundlePackages $true -ErrorVariable err -ErrorAction SilentlyContinue

It 'Should run the .NET installation' { Assert-MockCalled @assRunInstallDotNet }
It 'Should run the BuildTools installation' { Assert-MockCalled @assRunInstallBuildTools }
Expand Down

0 comments on commit 00e2612

Please sign in to comment.