haxetink / tink_sql

SQL embedded into Haxe
MIT License
53 stars 16 forks source link

How to run unit tests? #106

Closed grepsuzette closed 4 years ago

grepsuzette commented 4 years ago

I am rather unexperienced with travix, but when running lix run travix node I get the following error.

After nvm use 10, lix download. Using haxe 4.0.5. I have set the mysql user and password in tests/Run.hx

> haxe -js bin/node/tests.js -lib hxnodejs -lib travix -lib tink_sql tests.hxml
tests/Run.hx:95: lines 95-100 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/Run.hx:105: lines 105-107 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/Run.hx:109: lines 109-110 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/Run.hx:116: lines 116-117 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/Run.hx:123: lines 123-125 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/Run.hx:127: lines 127-130 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/Run.hx:133: lines 133-143 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/Run.hx:145: lines 145-151 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/Run.hx:153: lines 153-159 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/Run.hx:161: lines 161-191 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/TypeTest.hx:21: lines 21-73 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/SelectTest.hx:38: lines 38-51 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/SelectTest.hx:53: lines 53-65 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/StringTest.hx:23: lines 23-62 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/GeometryTest.hx:18: lines 18-21 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/GeometryTest.hx:23: lines 23-35 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/GeometryTest.hx:37: lines 37-47 : Warning : Skip injecting AssertionBuffer because there is already an argument named "asserts"
tests/Run.hx:128: characters 11-20 : error: tink.core.Promise<tink.core.Noise> should be tink.Noise
tests/Run.hx:128: characters 11-20 :  have: (...) -> tink.core.Promise<tink.core.Promise<...>>
tests/Run.hx:128: characters 11-20 :  want: (...) -> tink.Promise<tink.Noise>
tests/Run.hx:128: characters 11-20 : For function argument 'run'
Failed to invoke `haxelib run-dir travix haxe/haxe_libraries/travix/0.13.1/haxelib node` because Error: Command failed: haxelib run-dir travix haxe/haxe_libraries/travix/0.13.1/haxelib node
kevinresol commented 4 years ago

what does which haxe tell?

and haxe --run resolve-args -lib tink_sql?

grepsuzette commented 4 years ago

which haxe gives /usr/bin/haxe file $( which haxe ) gives /usr/lib/node_modules/lix/bin/haxeshim.js: a /usr/bin/env node script executable (binary data)

I as a matter of course have those executed:

`

To reply to @back2dos

any local modifications to tink_core or something? ^^ did you delete Promise::next? :D

No :) I mean in the past maybe... It can be that I guess. I don't do that anymore but since it's version 1.24 it's possible. Guess I'll just remove the libs and make a lix download again.

I tried today to clone again tink_sql in 2 other directories. One with npm init ; npm -i mysql and the other one unaltered from origin. Both give me the same error, with my haxe 4.0.5.

haxe --run resolve-args -lib tink_sql gives

--cwd /home/justinbieber/tink_sql
-cp src 
-D tink_streams=0.3.2
-D tink_core=1.24.0
-cp /home/justinbieber/haxe/haxe_libraries/tink_core/1.24.0/github/a182e8c47e54b0587594010d435f8464379cc648/src
-cp /home/justinbieber/haxe/haxe_libraries/tink_streams/0.3.2/github/01a2b3894ae7ee5eb583503282371e307c03f065/src
-D pure
-D tink_macro=0.18.0
-D tink_core=1.24.0
-cp /home/justinbieber/haxe/haxe_libraries/tink_core/1.24.0/github/a182e8c47e54b0587594010d435f8464379cc648/src
-cp /home/justinbieber/haxe/haxe_libraries/tink_macro/0.18.0/github/b4fa5f4fe0310bd919866af42d403de06fdcf53c/src
-D tink_url=0.3.1
-cp /home/justinbieber/haxe/haxe_libraries/tink_url/0.3.1/github/7c98a2ea212c3a2f8d9ff41c1450eae98eee812f/src
-D tink_stringly=0.1.0
-cp /home/justinbieber/haxe/haxe_libraries/tink_stringly/0.1.0/haxelib/src
-D tink_core=1.24.0
-cp /home/justinbieber/haxe/haxe_libraries/tink_core/1.24.0/github/a182e8c47e54b0587594010d435f8464379cc648/src

In my tink_sql repo yesterday I tried lix install --flat upon each libs but it didn't change the result, above is result for the pristine haxe_libraries.

grepsuzette commented 4 years ago

Some potential problem. My ~/haxe/ directory used by lix has downloads haxelib haxe_libraries haxe-material-ui neko tink_core versions <- tink_core here. IDK if normal.

After rm -fr /home/justinbieber/haxe/haxe_libraries/tink_core/1.24.0/github/a182e8c47e54b0587594010d435f8464379cc648/src ; lix download same problem

same after repeating that process (rm + lix download + lix run travix node) for each folders in above haxe --run resolve-args -lib tink_sql: tink_streams tink_macro tink_url tink_stringly

Removed ~/haxe/versions/4.0.5 and lix download, same problem. Will temporarily move all my libs to /tmp and lix download again. Same oO

Can it have to do with non haxe sources, e.g. can it have to do with npm or nvm? I don't know how lix really works. Travix post-installation stuffs? Tests for tink_web run fine, my stuffs run fine as well, it is really weird.

kevinresol commented 4 years ago

This is likely a setup issue... The worse case is to use a docker (with a node image) to build...

grepsuzette commented 4 years ago

Turned out was running a alpha version of lix. Updating it I can run the tests. Thanks to kevin and juraj for their help on the chat :)