{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/DscResources/issues/9","labels_url":"https://api.github.com/repos/PowerShell/DscResources/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/DscResources/issues/9/comments","events_url":"https://api.github.com/repos/PowerShell/DscResources/issues/9/events","html_url":"https://github.com/PowerShell/DscResources/issues/9","id":70102845,"number":9,"title":"Suggestion: Guidelines on contributing tests","user":{"login":"RamblingCookieMonster","id":6377597,"avatar_url":"https://avatars.githubusercontent.com/u/6377597?v=3","gravatar_id":"","url":"https://api.github.com/users/RamblingCookieMonster","html_url":"https://github.com/RamblingCookieMonster","followers_url":"https://api.github.com/users/RamblingCookieMonster/followers","following_url":"https://api.github.com/users/RamblingCookieMonster/following{/other_user}","gists_url":"https://api.github.com/users/RamblingCookieMonster/gists{/gist_id}","starred_url":"https://api.github.com/users/RamblingCookieMonster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RamblingCookieMonster/subscriptions","organizations_url":"https://api.github.com/users/RamblingCookieMonster/orgs","repos_url":"https://api.github.com/users/RamblingCookieMonster/repos","events_url":"https://api.github.com/users/RamblingCookieMonster/events{/privacy}","received_events_url":"https://api.github.com/users/RamblingCookieMonster/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"vors","id":816680,"avatar_url":"https://avatars.githubusercontent.com/u/816680?v=3","gravatar_id":"","url":"https://api.github.com/users/vors","html_url":"https://github.com/vors","followers_url":"https://api.github.com/users/vors/followers","following_url":"https://api.github.com/users/vors/following{/other_user}","gists_url":"https://api.github.com/users/vors/gists{/gist_id}","starred_url":"https://api.github.com/users/vors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vors/subscriptions","organizations_url":"https://api.github.com/users/vors/orgs","repos_url":"https://api.github.com/users/vors/repos","events_url":"https://api.github.com/users/vors/events{/privacy}","received_events_url":"https://api.github.com/users/vors/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-04-22T11:35:30Z","updated_at":"2015-05-06T01:40:16Z","closed_at":null,"body":"Hi all!\r\n\r\nWondering if it would be possible to provide some guidelines around contributing tests for the DSC Resources.  You probably have a better idea of what would go in this, but a few example questions that might be helpful to answer:\r\n\r\n* Do you want integration tests? (e.g. the AppVeyor VM is configured with the resource and the desired state verified via Pester)\r\n* If you want integration tests, I'm assuming you might want a separate file and naming convention?\r\n* How do you want the tests themselves organized in general (e.g. describe/context/it)?\r\n\r\nAn initial complete test suite for a single repository might go a long way.\r\n\r\nCheers!\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/PowerShell/DscResources/issues/comments/99284330","html_url":"https://github.com/PowerShell/DscResources/issues/9#issuecomment-99284330","issue_url":"https://api.github.com/repos/PowerShell/DscResources/issues/9","id":99284330,"user":{"login":"TravisEz13","id":10873629,"avatar_url":"https://avatars.githubusercontent.com/u/10873629?v=3","gravatar_id":"","url":"https://api.github.com/users/TravisEz13","html_url":"https://github.com/TravisEz13","followers_url":"https://api.github.com/users/TravisEz13/followers","following_url":"https://api.github.com/users/TravisEz13/following{/other_user}","gists_url":"https://api.github.com/users/TravisEz13/gists{/gist_id}","starred_url":"https://api.github.com/users/TravisEz13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TravisEz13/subscriptions","organizations_url":"https://api.github.com/users/TravisEz13/orgs","repos_url":"https://api.github.com/users/TravisEz13/repos","events_url":"https://api.github.com/users/TravisEz13/events{/privacy}","received_events_url":"https://api.github.com/users/TravisEz13/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T01:40:16Z","updated_at":"2015-05-06T01:40:16Z","body":"@BrianFarnhill ping me offline about a workaround for mocking.\r\n\r\nI think we should focus on good unit tests automation before focusing on integration test automation.  \r\nAlso, many scenarios like Brian's will require unit testing/mocking to test effectively.  In other words, we should have unit test with good coverage that fail fast, and a few key integration tests that cover important cases.\r\n\r\nThat being said, some things are easier to cover, or can only be found through integration testing and we should support it.\r\n\r\nOn the directory structure, I think we should not duplicate the word test where we don't have to.  \r\n* Therefore, I would suggest this layout: \r\n    - One folder `Tests` in the root of the repo. \r\n    - If integration tests are presented, I would create sub-folders `Tests\\Unit` and `Tests\\Integration`. \r\n    - For every resource `xMyAwesomeResource` in the module, I would create a file `Tests\\Unit\\xMyAwesomeResource.Tests.ps1` with Unit Tests and `Tests\\Integration\\xMyAwesomeResource.Integration.Tests.ps1`.\r\n\r\nI agree with the separate directory for unit and integration tests.  It'll make it very easy to run just one type of test."}}