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
Member

JamesWTruher commented Apr 5, 2018

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 left a comment

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

This comment has been minimized.

@bergmeister

bergmeister Apr 5, 2018 Collaborator

Maybe use a more descriptive variable name like skipTestForv3andv4?

This comment has been minimized.

@JamesWTruher

JamesWTruher Apr 5, 2018 Author Member

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:jameswtruher/SimplifyRuleTests01 branch from 31ab8d5 to b478613 Apr 5, 2018
@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
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla All CLA requirements met.
Details
@SteveL-MSFT SteveL-MSFT removed the in progress label Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.