Skip to content

Batch test cleanup/reorganization #3225

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

Merged
merged 10 commits into from
Dec 5, 2016
Merged

Batch test cleanup/reorganization #3225

merged 10 commits into from
Dec 5, 2016

Conversation

jasper-schneider
Copy link
Contributor

Description


This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.

General Guidelines

  • [ x ] Title of the pull request is clear and informative.
  • [ x ] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.
  • [ x ] The pull request does not introduce breaking changes (unless a major version change occurs in the assembly and module).

Testing Guidelines

  • [ x ] Pull request includes test coverage for the included changes.
  • [ x ] PowerShell scripts used in tests should do any necessary setup as part of the test or suite setup, and should not use hard-coded values for locations or existing resources.

Cmdlet Signature Guidelines

  • [ NA ] New cmdlets that make changes or have side effects should implement ShouldProcess and have SupportShouldProcess=true specified in the cmdlet attribute. You can find more information on ShouldProcess here.
  • [ NA ] Cmdlet specifies OutputType attribute if any output is produced - if the cmdlet produces no output, it should implement a PassThrough parameter.

Cmdlet Parameter Guidelines

  • [ NA ] Parameter types should not expose types from the management library - complex parameter types should be defined in the module.
  • [ NA ] Complex parameter types are discouraged - a parameter type should be simple types as often as possible. If complex types are used, they should be shallow and easily creatable from a constructor or another cmdlet.
  • [ NA ] Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.

@markcowl
Copy link
Member

markcowl commented Dec 2, 2016

@jasper-schneider This is 40000 lines of removed test coverage - why is this coverage no longer necessary?

There are no technical issues with the change, but are these tests unnecessary or redundant in some way?

@jasper-schneider
Copy link
Contributor Author

@markcowl
Looks like I messed up copy/pasting my description into the box. Most of the 40000 lines are from the JSON session records.
There were 3 main things I did during this cleanup effort:

  1. I moved a bunch of scenario tests into unit tests. The unit tests were able to validate the same things, with the bonus of running faster and requiring fewer lines of code.
  2. There was some duplicate coverage between some unit tests and scenario tests. Basically, I wrote some scenario tests first for our OData helpers, then some time later I realized I could/should just write unit tests for those, but I didn't delete the extra scenario tests at that point. In this PR, I went through and cleaned out the redundant scenario tests.
  3. The scenario tests were originally focused on single cmdlets. So there was a single test for the New cmdlet, followed by a single test for the Get cmdlet, followed by a single test for Set, followed by a single test for Delete. I talked to Hovsep a while ago about strategies for reducing the test duration for the CI job, and one thing he mentioned was that the goal was to target more end to end basic scenarios in these tests, saving the exhaustive coverage for unit tests. So I went through and streamlined 4 individual CRUD tests into a single end to end scenario. Multiply this across our different nouns and all the recorder files that get generated, and that's where the bulk of the lines of code got cut out.

So in short, this was an effort to clean up a bunch of stuff that's accumulated over time, not to create major holes in test coverage :)

Feel free to ping me if you want to discuss in more detail.

@markcowl
Copy link
Member

markcowl commented Dec 5, 2016

@jasper-schneider Thanks, just wanted to verify.

on demand run here:http://azuresdkci.cloudapp.net/view/1-AzurePowerShell/job/powershell-demand/1314/

LGTM once the on-demand run passes

@cormacpayne cormacpayne merged commit 697931e into Azure:dev Dec 5, 2016
@jasper-schneider jasper-schneider deleted the batchTests branch December 5, 2016 18:53
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

Successfully merging this pull request may close these issues.

4 participants