{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/20627","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/20627/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/20627/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/20627/events","html_url":"https://github.com/dotnet/corefx/issues/20627","id":233214169,"number":20627,"title":"Could some xUnit improvements enhance CoreFx?","user":{"login":"willdean","id":1306085,"avatar_url":"https://avatars1.githubusercontent.com/u/1306085?v=3","gravatar_id":"","url":"https://api.github.com/users/willdean","html_url":"https://github.com/willdean","followers_url":"https://api.github.com/users/willdean/followers","following_url":"https://api.github.com/users/willdean/following{/other_user}","gists_url":"https://api.github.com/users/willdean/gists{/gist_id}","starred_url":"https://api.github.com/users/willdean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willdean/subscriptions","organizations_url":"https://api.github.com/users/willdean/orgs","repos_url":"https://api.github.com/users/willdean/repos","events_url":"https://api.github.com/users/willdean/events{/privacy}","received_events_url":"https://api.github.com/users/willdean/received_events","type":"User","site_admin":false},"labels":[{"id":174888041,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-Infrastructure","name":"area-Infrastructure","color":"d4c5f9","default":false},{"id":206504884,"url":"https://api.github.com/repos/dotnet/corefx/labels/Design%20Discussion","name":"Design Discussion","color":"5319e7","default":false},{"id":145399957,"url":"https://api.github.com/repos/dotnet/corefx/labels/enhancement","name":"enhancement","color":"207de5","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/5","html_url":"https://github.com/dotnet/corefx/milestone/5","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/5/labels","id":1328080,"number":5,"title":"Future","description":"Milestone tracking issues not triaged to a planned release. Work in this milestone may happen, or may not: it is not committed.","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars2.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":1207,"closed_issues":99,"state":"open","created_at":"2015-09-29T00:25:45Z","updated_at":"2017-06-02T16:10:19Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2017-06-02T15:14:28Z","updated_at":"2017-06-02T17:16:28Z","closed_at":null,"body":"I don't want this to be a mass hate-in on xUnit, but I made some unguarded comments about xUnit on another CoreFx thread, and there does seem to be some shared feeling on the subject.  @karelz suggested (#4571) in a separate thread to discuss it.   If the consensus is 'shove off to the xUnit repo and do your moaning there', then that's fine, though I think my complaints are perceived by some to be positive features of xUnit, so I doubt I'd  get any traction on my own.\r\n\r\nThe  xUnit issues I have found made testing harder than it needed to be on CoreFx are:\r\n\r\n* Inability to consistently add messages to assertion methods - you can add a message to `Assert.True`, but you can't to `Assert.Equal`.   Two workaround recommendations seem to get made: The first is to use `Assert.True` and put your condition in the `bool` argument - that then means the test runner can put no useful info into the trace.  The other alternative is to use a better assertion library (there was some consistency of support for Fluent Assertions, though I haven't used it myself, and my heart sinks at yet another dependency).  Every assertion method should have an optional message.   People planning to advance the defence at this point that there should only be one assertion in a test and so you shouldn't need messages can expect short shrift from me...\r\n\r\n* Obvious gaps in the assertion support - e.g. no 'Fail' method, so we end up with stuff like             `Assert.True(false, \"Message\")` or writing a helpers to avoid this sort of thing.    This would be easy to add.\r\n\r\n* No proper trace from tests.  A .NET test framework/runner should collect Console and Trace output and report/log it sensibly (i.e. not co-mingled with other test output).  No ifs, no buts, no excuses about async, nothing.   This is the one that really winds me up, because it leads to CoreFx having to have a policy *against* tracing in tests largely because the test outputs gets sprayed across each other so they make no sense.  Couple this with the pain some of us have with trying to debug into tests, and the result is miserable - CI post-mortem shouldn't have to be a guessing game.\r\n\r\nI'm aware that xUnit is somehow the MS-insider's choice, and it was probably the only framework with Core support at the time it was chosen, so we cannot rewrite history, but if the Core projects have any influence with xUnit, could they ask for these improvements?\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/305855562","html_url":"https://github.com/dotnet/corefx/issues/20627#issuecomment-305855562","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/20627","id":305855562,"user":{"login":"tmat","id":41759,"avatar_url":"https://avatars3.githubusercontent.com/u/41759?v=3","gravatar_id":"","url":"https://api.github.com/users/tmat","html_url":"https://github.com/tmat","followers_url":"https://api.github.com/users/tmat/followers","following_url":"https://api.github.com/users/tmat/following{/other_user}","gists_url":"https://api.github.com/users/tmat/gists{/gist_id}","starred_url":"https://api.github.com/users/tmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmat/subscriptions","organizations_url":"https://api.github.com/users/tmat/orgs","repos_url":"https://api.github.com/users/tmat/repos","events_url":"https://api.github.com/users/tmat/events{/privacy}","received_events_url":"https://api.github.com/users/tmat/received_events","type":"User","site_admin":false},"created_at":"2017-06-02T17:16:28Z","updated_at":"2017-06-02T17:16:28Z","body":"We use these helpers in Roslyn as well as other repos we own: https://github.com/dotnet/roslyn/blob/master/src/Test/Utilities/Portable/Assert/AssertEx.cs \r\n\r\nThe main helpers there are Asserts that compare long strings (e.g. IL, XML), sequences (byte[], etc.) displaying diffs when the comparison fails. "}}
{"actor":{"display_login":"tmat"}}