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

Implement unit tests for all packages #48

Open
AdmiringWorm opened this issue Jan 24, 2019 · 6 comments
Open

Implement unit tests for all packages #48

AdmiringWorm opened this issue Jan 24, 2019 · 6 comments
Assignees
Labels
Epic Tracking issue for major changes

Comments

@AdmiringWorm
Copy link
Owner

No description provided.

@triage-new-issues triage-new-issues bot added the triage Cause is not known yet/Decision to implement have not been decided label Jan 24, 2019
@AdmiringWorm AdmiringWorm added the Epic Tracking issue for major changes label Jan 24, 2019
@triage-new-issues triage-new-issues bot removed the triage Cause is not known yet/Decision to implement have not been decided label Jan 24, 2019
@JourneyOver
Copy link

Hey @AdmiringWorm Like what you are doing with the Unit Tests stuff.

If I wanted to use the whole unit tests thing up on my repository (I actually like it compared to just running the "Test-RepoPackage.ps1" way of doing things, since your unit tests seem to be doing a whole lot more than just testing if the package updates/installs/uninstalls correctly). How would I go about setting it up? Like what would I need to change/do on appveyor exactly. Am I mainly just changing the force test packages (like the one you'd set up from https://github.com/majkinetor/au/wiki/AppVeyor#setting-up-the-force-test-project-optional) to use the .appveyor.tests.yml instead of the normal .appveyor.yml? or is there a lot more that needs to be done?

(I can follow along what you have done for the repository side of things, mainly just trying to figure out the appveyor side of things xD

Also does it do PR's like the "Test-RepoPackage.ps1" did, or does it completely ignore PR's and just does different branches that are not the master branch?

@AdmiringWorm
Copy link
Owner Author

@JourneyOver I'm glad you like it.

When it comes to what changes you'll need to make (other than creating the unit tests itself), that would be quite simple.
You can run everything on the same instance (I wanted to test on several appveyor images, hence why I decided to use a separate one).

In the .appveyor.yml file, just do the following two changes in your appveyor file:
remove the restriction to only build on master branch (line 10-12)

Replace the the code on line (98-100) with the following:

if ( ($Env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null) -and ($Env.APPVEYOR_PULL_REQUEST_NUMBER -ne '') -and ($Env:APPVEYOR_REPO_BRANCH -ne 'master') ) {
  Set-Service wuauserv -StartupType Manual
  ./scripts/Invoke-PesterTest.ps1 # If you decide to import that script as well
}

I haven't tested the above, but I think that should be enough (could cause problems with PR's though, but not sure about that).

I do suggest taking the same aproach as me though, import both appveyor files, set up a separate instance that runs by using the new script (you'll need to change it in the UI to pick the correct script). Then just import the 'Invoke-PesterTests.ps1' script and create your unit tests.

Also does it do PR's like the "Test-RepoPackage.ps1" did, or does it completely ignore PR's and just does different branches that are not the master branch?

I do believe it will run PR's as well, but haven't gotten around to test that just yet (feel free to open a PR to test it if you want 😄)

If you have any more questions, feel free to reach out to me on gitter (probably won't answer until tomorrow though, as it's getting closer to bedtime).

AdmiringWorm added a commit that referenced this issue Feb 17, 2019
@stale
Copy link

stale bot commented Mar 27, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix Code is working as expected label Mar 27, 2019
@AdmiringWorm
Copy link
Owner Author

still in progress

@AdmiringWorm AdmiringWorm reopened this Mar 27, 2019
@stale stale bot removed the wontfix Code is working as expected label Mar 27, 2019
AdmiringWorm added a commit that referenced this issue Jun 23, 2019
@stale
Copy link

stale bot commented Jun 25, 2019

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@stale stale bot added the wontfix Code is working as expected label Jun 25, 2019
@AdmiringWorm
Copy link
Owner Author

still in progress

@stale stale bot removed the wontfix Code is working as expected label Jun 25, 2019
@AdmiringWorm AdmiringWorm self-assigned this Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Epic Tracking issue for major changes
Projects
None yet
Development

No branches or pull requests

2 participants