Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We should add Windows Server 2022 as an additional OS for our integration tests #1713

Closed
johlju opened this issue Aug 25, 2021 · 5 comments · Fixed by #1715
Closed

We should add Windows Server 2022 as an additional OS for our integration tests #1713

johlju opened this issue Aug 25, 2021 · 5 comments · Fixed by #1715
Assignees
Labels
good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub tests The issue or pull request is about tests only.

Comments

@johlju
Copy link
Member

johlju commented Aug 25, 2021

actions/runner-images#3949

@johlju johlju added good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub help wanted The issue is up for grabs for anyone in the community. tests The issue or pull request is about tests only. labels Aug 25, 2021
@akbhuker
Copy link
Contributor

Hi, can you please assign me

@akbhuker
Copy link
Contributor

I'm quite new to this so I might need some guidance

@johlju
Copy link
Member Author

johlju commented Aug 26, 2021

Glad to have you here! I think this should be pretty straightforward.

Duplicate this block in the azure-pipelines.yml and replace vmImage: 'windows-2019' to vmImage: 'windows-2022'

- job: Test_Integration_SQL2019
displayName: 'Integration (SQL2019)'
pool:
vmImage: 'windows-2019'
timeoutInMinutes: 0
variables:
# This sets environment variable $env:CI.
CI: true
# This sets environment variable $env:CONFIGURATION.
configuration: Integration_SQL2019
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
artifactName: $(buildArtifactName)
targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
- task: PowerShell@2
name: configureWinRM
displayName: 'Configure WinRM'
inputs:
targetType: 'inline'
script: 'winrm quickconfig -quiet'
pwsh: false
- powershell: |
./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterScript @(
# Run the integration tests in a specific group order.
# Group 1
'tests/Integration/DSC_SqlSetup.Integration.Tests.ps1'
# Group 2
'tests/Integration/DSC_SqlAgentAlert.Integration.Tests.ps1'
'tests/Integration/DSC_SqlLogin.Integration.Tests.ps1'
'tests/Integration/DSC_SqlEndpoint.Integration.Tests.ps1'
'tests/Integration/DSC_SqlDatabaseMail.Integration.Tests.ps1'
'tests/Integration/DSC_SqlRSSetup.Integration.Tests.ps1'
'tests/Integration/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1'
'tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1'
'tests/Integration/DSC_SqlAlwaysOnService.Integration.Tests.ps1'
'tests/Integration/DSC_SqlAgentOperator.Integration.Tests.ps1'
'tests/Integration/DSC_SqlServiceAccount.Integration.Tests.ps1'
'tests/Integration/DSC_SqlAgentFailsafe.Integration.Tests.ps1'
# Group 3
'tests/Integration/DSC_SqlRole.Integration.Tests.ps1'
'tests/Integration/DSC_SqlRS.Integration.Tests.ps1'
'tests/Integration/DSC_SqlDatabaseUser.Integration.Tests.ps1'
'tests/Integration/DSC_SqlReplication.Integration.Tests.ps1'
# Group 4
'tests/Integration/DSC_SqlScript.Integration.Tests.ps1'
'tests/Integration/DSC_SqlDatabasePermission.Integration.Tests.ps1'
# Group 5
'tests/Integration/DSC_SqlSecureConnection.Integration.Tests.ps1'
'tests/Integration/DSC_SqlScriptQuery.Integration.Tests.ps1'
'tests/Integration/DSC_SqlProtocol.Integration.Tests.ps1'
# Group 6 (tests makes changes that could make SQL Server to loose connectivity)
'tests/Integration/DSC_SqlProtocolTcpIp.Integration.Tests.ps1'
'tests/Integration/DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1'
)
name: test
displayName: 'Run Integration Test'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
testRunTitle: 'Integration (SQL Server 2019 / Windows Server 2019)'

Then any resources that fail (if any) on Windows Server 2022 must be resolved, those that does not pass the integration tests on Windows Server 2022 for one reason or another.

@johlju
Copy link
Member Author

johlju commented Aug 26, 2021

We should really make a matrix so we can avoid duplicate the jobs, but that is more complicated and we can fix that in another PR if you like.

@johlju
Copy link
Member Author

johlju commented Aug 27, 2021

@akbhuker I found how we can create a matrix in the Azure Piplelines documentation. So we should remove the jobs Test_Integration_SQL2016, Test_Integration_SQL2017, Test_Integration_SQL2019. Instead replace those with this new job:

      - job: Test_Integration
        displayName: 'Integration'
        strategy:
          matrix:
            SQL2016_WIN2019:
              JOB_VMIMAGE: 'windows-2019'
              TEST_CONFIGURATION: 'Integration_SQL2016'
            SQL2016_WIN2022:
              JOB_VMIMAGE: 'windows-2022'
              TEST_CONFIGURATION: 'Integration_SQL2016'
            SQL2017_WIN2019:
              JOB_VMIMAGE: 'windows-2019'
              TEST_CONFIGURATION: 'Integration_SQL2017'
            SQL2017_WIN2022:
              JOB_VMIMAGE: 'windows-2022'
              TEST_CONFIGURATION: 'Integration_SQL2017'
            SQL2019_WIN2019:
              JOB_VMIMAGE: 'windows-2019'
              TEST_CONFIGURATION: 'Integration_SQL2019'
            SQL2019_WIN2022:
              JOB_VMIMAGE: 'windows-2022'
              TEST_CONFIGURATION: 'Integration_SQL2019'
        pool:
          vmImage: $(JOB_VMIMAGE)
        timeoutInMinutes: 0
        variables:
          # This sets environment variable $env:CI.
          CI: true
          # This sets environment variable $env:CONFIGURATION.
          configuration: $(TEST_CONFIGURATION)
        steps:
          - task: DownloadPipelineArtifact@2
            displayName: 'Download Build Artifact'
            inputs:
              buildType: 'current'
              artifactName: $(buildArtifactName)
              targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)'
          - task: PowerShell@2
            name: configureWinRM
            displayName: 'Configure WinRM'
            inputs:
              targetType: 'inline'
              script: 'winrm quickconfig -quiet'
              pwsh: false
          - powershell: |
              ./build.ps1 -Tasks test -CodeCoverageThreshold 0 -PesterScript @(
                  # Run the integration tests in a specific group order.
                  # Group 1
                  'tests/Integration/DSC_SqlSetup.Integration.Tests.ps1'
                  # Group 2
                  'tests/Integration/DSC_SqlAgentAlert.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlServerNetwork.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlLogin.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlEndpoint.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlDatabaseMail.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlRSSetup.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlDatabaseDefaultLocation.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlAlwaysOnService.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlAgentOperator.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlServiceAccount.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlAgentFailsafe.Integration.Tests.ps1'
                  # Group 3
                  'tests/Integration/DSC_SqlRole.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlRS.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlDatabaseUser.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlReplication.Integration.Tests.ps1'
                  # Group 4
                  'tests/Integration/DSC_SqlScript.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlDatabasePermission.Integration.Tests.ps1'
                  # Group 5
                  'tests/Integration/DSC_SqlSecureConnection.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlScriptQuery.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlProtocol.Integration.Tests.ps1'
                  # Group 6 (tests makes changes that could make SQL Server to loose connectivity)
                  'tests/Integration/DSC_SqlProtocolTcpIp.Integration.Tests.ps1'
                  'tests/Integration/DSC_SqlDatabaseObjectPermission.Integration.Tests.ps1'
              )
            name: test
            displayName: 'Run Integration Test'
          - task: PublishTestResults@2
            displayName: 'Publish Test Results'
            condition: succeededOrFailed()
            inputs:
              testResultsFormat: 'NUnit'
              testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml'
              testRunTitle: 'Integration ($(TEST_CONFIGURATION) / $(JOB_VMIMAGE))'

@johlju johlju added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Aug 27, 2021
@johlju johlju mentioned this issue Aug 29, 2021
9 tasks
johlju pushed a commit that referenced this issue Aug 30, 2021
- SqlServerDsc
  - Update HQRM tests to run on the VM image `windows-2022`.
  - Update unit tests to run on the VM image `windows-2022`.
  - Update integration tests to run both on Windows Server 2019 and Windows Server 2022 (issue #1713).
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub tests The issue or pull request is about tests only.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants