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

xSQLServerCommon.Tests: Example test might need more logic to use example file configuration data hash table #354

Closed
johlju opened this issue Jan 29, 2017 · 4 comments
Labels
enhancement The issue is an enhancement request.

Comments

@johlju
Copy link
Member

johlju commented Jan 29, 2017

Details of the scenario you try and problem that is occurring:
When creating an example file with more logic, for example evaluating variables in the ConfigurationData hash table. Then the test will ignore those.

The test uses a default mock ConfigurationData block.
https://github.com/PowerShell/xSQLServer/blob/dev/Tests/xSQLServerCommon.Tests.ps1#L51

Instead it should use the ConfigurationData hash table if it exists in the example file. The hash table must have a predetermined variable name so we know what to look for.

One example of this is the example for the new resource xSQLServerAlwaysOnAvailabilityGroup.
https://github.com/PowerShell/xSQLServer/pull/338/files#diff-4431c91d275e14a60f0e1ce5e29ae081

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

@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels Jan 29, 2017
@johlju
Copy link
Member Author

johlju commented Jan 31, 2017

I suggest the predetermined variable name should be $ConfigurationData. In the test there is a $mockConfigurationData that will be used by default. But if $ConfigurationData is found when dot sourcing the example into the common test, then $ConfigurationData will be used instead of $mockConfigurationData.

@johlju
Copy link
Member Author

johlju commented Feb 4, 2017

How the layout of the examples should look like needs to be added to the specific contribution guidelines as well.

@johlju johlju removed the help wanted The issue is up for grabs for anyone in the community. label Feb 8, 2017
@johlju
Copy link
Member Author

johlju commented Feb 8, 2017

Putting this on hold since this is being worked on as a common test over at Powershell\DscResource.Tests

@johlju johlju added the on hold The issue or pull request has been put on hold by a maintainer. label Feb 8, 2017
@johlju
Copy link
Member Author

johlju commented Dec 22, 2017

Closing this one as we should use the common test for this. In progress in issue #669.

@johlju johlju closed this as completed Dec 22, 2017
@johlju johlju removed the on hold The issue or pull request has been put on hold by a maintainer. label Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request.
Projects
None yet
Development

No branches or pull requests

1 participant