Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

Fixed error message using a null resourcemanager
With most recent CoreFx supporting STA, removed special CoreClr code paths
Added test coverage
Removed some dead commented out code that was never used

Part of #4158

Fix #3353

@SteveL-MSFT
Copy link
Member Author

AppVeyor failure waiting on #4323

Copy link
Member

Choose a reason for hiding this comment

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

Why were these two checks removed?

Copy link
Member Author

@SteveL-MSFT SteveL-MSFT Jul 26, 2017

Choose a reason for hiding this comment

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

line 486 and 890 already does the check

Copy link
Member

Choose a reason for hiding this comment

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

Ca you rename this variable to remove the initial "g"?

Copy link
Member Author

Choose a reason for hiding this comment

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

can do

Copy link
Member

Choose a reason for hiding this comment

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

Why were these two checks removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

check happens twice

Copy link
Member

Choose a reason for hiding this comment

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

  1. Does this line work on non-Windows platforms?
  2. Code should not be outside of a Pester block. This should be moved within a BeforeAll
  3. Check out the guidelines on Admin for Windows
  4. Consider using the pattern for skipping tests as well.

Copy link
Member Author

@SteveL-MSFT SteveL-MSFT Jul 26, 2017

Choose a reason for hiding this comment

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

  1. will wrap in $IsWindows
  2. will wrap in BeforeAll
  3. this is the opposite of requiring admin, this test requires NOT admin (there isn't a RequireNotAdminOnWindows)
  4. two different test cases here where the first is only applicable when NOT admin, the second one works either way

Copy link
Member

Choose a reason for hiding this comment

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

Why are these tests separated into separate files? We have been grouping tests for each cmdlet into a single file.

Copy link
Member Author

Choose a reason for hiding this comment

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

I suppose I can combine them. I thought to separate them because at least one test case requires non-admin.

Copy link
Member Author

Choose a reason for hiding this comment

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

Just tried it combined and start-pspester only ran the tests as elevated so that one test gets skipped. I'll have to have the non-admin tests as separate.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually it appears you have explicitly run start-pspester with -unelevated. I'll have to take care of this myself in the script then.

Copy link
Member

Choose a reason for hiding this comment

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

The same comments apply to this file as well

Copy link
Member Author

Choose a reason for hiding this comment

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

this is redundant from line 486

@SteveL-MSFT SteveL-MSFT force-pushed the credssp branch 2 times, most recently from 1e9b8af to a06b389 Compare July 26, 2017 16:25
@SteveL-MSFT
Copy link
Member Author

CI failure is due to one of the same failures in the nightly run unrelated to this PR. I'll fix that first.

Copy link
Member

Choose a reason for hiding this comment

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

Please check for en-US before comparing.

Copy link
Member Author

Choose a reason for hiding this comment

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

will fix

Copy link
Member

Choose a reason for hiding this comment

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

Same as above

Copy link
Member Author

Choose a reason for hiding this comment

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

will fix

Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

Copy link
Member Author

Choose a reason for hiding this comment

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

will fix

Copy link
Member

Choose a reason for hiding this comment

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

Same as above

Copy link
Member Author

Choose a reason for hiding this comment

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

will fix

@SteveL-MSFT SteveL-MSFT force-pushed the credssp branch 2 times, most recently from 1501d34 to c74be60 Compare August 1, 2017 00:48
@SteveL-MSFT
Copy link
Member Author

@mirichmo @adityapatwardhan feedback addressed

@SteveL-MSFT
Copy link
Member Author

@mirichmo can you complete your review?

Copy link
Member

Choose a reason for hiding this comment

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

As a general rule when using this pattern, a test that is skipped in an environment should not execute any code.

Lines 11 through 15 should not be executed if the test is skipped. Putting them in an else {} would solve this problem.

@adityapatwardhan
Copy link
Member

@mirichmo Can you rebase, it should fix the test failures.

SteveL-MSFT and others added 4 commits August 8, 2017 09:23
Fixed error message using a null resourcemanager
With most recent CoreFx supporting STA, removed special CoreClr code paths
Added test coverage
Removed some dead commented out code that was never used
merged tests to one file, use runas to have relevant tests run as non-elevated
Get-CredSSP returns text so only run that test if current culture is en-US
@adityapatwardhan
Copy link
Member

Tests are failing on Linux.
image

@mirichmo
Copy link
Member

mirichmo commented Aug 9, 2017

All the CredSSP tests are now passing in AppVeyor and Travis.

@adityapatwardhan adityapatwardhan merged commit eea3885 into PowerShell:master Aug 10, 2017
@SteveL-MSFT SteveL-MSFT deleted the credssp branch August 14, 2017 06:25
@ltamaster
Copy link

Hi All,
I was looking to use the WSManCredSSP functionalities.
has this PR enabled in a release?
I checked the v6.0.0-beta.6 because it mentions that it was added, but it didn't work for me.

screenshot 2017-11-22 17 16 30

Thanks
Luis

@SteveL-MSFT
Copy link
Member Author

@ltamaster CredSSP is only supported on Windows

@iSazonov
Copy link
Collaborator

@SteveL-MSFT It seems PowerShell docs haven't "Supported platforms: Windows, Linux, MacOS" in cmdlet's descriptions.
Also we could make the error message more clear: "The term Cmdlet is not supported on the platform or is not recognized ..."

@SteveL-MSFT
Copy link
Member Author

@iSazonov can you point me to the docs that say it's supported on Linux/macOS? Don't see that line here

I think the error message is technically correct as that cmdlet doesn't exist on non-Windows. It's a generic error message if a cmdlet is not found, so implying it's not supported may cause confusion particularly for typos.

@iSazonov
Copy link
Collaborator

@SteveL-MSFT I agree that we can leave the generic message "as is" if we enhance our docs.

can you point me to the docs that say it's supported on Linux/macOS?

It is just my request to enhance our docs - add new section "Supported platforms".

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.

6 participants