Skip to content
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

Run JS tests in TravicCI #176

Open
CrazyFlasher opened this issue Oct 22, 2019 · 6 comments
Open

Run JS tests in TravicCI #176

CrazyFlasher opened this issue Oct 22, 2019 · 6 comments
Labels

Comments

@CrazyFlasher
Copy link

Is it possible?
Currently is receive this:

$ haxe package.hxml
Massive Unit - Copyright 2019 Massive Interactive. Version 2.3.4
   haxe -main TestMain -lib munit -lib hamcrest -lib hexinject:1.0.0-alpha.7 -lib dox -cp src -cp test -js build/js_test.js
--FRAME--
    target_headers.html
    --FRAME--
        js.html
------------------------------
ERROR: Local results server appeared to hang so test reporting was cancelled.
Parsing build/js.xml
Processing types
........................................
Generating navigation
Generating 404 page
Generating to docs
........................................
Generated 72 types in 15 packages
Copying resources from /home/travis/haxe/lib/dox/1,2,0/themes/default/resources
Done (1.786s)
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused
Error: cannot open display: :99.0
/usr/bin/xdg-open: 778: /usr/bin/xdg-open: iceweasel: not found
/usr/bin/xdg-open: 778: /usr/bin/xdg-open: seamonkey: not found
/usr/bin/xdg-open: 778: /usr/bin/xdg-open: mozilla: not found
/usr/bin/xdg-open: 778: /usr/bin/xdg-open: epiphany: not found
/usr/bin/xdg-open: 778: /usr/bin/xdg-open: konqueror: not found
/usr/bin/xdg-open: 778: /usr/bin/xdg-open: chromium-browser: not found
The command "haxe package.hxml" exited with 0.

https://travis-ci.org/CrazyFlasher/domwires-haxe/jobs/601152306

@elsassph
Copy link
Contributor

CI usually is a problem when it comes to running browser tests.

Munit does only basic launching of the default browser instead of, say, running a headless browser (that didn't really exist at the time), and the error you get is that Travis doesn't provide any default browser in the image.

Workaround, if to run tests using NodeJS - for that your test.hxml needs to have -D nodejs.

@CrazyFlasher
Copy link
Author

C:\Users\GANAPATI\projects\domwires-haxe>haxelib run munit test test.hxml
Massive Unit - Copyright 2019 Massive Interactive. Version 2.3.4
   haxe -main TestMain -lib munit -lib hamcrest -lib hexinject:1.0.0-alpha.7 -lib dox -cp src -cp test -D nodejs -js build/js_test.js
   C:\HaxeToolkit\haxe\std/haxe/http/HttpNodeJs.hx:26: characters 8-22 : Type not found : js.node.Buffer
Error: Error compiling hxml for js
Target js C:\Users\GANAPATI\projects\domwires-haxe\build\js_test.js

Do I need some extra setup steps?

@elsassph
Copy link
Contributor

Oh sorry you need -lib hxnodejs (which should set -D nodejs automatically)

@CrazyFlasher
Copy link
Author

When running tests with -lib hxnodejs, reports are not cool.
test-runner/index.html doesn't show anything

@CrazyFlasher
Copy link
Author

Looks like it is bacause js.html is not generated in this case.
Can it be fixed some how?

@elsassph
Copy link
Contributor

elsassph commented Nov 6, 2019

Running headless you won't get a nice html report as it is produced dynamically during in-browser execution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants