-
Notifications
You must be signed in to change notification settings - Fork 370
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
Acceptance tests failing on Travis #1172
Comments
Same failure as is seen in the scriptcs Linux Travis CI is occurring on Jenkins for Homebrew in Homebrew/homebrew-core#2620.
The only way I've found to avoid the failure is to use mono 4.2.x instead of 4.4.x, which isn't actually possible for Homebrew since we only have the latest version of mono in homebrew/core. Maybe a newer version of xunit will avoid this? |
Here's a full build log https://gist.github.com/ilovezfs/c36095dd2054857dfdfcb9a22e1e3453 |
Awesome. I have been meaning to look into why Travis is failing. I will
|
@glennblock thanks a lot! I was hoping to figure this out so I could merge my 0.16.1 PR, and then I realized the existing version in homebrew/core (0.16.0) is broken too, apparently ever since that mono upgrade. I'm not sure how that escaped notice at the time :( |
Working on this now, thanks @ilovezfs for the pointer. |
@ilovezfs I tried the latest xunit console runner (2.1.0) using the newer mono and it still fails. In terms of brew, do you run the unit tests? scriptcs itself "should" work, the main issue appears to be something to do with with xunit or XBehave (which is the test framework we use which builds on xunit). @bradwilson @adamralph any thoughts? |
We do not officially support Mono for anything other than Android and iOS. The desktop CLR implementation in Mono has historically been filled with bugs triggered by xUnit.net (especially related to app domains and shadow copying). People have had some success when turning off shadow copying and/or app domains. |
@bradwilson ok, thanks for responding quickly and weighing in. |
For Homebrew, we do this:
|
OK so ./build.sh builds AND runs the unit tests. Is it necessary for tests to run? I can add a homebrew_build.sh for example that doesn't run the tests. |
No not necessary, but we typically don't merge anything whose test suite or make check/make test fails unless upstream itself says it's good-to-go despite that! |
I understand. I am trying to see if @adamralph can help me look into this one. For now, I think I am gong to pin to an earlier mono just so I can get our travis tests to pass. I understand this doesn't unblock brew, but it will at least unblock our failing build. Nothing has changed in our code, which means there is either a bug in mono, XUnit or XBehave. |
@ilovezfs going to try a few other things. |
Yeah, pinning to the earlier mono for your testing is a great idea until this is sorted out, but doesn't unblock Homebrew unless you guys say it's fine with the current mono despite that. A build script designated for Homebrew would unblock things temporarily, since there's no reason to believe we're making the situation worse given that what's already in core isn't working now, but I suspect you'll be able to figure out the problem soon regardless :) |
I am trying something that "may" solve it. |
@glennblock it's somewhat surprising it's still broken with the current xunit. Are you able to get a hello world for xunit working? Maybe there's something really simple broken before it even gets off the starting line. |
Most of the tests pass, only 18 fail, so xunit is definitely working. |
Are the ones failing all of the "expect failure" variety? |
Nope |
interesting, ok. |
This output looks pretty wacky:
|
unicode settings broken maybe? |
Not sure. The way these acceptance tests work, is each test launches scriptcs (fires off the process programmaticly) and then parses the output returned and matches against expected output. |
My guess is the issue is in XBehave not in xunit, which the stack trace seems to indicate. I am not positive though. |
As you say @glennblock, I think all the tests which are failing are those which launch scriptcs.exe, capture the console output and then assert on the content. I doubt this is an xbehave problem. It's probably at a lower level than that. The way to prove that would be to temporarily lower one of the acceptance test methods from an xbehave scenario down to an xunit fact, and see if it still fails. |
@adamralph good idea. I'll try that. |
@adamralph don't all our acceptance tests do that though? Out of like 80, only 18 are failing. |
Hmm, there's one other possibility. The "should" library. |
With xbehave, each "test" is a step within a scenario, so "82 total, 17 failed" means that were 82 steps in total, of which only 17 failed. E.g. in "Given a hello world script"
.f(() => directory = ScenarioDirectory.Create(scenario)
.WriteLine("foo.csx", @"Console.WriteLine(""Hello world!"");"));
"When I execute the script with debug set to {0}"
.f(() => output = ScriptCsExe.Run("foo.csx", debug, directory));
"Then I see 'Hello world!'"
.f(() => output.ShouldContain("Hello world!")); only the last step will be failing, the first two should be passing. |
Aaah. Which could support my theory of Should. |
I am going to try dropping .ShouldContain on the first scenario and replace it with an Assert |
Should is only asserting that a string contains some other string so I'd be surprised if the problem was there (but then Mono is full of surprises). My suspicion is that something has changed in Mono regarding stdout capture from a process. |
That does sound more reasonable. |
I am going to add a console.writeline to the output. |
Thank you @adamralph! |
@adamralph or the other possibility is it is not passing IN the arguments properly. |
I think you may be right, there may be something broken with reading the output stream, looking at what we are doing here: https://github.com/scriptcs/scriptcs/blob/dev/test/ScriptCs.Tests.Acceptance/Support/ProcessStartInfoExtensions.cs |
Yep, some weird change in |
Yup, now that I've had a few hours on this and the fact that it works with earlier Mono builds is pointing at this being a Mono bug. I'll file something in the Mono bug tracker. |
After a recent checkin, the build failed on Travis running acceptance tests. Testing locally on Windows and OSX works fine. Seems to be related to Travis.
@adamralph any chance you can take a look at this?
The text was updated successfully, but these errors were encountered: