Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Tweak path related tests#22407

Merged
JeremyKuhne merged 2 commits into
dotnet:masterfrom
JeremyKuhne:fixspacetests
Jul 18, 2017
Merged

Tweak path related tests#22407
JeremyKuhne merged 2 commits into
dotnet:masterfrom
JeremyKuhne:fixspacetests

Conversation

@JeremyKuhne
Copy link
Copy Markdown
Member

Needed to update a few tests for unix whitespace behavior.

Needed to update a few tests for unix whitespace behavior.
@JeremyKuhne JeremyKuhne added this to the 2.0.0 milestone Jul 18, 2017
@JeremyKuhne JeremyKuhne self-assigned this Jul 18, 2017
@JeremyKuhne JeremyKuhne requested review from ianhays and nchikanov July 18, 2017 21:19
Also add another assert extension for three exceptions.
@JeremyKuhne JeremyKuhne changed the title Tweak whitespace related tests Tweak path related tests Jul 18, 2017
@JeremyKuhne
Copy link
Copy Markdown
Member Author

These are hitting in #22368


namespace CoreFx.Private.TestUtilities.Tests
{
public class AssertExtensionTests
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are these unit tests for the functionality of our test helpers? That shouldn't be necessary, and if it is then our helpers are too complex.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Test helpers should always be tested- it is part of our infrastructure. What you don't need to do is test test methods.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

To be completely clear, where plausible and particularly in shared helpers.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The regression risk should also be considered. In these extensions it is plausible for an error in logic to not be found immediately, potentially masking test failures for extended periods of time. We have a history of our test infrastructure doing just that.


[Theory,
InlineData(" "),
InlineData("\r\n")]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I prefer having separate attributes, but it seems we aren't consisetnt...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto

{
AssertExtensions.Throws<ArgumentException>("path", null, () => Path.GetDirectoryName(path));
Action action = () => Path.GetDirectoryName(path);
if (PlatformDetection.IsWindows)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be using PlatformSpecific attributes instead.

Also the test name has "Windows" in it but runs on Unix.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't agree in this case. This particular case is saying "throws on Windows but not Unix". Same input data. I could make the test name longer, but I think the fact that it isn't Windows only makes it implicit that it is "WindowsAndNotUnix".

I could split this into two entry points and shared test data property, but that seems like over-kill to me in this case. Same goes for duplicating the method. I think it is more coherent to have both sides of the coin together here.

@JeremyKuhne JeremyKuhne merged commit 449e350 into dotnet:master Jul 18, 2017
pjanotti pushed a commit to pjanotti/corefx that referenced this pull request Jul 20, 2017
* Tweak whitespace related tests

Needed to update a few tests for unix whitespace behavior.

* Fix more test issues

Also add another assert extension for three exceptions.
@steji113
Copy link
Copy Markdown
Contributor

Refer to #8655 for background on changes.

@karelz karelz modified the milestones: 2.1.0, 2.0.0 Aug 14, 2017
@karelz
Copy link
Copy Markdown
Member

karelz commented Aug 14, 2017

@JeremyKuhne FYI: Fixed the milestone to 2.1. The change didn't make it into 2.0 branch.
If you think it is needed in 2.1 servicing branch, we will need to port it - please file a new tracking issue in such case, thanks!

picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Tweak whitespace related tests

Needed to update a few tests for unix whitespace behavior.

* Fix more test issues

Also add another assert extension for three exceptions.


Commit migrated from dotnet/corefx@449e350
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants