Haxe Forum > Error when running munit
-
Vjekoslav Ratkajec May 01 at 09:59
Hey guys, I have problem with running munit. When I run haxelib run munit test, all tests compile correctly but I neko is not responding well:
Couldn't get a file descriptor referring to the console Error running http://localhost:2000/tmp/runner/index.htmlAnd after 30 seconds I get:
PLATFORMS TESTED: 0, PASSED: 0, FAILED: 0, ERRORS: 0, TIME: 30.00025 ERROR: Local results server appeared to hang so test reporting was cancelled.
I can start neko server by issuing command nekotools server, I can open in my browser and see server config:
http://localhost:2000/server:configAlso this neko test is working:
The virtual machine is working ! Calling a function inside std library... Test successfulWhen munit finishes, I can manually open index.html for those tests and view results in my browser. But automatic call doesn't work.
If I run munit with sudo like sudo haxelib run munit test I skip the first error but I still get 30 seconds timeout...
Anyone has idea what's the problem?
Regards,
Vjeko -
Liburn May 02 at 21:36
Hello Vjeko, Dobar dan :)
From the days (long time a go) I was working on Linux, I remember some things: one is that scripts are sometimes starting and shutting down processes, usually by using kill <pid>. Or simply, running and waiting for process to be done. If something goes wrong, there are several things to look: first is a core dump, check if there is a core file present where binary is located. Another thing to look is: sometimes ports can't be reused for up to one minute, until system releases them. In that case, process can't be started (or it tries to use another port), while more clever software know how to release such port via API. You can check port status by using netstat -nan | grep <port number>
That's all, let us know if you found something.
-
Vjekoslav Ratkajec May 03 at 07:50
Hey, thanks for reply, I will search some more on the problem and report back if I find something.
-
Vjekoslav Ratkajec May 07 at 09:01
Well so far no success. I've sent mail to massive interactive, but to no avail.
-
I think Franco also has a unit test Library utest , maybe you could try this as well. Sorry don't use and have not tried either libraries so I cannot advise, but Franco's stuff is normally very good, I am keen to make some time to look at his js graphics libraries most of his projects can be found ( github franco ) .
-
Vjekoslav Ratkajec May 08 at 08:00
Yes, I saw it. I tried it and also used unit tests from haxe. As I saw, munit is most similar to flexunit which I use when developing in Flash. I can go with plain haxe.unit.* or utest library, no problem there.
I'm just wondering what's the problem with this one. :-)
-
Hi I forwarded your post to the haxelist, I expect someone at Massive will notice it and reply fairly soon :)
-
Mike Stead May 08 at 11:27
Hi there,
Sorry to hear you're having issues.
To help get a better picture could you tell me which browser you're testing in, which targets you're testing and if you've edited the TestMain class at all? Assume you're on OSX?
Thanks
Mike (munit dev) -
Jason O'Neil May 08 at 11:33
Hi,
MassiveUnit isn't as well set-up on linux at the moment as it will be on other platforms, though there is a new release planned in the next month that should bring Linux support up to scratch. The error you're getting is due to MUnit not testing for linux at all, and attempting to use MacOSX's "open" command to open that URL. I've got a fix for this as a pull request on Github (https://github.com/massiveinteractive/MassiveUnit/pull/21) but I think because a new version is in the works they're just waiting for that.
Having said all this, I still use it as is, even in it's broken state :)
Here's what I do
1) Open http://localhost:2000/tmp/runner/index.html in firefox / chromium
2) Run "haxelib run munit t", which runs all of your tests
3) When it comes up with the error message above, go to your browser and press refresh
4) You can see the results for Flash and JS tests here, and you can read them, check error messages and traces, etc.Unfortunately, the results aren't reported back to the server, so you'll have to read them yourself on the page, and it probably won't play nice with a Continual Integration server etc.
Anyway, I hope this helps you until the new version comes up (hopefully soon!)
-
Vjekoslav Ratkajec May 09 at 09:09
Justin, thank you for forwarding my issue.
@Mike
I'm using Linux (Flash as target), not OS X, and no, I didn't change anything in TestMain. So Mike, maybe I didn't explain enough, munit works it just doesn't open up browser to show results. In any case, Jason did confirm my issue with more detailed explanation. :-)@Jason
I do exactly the same thing. :-)
I hope so too that next version will fix this.Anyway, thank you all for helping.
Regards,
Vjeko -
Jason O'Neil May 10 at 04:21
@Vjeko
If you update munit now:
sudo haxelib upgrade
The updated version of munit should launch your browser okay. Woohoo! The browser still isn't reporting the results back to the terminal but it's more useful than it was. Thank you to the guys at Massive :)
-
Vjekoslav Ratkajec May 12 at 11:34
@Jason
Thank you on information, looking good now!And thanks Massive guys for your prompt intervention!