-
Notifications
You must be signed in to change notification settings - Fork 8
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
Ensure we're testing module functions and logic #66
Labels
Milestone
Comments
vexx32
changed the title
Test module functions
Ensure we're testing module functions and logic
Aug 31, 2022
JPRuskin
added a commit
to JPRuskin/ChocoCCM
that referenced
this issue
May 6, 2023
Adds test covering public functions within ChocoCCM. Admittedly, currently only ~66% code coverage. This does, however, hit pretty much every _working_ command - most of the missing percentage are argument completers (which I am to improve), `if not session throw` blocks (which I aim to remove), and those commands that aren't working. Exceptions to be improved include: - Set-CCMDeploymentStep, which isn't implemented fully and should probably just be removed for now. - Remove-CCMStaleDeployment, which is currently broken - Import-PDQDeployPackage, because I couldn't find an example of an importable file.
JPRuskin
added a commit
to JPRuskin/ChocoCCM
that referenced
this issue
May 6, 2023
These were not terribly useful now we had the new tests in place. Also removes the non-existent function `Get-CCMDeploymentStepResult` from the PSD1, after improving the "has all the functions available" test (which showed this disparity).
JPRuskin
added a commit
to JPRuskin/ChocoCCM
that referenced
this issue
May 6, 2023
Removes the -All parameter from Get-CCMDeployment, which means this might work. Adjusts the test to be a little better.
JPRuskin
added a commit
to JPRuskin/ChocoCCM
that referenced
this issue
May 6, 2023
Unless we intended to provide regex-matching functionality here (which isn't obvious from the help), this fixes the ability to return multiple computers with a single name (or even random regex query).
6 tasks
JPRuskin
added a commit
to JPRuskin/ChocoCCM
that referenced
this issue
May 6, 2023
Adds test covering public functions within ChocoCCM. Admittedly, currently only ~66% code coverage. This does, however, hit pretty much every _working_ command - most of the missing percentage are argument completers (which I am to improve), `if not session throw` blocks (which I aim to remove), and those commands that aren't working. Exceptions to be improved include: - Set-CCMDeploymentStep, which isn't implemented fully and should probably just be removed for now. - Remove-CCMStaleDeployment, which is currently broken - Import-PDQDeployPackage, because I couldn't find an example of an importable file.
JPRuskin
added a commit
to JPRuskin/ChocoCCM
that referenced
this issue
May 6, 2023
These were not terribly useful now we had the new tests in place. Also removes the non-existent function `Get-CCMDeploymentStepResult` from the PSD1, after improving the "has all the functions available" test (which showed this disparity).
JPRuskin
added a commit
to JPRuskin/ChocoCCM
that referenced
this issue
May 6, 2023
Removes the -All parameter from Get-CCMDeployment, which means this might work. Adjusts the test to be a little better.
JPRuskin
added a commit
to JPRuskin/ChocoCCM
that referenced
this issue
May 6, 2023
Unless we intended to provide regex-matching functionality here (which isn't obvious from the help), this fixes the ability to return multiple computers with a single name (or even random regex query).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What You Are Seeing?
Many tests shadow the actual module function with an ad-hoc function that does nothing and only the tests use. As a result, there aren't really any tests for the module logic itself.
What is Expected?
Tests should be verifying the module behaves as intended given various inputs and outputs of mocked functions.
How Did You Get This To Happen? (Steps to Reproduce)
See for example:
ChocoCCM/src/Tests/computer.tests.ps1
Lines 1 to 11 in 2c92049
System Details
N/A
Output Log
N/A
The text was updated successfully, but these errors were encountered: