-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Fix xunnit test for PS #4780
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
Fix xunnit test for PS #4780
Conversation
d0b8a16 to
db12347
Compare
build.psm1
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably stay before any calls made to dotnet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
JamesWTruher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a couple of the tests aren't testing the thing they purport to test, so they should be fixed or removed.
test/csharp/test_ExtensionMethods.cs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to be checking the method on the PSTypeExtensions object. Shouldn't this be something like:
Assert.False(PSTypeExtensions.IsNumeric("string".GetType())
It should actually test the PSTypeExtensions object or just removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved.
test/csharp/test_Binders.cs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my comment below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
test/csharp/test_CorePsPlatform.cs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't very useful and no longer tests what it is reported to test. This needs to check to see that the username returned by whoami is the same as Platform.Unix.UserName. Also, this is a non-windows only test. Is there a way to notate that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
db12347 to
08d5cde
Compare
|
@JamesWTruher Can you update your review? |
build.psm1
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is a failure in xUnit propagated to a failure in AppVeyor / Travis?
JamesWTruher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if everything actually runs on MacOS/Linux ok then I feel it would be better to get it in sooner rather than later. However, Aditya's question needs to be answered, how do we incorporate these results into our pester results?
test/csharp/test_CorePsPlatform.cs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe that this is still not good for MacOS. hostname --fqdn is an error. Will this run on Mac?
08d5cde to
fac8815
Compare
|
@chunqingchen This needs to be open. I am working on it. |
cd552f4 to
91b85a8
Compare
bb3966b to
d449465
Compare
|
@JamesWTruher @daxian-dbw I have updated the PR with multiple changes list in the PR description. All tests pass in CI and the log file is uploaded to artifacts on AppVeyor. Please have look. |
build.psm1
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably be throw or something - if $results has a problem then it might look like everything passed since the error will likely be hidden in the log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added throw instead of Write-Error
build.psm1
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be simplified to just:
if ( -not (test-path (get-psoutput)))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use $Content later. So I will keep it as is.
test/csharp/test_MshSnapinInfo.cs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this need a Skip.IfNot(Platform.IsWindows)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
daxian-dbw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave some comments
build.psm1
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe the single quote is not needed ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
build.psm1
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe move this line closer to its uses.
test/csharp/csharp.tests.csproj
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not needed as it's already included in Tests.Common.props.
test/csharp/csharp.tests.csproj
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not just Linux now.
test/csharp/csharp.tests.csproj
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment here
tools/appveyor.psm1
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will write a true or false in console, should be suppressed.
tools/travis.ps1
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the ending quote is not needed.
|
@daxian-dbw All comments have been addressed and all tests have passed. |
|
@daxian-dbw is this ready to merge? |
faa4ee7 to
d7b7433
Compare
* Initial work to enable xunit * Moved AssemblyOriginatorKeyFile to csharp.tests.csproj * Native binary has dylib extension on macOS
* Initial work to enable xunit * Moved AssemblyOriginatorKeyFile to csharp.tests.csproj * Native binary has dylib extension on macOS
Fixes #852 #851
This is to enable xunit test on all platforms.
This fix includes following change:
dotnet xunit