Skip to content

Commit

Permalink
Add a sleep to work around delay in configuration in server (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-richardson authored Oct 25, 2021
1 parent 0c9a963 commit b04a3c8
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions Tests/Scenarios/Server_Scenario_01_Install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,38 @@ Configuration Server_Scenario_01_Install
SkipLicenseCheck = $true
}

cOctopusServerUsernamePasswordAuthentication "Enable Username/Password Auth"
cOctopusServerUsernamePasswordAuthentication "EnableUsernamePasswordAuth"
{
InstanceName = "OctopusServer"
Enabled = $true
DependsOn = "[cOctopusServer]OctopusServer"
}

#hack until https://github.com/OctopusDeploy/Issues/issues/7113 is resolved
Script "SleepForABitToWorkaroundServerBug"
{
SetScript = {
Start-Sleep -seconds 120
Set-Content c:\temp\SleepAfterInstallHasHappened.txt -value "true"
}
TestScript = {
return Test-Path c:\temp\SleepAfterInstallHasHappened.txt
}
GetScript = {
@{
Result = Test-Path c:\temp\SleepAfterInstallHasHappened.txt
}
}
DependsOn = "[cOctopusServerUsernamePasswordAuthentication]EnableUsernamePasswordAuth"
}

cOctopusEnvironment "Create 'Production' Environment"
{
Url = "http://localhost:81"
Ensure = "Present"
OctopusCredentials = $cred
EnvironmentName = "Production"
DependsOn = "[cOctopusServer]OctopusServer"
DependsOn = "[Script]SleepForABitToWorkaroundServerBug"
}

cOctopusServerSpace "Create 'Integration Team' Space"
Expand All @@ -66,7 +84,7 @@ Configuration Server_Scenario_01_Install
SpaceManagersTeamMembers = @("admin")
SpaceManagersTeams = @("Everyone")
Description = "Description for the Integration Team Space"
DependsOn = "[cOctopusServer]OctopusServer"
DependsOn = "[Script]SleepForABitToWorkaroundServerBug"
}

cOctopusWorkerPool "Create a second workerpool"
Expand All @@ -77,6 +95,7 @@ Configuration Server_Scenario_01_Install
WorkerPoolName = "Secondary Worker Pool"
WorkerPoolDescription = "A secondary worker pool to test the resource"
SpaceId = "Spaces-1"
DependsOn = "[Script]SleepForABitToWorkaroundServerBug"
}

Script "Create Api Key and set environment variables for tests"
Expand Down Expand Up @@ -131,7 +150,7 @@ Configuration Server_Scenario_01_Install
Result = "" #probably bad
}
}
DependsOn = "[cOctopusServer]OctopusServer"
DependsOn = "[Script]SleepForABitToWorkaroundServerBug"
}

cOctopusServerGuestAuthentication "Enable Guest Login"
Expand Down Expand Up @@ -184,6 +203,7 @@ Configuration Server_Scenario_01_Install
Ensure = "Present"
StoreName = "My"
Port = 443
DependsOn = "[cOctopusServer]OctopusServer"
}
}
}

0 comments on commit b04a3c8

Please sign in to comment.