Skip to content

Commit 712b032

Browse files
committed
Fix PowerBI integ test
1 parent 87f32c1 commit 712b032

File tree

4 files changed

+93
-8
lines changed

4 files changed

+93
-8
lines changed

azure-pipelines.yml

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,10 @@ stages:
356356
displayName: 'Commands'
357357
strategy:
358358
matrix:
359-
SQL2022_WIN2019:
359+
PowerBI_WIN2019:
360360
JOB_VMIMAGE: 'windows-2019'
361361
TEST_CONFIGURATION: 'Integration_PowerBI'
362-
SQL2022_WIN2022:
362+
PowerBI_WIN2022:
363363
JOB_VMIMAGE: 'windows-2022'
364364
TEST_CONFIGURATION: 'Integration_PowerBI'
365365
pool:
@@ -694,6 +694,70 @@ stages:
694694
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
695695
testRunTitle: 'Integration RS ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
696696

697+
- stage: Integration_Test_Resources_PowerBIReportServer
698+
displayName: 'Integration Test Resources - Power BI Report Server'
699+
dependsOn: Quality_Test_and_Unit_Test
700+
jobs:
701+
- job: Test_Integration
702+
displayName: 'Integration'
703+
strategy:
704+
matrix:
705+
PowerBI_WIN2019:
706+
JOB_VMIMAGE: 'windows-2019'
707+
TEST_CONFIGURATION: 'Integration_PowerBI'
708+
PowerBI_WIN2022:
709+
JOB_VMIMAGE: 'windows-2022'
710+
TEST_CONFIGURATION: 'Integration_PowerBI'
711+
variables:
712+
SKIP_DATABASE_ENGINE_DEFAULT_INSTANCE: true
713+
SKIP_ANALYSIS_MULTI_INSTANCE: true
714+
SKIP_ANALYSIS_TABULAR_INSTANCE: true
715+
SMODefaultModuleName: 'SqlServer'
716+
pool:
717+
vmImage: $(JOB_VMIMAGE)
718+
timeoutInMinutes: 0
719+
steps:
720+
- task: DownloadPipelineArtifact@2
721+
displayName: 'Download Build Artifact'
722+
inputs:
723+
buildType: 'current'
724+
artifactName: $(buildArtifactName)
725+
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
726+
- task: PowerShell@2
727+
name: configureWinRM
728+
displayName: 'Configure WinRM'
729+
inputs:
730+
targetType: 'inline'
731+
script: 'winrm quickconfig -quiet'
732+
pwsh: false
733+
- powershell: |
734+
Import-Module -Name ./tests/TestHelpers/CommonTestHelper.psm1
735+
Remove-PowerShellModuleFromCI -Name @('SqlServer', 'SQLPS')
736+
Remove-Module -Name CommonTestHelper
737+
name: cleanCIWorker
738+
displayName: 'Clean CI worker'
739+
- powershell: |
740+
./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterTag $(TEST_CONFIGURATION) -PesterPath @(
741+
# Run the integration tests in a specific group order.
742+
# Group 1
743+
'tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1'
744+
# Group 2
745+
'tests/Integration/Resources/DSC_SqlRSSetup.Integration.Tests.ps1'
746+
# Group 3
747+
'tests/Integration/Resources/DSC_SqlRS.Integration.Tests.ps1'
748+
)
749+
name: test
750+
displayName: 'Run Reporting Services Integration Test'
751+
env:
752+
TEST_CONFIGURATION: $(TEST_CONFIGURATION)
753+
- task: PublishTestResults@2
754+
displayName: 'Publish Test Results'
755+
condition: succeededOrFailed()
756+
inputs:
757+
testResultsFormat: 'NUnit'
758+
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
759+
testRunTitle: 'Integration RS ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'
760+
697761
- stage: Integration_Test_Resources_ReportingServices_dbatools
698762
displayName: 'Integration Test Resources - Reporting Services (dbatools)'
699763
dependsOn: Integration_Test_Resources_SqlServer

tests/Integration/Resources/DSC_SqlRSSetup.Integration.Tests.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ BeforeAll {
8080
$script:mockSourceMediaUrl = 'https://download.microsoft.com/download/8/3/2/832616ff-af64-42b5-a0b1-5eb07f71dec9/SQLServerReportingServices.exe'
8181
}
8282

83+
if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_PowerBI')
84+
{
85+
# https://sqlserverbuilds.blogspot.com/2021/04/power-bi-report-server-versions.html
86+
$script:mockSourceMediaDisplayName = 'Power BI Report Server 15.0.1117.98 - 2025-01-22'
87+
$script:mockSourceMediaUrl = 'https://download.microsoft.com/download/2/7/3/2739a88a-4769-4700-8748-1a01ddf60974/PowerBIReportServer.exe'
88+
}
89+
8390
Write-Verbose -Message ('Start downloading the {1} executable at {0}.' -f (Get-Date -Format 'yyyy-MM-dd hh:mm:ss'), $script:mockSourceMediaDisplayName) -Verbose
8491

8592
Invoke-WebRequest -Uri $script:mockSourceMediaUrl -OutFile $ConfigurationData.AllNodes.MediaPath
@@ -116,7 +123,7 @@ AfterAll {
116123
Older versions of Reporting Services (eg. 2016) are integration tested in
117124
separate tests (part of resource SqlSetup).
118125
#>
119-
Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') {
126+
Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI') -Skip:($env:APPVEYOR) {
120127
BeforeAll {
121128
$resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test"
122129
}

tests/Integration/Resources/DSC_SqlRSSetup.config.ps1

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ else
1717
AllNodes = @(
1818
@{
1919
NodeName = 'localhost'
20-
InstanceName = 'SSRS'
20+
InstanceName = if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_PowerBI')
21+
{
22+
'PBIRS' # cSpell:ignore PBIRS
23+
}
24+
else
25+
{
26+
'SSRS'
27+
}
2128
Action = 'Install'
2229
AcceptLicensingTerms = $true
2330
MediaPath = Join-Path -Path $env:TEMP -ChildPath 'SQLServerReportingServices.exe'
@@ -68,7 +75,7 @@ Configuration DSC_SqlRSSetup_InstallReportingServicesAsUser_Config
6875
It does not work for Microsoft SQL Server 2017 Reporting Services,
6976
see .NOTES section in the resource.
7077
#>
71-
VersionUpgrade = if ($env:TEST_CONFIGURATION -eq 'Integration_SQL2017')
78+
VersionUpgrade = if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2017')
7279
{
7380
$false
7481
}
@@ -100,7 +107,14 @@ Configuration DSC_SqlRSSetup_StopReportingServicesInstance_Config
100107
{
101108
xService 'StopReportingServicesInstance'
102109
{
103-
Name = 'SQLServerReportingServices'
110+
Name = if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_PowerBI')
111+
{
112+
'PowerBIReportServer'
113+
}
114+
else
115+
{
116+
'SQLServerReportingServices'
117+
}
104118
State = 'Stopped'
105119
}
106120
}

tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ BeforeAll {
8888
8989
The actual download URL can easiest be found in the browser download history.
9090
#>
91-
if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2022')
91+
if (Test-ContinuousIntegrationTaskCategory -Category 'Integration_SQL2022', 'Integration_PowerBI')
9292
{
9393
$script:sqlVersion = '160'
9494
$script:mockSourceDownloadExeUrl = 'https://download.microsoft.com/download/c/c/9/cc9c6797-383c-4b24-8920-dc057c1de9d3/SQL2022-SSEI-Dev.exe'
@@ -174,7 +174,7 @@ AfterAll {
174174
Get-Module -Name 'CommonTestHelper' -All | Remove-Module -Force
175175
}
176176

177-
Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022') {
177+
Describe "$($script:dscResourceName)_Integration" -Tag @('Integration_SQL2016', 'Integration_SQL2017', 'Integration_SQL2019', 'Integration_SQL2022', 'Integration_PowerBI') {
178178
BeforeAll {
179179
$resourceId = "[$($script:dscResourceFriendlyName)]Integration_Test"
180180
}

0 commit comments

Comments
 (0)