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

Add Integration Template to Project #45

Closed
tysonjhayes opened this issue Nov 9, 2015 · 5 comments
Closed

Add Integration Template to Project #45

tysonjhayes opened this issue Nov 9, 2015 · 5 comments
Assignees

Comments

@tysonjhayes
Copy link
Collaborator

Add a template of how we want Integration tests to be done in this project. Once we have a few of them we should add the template to other projects in the PowerShell group.

Template should outline how we expect the tests to act and where to copy things for maximum compatibility.

@tysonjhayes tysonjhayes self-assigned this Nov 9, 2015
tysonjhayes pushed a commit to tysonjhayes/xNetworking that referenced this issue Nov 9, 2015
This adds a template for how we expect future integration tests to look.
It allows us to show best practices for backwards compatability and allows
 us to formalize the template.
# ---------------------------------------------------------------------------------
# ISSUE_KEY dsccommunity#45 - dsccommunity#45
# ---------------------------------------------------------------------------------
@PlagueHO
Copy link
Member

One thing I ran into is that I didn't have script execution set to Unrestricted so the integration tests failed on my test box. This isn't the case on AppVeyor (which is why it passes just fine).

So we'll want to Set this to unrestricted before running the integration tests and then set it back to what it was at the end.

I'll include this in the PR for Issue #44.

@PlagueHO
Copy link
Member

Another idea for this is that the Header/Footer for the Unit tests should also go in with these templates.

I've noticed that the Unit Test and Integration Test header/footers are almost identical in function (the only difference is which module to load). So in my latest changes (for Issue #47 ) I've changed the Header and Footer of both Unit and Integration tests so they are identical except for the first three lines which just contain the module names and relative paths. Perhaps you could take a look at this when I submit the PR and give me your thoughts?

Also, I'm using some form of this code in every module I work on, but it's often slightly different (because of when I copied or pasted it etc) - which causes all sorts of testing headaches. So, I think Ideally at some point all of this header/footer code should go into some helper module (like DSCResource.tests/HelperTests.psm1 - because that code is already pulled in most AppVeyor configs). I think we should try and avoid code repetition as much as possible. But that discussion could be left for another date.

Right, back to it!

Cheers

@KarolKaczmarek
Copy link
Contributor

That's a great idea! Please send the PR into DscResource.Tests repo once you're ready.

I also agree template for Unit tests would be helpful as well to have a proper setup/cleanup in place.

@PlagueHO
Copy link
Member

Cool! Once we've finalized the Unit/Integration tests headers/footers I'll look at moving them into TestHelpers.psm1 👍

In PR #52 I've managed to synchronize the Header/Footer code for both Unit and Integration tests, so we should only need a single Start-TestFramework/Stop-TestFramework that will work for either. Not really sure of the right verbs to use here though.

@tysonjhayes
Copy link
Collaborator Author

Going to close this one as we have the templates in this resource, getting them broadly will be up to PowerShell/DscResource.Tests#11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants