Skip to content

Commit

Permalink
[dsccommunity#864] A fix for SSRS 2017 URLs in integration tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
bozho committed May 6, 2019
1 parent 04d708e commit 87075a7
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions Tests/Integration/MSFT_SqlRS.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,15 @@ try
}

It 'Should be able to access the ReportServer site without any error' {
$reportServerUri = 'http://{0}/ReportServer_{1}' -f $env:COMPUTERNAME, $ConfigurationData.AllNodes.InstanceName
if($script:sqlVersion -eq '140')
{
# SSRS 2017 does not support multiple instances
$reportServerUri = 'http://{0}/ReportServer' -f $env:COMPUTERNAME
}
else
{
$reportServerUri = 'http://{0}/ReportServer_{1}' -f $env:COMPUTERNAME, $ConfigurationData.AllNodes.InstanceName
}

try
{
Expand All @@ -155,7 +163,15 @@ try
}

It 'Should be able to access the Reports site without any error' {
$reportsUri = 'http://{0}/Reports_{1}' -f $env:COMPUTERNAME, $ConfigurationData.AllNodes.InstanceName
if($script:sqlVersion -eq '140')
{
# SSRS 2017 does not support multiple instances
$reportsUri = 'http://{0}/Reports' -f $env:COMPUTERNAME
}
else
{
$reportsUri = 'http://{0}/Reports_{1}' -f $env:COMPUTERNAME, $ConfigurationData.AllNodes.InstanceName
}

try
{
Expand Down Expand Up @@ -229,7 +245,15 @@ try
as this without testing for the correct error message on purpose.
#>
It 'Should not be able to access the ReportServer site and throw an error message' {
$reportServerUri = 'http://{0}/ReportServer_{1}' -f $env:COMPUTERNAME, $ConfigurationData.AllNodes.InstanceName
if($script:sqlVersion -eq '140')
{
# SSRS 2017 does not support multiple instances
$reportServerUri = 'http://{0}/ReportServer' -f $env:COMPUTERNAME
}
else
{
$reportServerUri = 'http://{0}/ReportServer_{1}' -f $env:COMPUTERNAME, $ConfigurationData.AllNodes.InstanceName
}

{ Invoke-WebRequest -Uri $reportServerUri -UseDefaultCredentials } | Should -Throw
}
Expand Down Expand Up @@ -281,7 +305,15 @@ try
}

It 'Should be able to access the ReportServer site without any error' {
$reportServerUri = 'http://{0}/ReportServer_{1}' -f $env:COMPUTERNAME, $ConfigurationData.AllNodes.InstanceName
if($script:sqlVersion -eq '140')
{
# SSRS 2017 does not support multiple instances
$reportServerUri = 'http://{0}/ReportServer' -f $env:COMPUTERNAME
}
else
{
$reportServerUri = 'http://{0}/ReportServer_{1}' -f $env:COMPUTERNAME, $ConfigurationData.AllNodes.InstanceName
}

try
{
Expand Down

0 comments on commit 87075a7

Please sign in to comment.