dsccommunity / dsccommunity/SqlServerDsc

SqlSetup.Tests: Mock script block $mockConnectSQLCluster can be remove if the value for IsClustered is set 'dynamically'

Open
#437 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue help wanted
Dominant language
PowerShell
Stars
385
Forks
224
PR merge metrics
No merged PRs in 30d

Description

Details of the scenario you try and problem that is occurring:
In the xSQLServerSetup.Tests it looks like mock script block $mockConnectSQLCluster is equal to mock script block $mockConnectSQL, with the exception of the property IsClustered.
If we instead add IsClustered property to $mockConnectSQL and make it dynamically assigned, then we can remove the entire $mockConnectSQLCluster script block.

This is in the effort to reduce the code in xSQLServerSetup.Tests,

The DSC configuration that is using the resource (as detailed as possible):
n/a

Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
n/a

Version of the DSC module you're using, or 'dev' if you're using current dev branch:
Dev

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in xSQLServerSetup.Tests by comparing the $mockConnectSQLCluster and $mockConnectSQL script blocks, focusing on the IsClustered property. Run the relevant SqlSetup.Tests tests, and consider the work done when the duplicate block is removed while the clustered and non-clustered scenarios still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
testing
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.