dsccommunity / dsccommunity/SqlServerDsc
SqlSetup: The arguments passed to setup.exe is not tested with the actual values
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 385
- Forks
- 224
- PR merge metrics
- No merged PRs in 30d
Description
The unit tests for SqlSetup is using a test helper function Test-SetupArgument. This function is parsing the actual arguments passed to setup.exe by removing any quotes etc. This should not be done since it should test the actual values passed to setup.exe, quotes and everything.
Work was done with the parameter SkipRules that tests the actual values against an expected value with quotes.
The following:
$mockStartSqlSetupProcessExpectedArgument = @{
Quiet = 'True'
IAcceptSQLServerLicenseTerms = 'True'
Action = 'Install'
InstanceName = $testParameters.InstanceName
Features = $testParameters.Features
SQLSysAdminAccounts = 'COMPANY\sqladmin COMPANY\SQLAdmins COMPANY\User1'
PID = $testParameters.ProductKey
SkipRule = '"Cluster_VerifyForErrors"'
}
Should really be:
$mockStartSqlSetupProcessExpectedArgument = @{
Quiet = '"True"'
IAcceptSQLServerLicenseTerms = '"True"'
Action = '"Install"'
InstanceName = ('"' + $testParameters.InstanceName + '"')
Features = ('"' + $testParameters.Features + '"')
SQLSysAdminAccounts = '"COMPANY\sqladmin" "COMPANY\SQLAdmins" "COMPANY\User1"'
PID = ('"' + $testParameters.ProductKey + '"')
SkipRule = '"Cluster_VerifyForErrors"'
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the SqlSetup unit tests and the Test-SetupArgument helper. Compare the existing SkipRules assertion with the expected argument map in the issue, preserving the quotes and spacing passed to setup.exe. Done means the tests verify the actual argument values and the relevant unit tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, sql
- Domain
- databases, testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100