haxetink / tink_web

Tinkerbell Web Framework
https://haxetink.github.io/tink_web
43 stars 14 forks source link

Can't compile tests if enabling `tink_multipart` #97

Closed Sanva closed 4 years ago

Sanva commented 4 years ago

Hi all! I've been playing with tink_web and I have a problem with multipart requests, a code like this makes NodeJS to never respond (looks like some infinite loop).

So I've downloaded tink_web from here to test it isolated, and the tests work as espected (lix run travix node) without tink_multipart, but adding it makes compilation fail with

/0.2.1/github/0838699facfb888cc53bbaa59476e7c81f0ca552/src/tink/multipart/parsers/TinkParser.hx:65: characters 19-24 : tink.Option<tink.Chunk> has no field parse

With lix install github:haxetink/tink_multipart the next error is

src/tink/web/routing/Response.hx:4: characters 8-33 : Type not found : httpstatus.HttpStatusCode
src/tink/web/routing/Response.hx:4: characters 8-33 : For function argument 'suites'
tests/RunTests.hx:8: lines 8-13 : Called from macro here
tests/Helpers.hx:21: characters 102-107 : Int has no field toInt

and with lix install haxelib:http-status (and adding -lib http-status to tests.hxml)

tests/Fake.hx:21: characters 72-77 : tink.Stringly has no field parse
tests/Fake.hx:21: characters 72-77 : For function argument 'id'

and with lix install haxelib:tink_stringly

tests/Fake.hx:61: characters 16-19 : Int should be String
tests/Fake.hx:61: characters 16-19 : For function argument 'reason'
tests/Fake.hx:61: characters 16-19 : For function argument 'header'
tests/Fake.hx:61: characters 16-19 : For function argument 'f'

And I'm not sure what to try now... because if I change the offending line from @:statusCode(201) to @:statusCode('201') the error changes to

tests/Fake.hx:61: characters 17-20 : String should be Int
tests/Fake.hx:61: characters 17-20 : For function argument 'statusCode'
tests/Fake.hx:61: characters 17-20 : For function argument 'header'
tests/Fake.hx:61: characters 17-20 : For function argument 'f'

Any clue about how to solve this?

Thanks! :smile:

Sanva commented 4 years ago

Hi!

After some testing I've found that from clean state of this repository it is possible to make tests pass with -lib tink_multipart simply installing tink_multipart from Haxelib: lix install haxelib:tink_multipart.

If you want I can open a pull request with updated dependencies.

kevinresol commented 4 years ago

If you want I can open a pull request with updated dependencies.

yes please

Sanva commented 4 years ago

yes please

done!