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

Remove extraneous import-module commands in tests #962

Conversation

JamesWTruher
Copy link
Contributor

PR Summary

The expectation is that these tests are run as part of the test harness, the re-importing of the module is unneeded. Also, module autoloading should take care of this in any event.

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets. Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • User facing documentation needed
  • Change is not breaking
  • Make sure you've added a new test if existing tests do not effectively test the code changed
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

Copy link
Collaborator

@bergmeister bergmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I only left a minor and optional style comment. I also ran the tests of your branch on my machine on PS 5.1 and 6.0 (on Windows) and could not notice any regression. Although you marked it as WIP, I would already be happy for you to merge the current changes if you want to?

Import-Module -Verbose PSScriptAnalyzer
$script:skipTest = $true
if ($PSVersionTable.PSVersion -ge [Version]'5.0.0') {
$script:skipTest = $false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use a more descriptive variable name like skipTestForv3andv4?

Copy link
Contributor Author

@JamesWTruher JamesWTruher Apr 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I've changed it - if it gets through CI I'll merge

The expectation is that these tests are run as part of the test harness, the re-importing of the module is unneeded
@JamesWTruher JamesWTruher force-pushed the jameswtruher/SimplifyRuleTests01 branch from 31ab8d5 to b478613 Compare April 5, 2018 20:43
@JamesWTruher JamesWTruher changed the title WIP: Remove extraneous import-module commands in tests Remove extraneous import-module commands in tests Apr 5, 2018
@JamesWTruher JamesWTruher merged commit 83af8ed into PowerShell:development Apr 5, 2018
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.

3 participants