Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

fix eunit & compile erlydtl 0.9.0 #447

Merged
merged 1 commit into from Mar 19, 2014

Conversation

Projects
None yet
5 participants
Contributor

mihawk commented Feb 28, 2014

last version of rebar from master branch of repo http://github.com/rebar/rebar + export doterl_compile,
and a fix for eunit

Contributor

davidw commented Feb 28, 2014

I merged this into my fork. One thing that still isn't quite right is that CB produces the .dtl.erl files, which subsequently seem to cause problems:

Saving template source to: src/boss/boss_html_errors_template.dtl.erl.. ok

I'm not sure what the best thing to do about those is.

Contributor

mihawk commented Feb 28, 2014

seem that prb is gone with that fix, couldn't find any trace of those file
i did many test with a fresh clone of my branch

Contributor

danikp commented Mar 1, 2014

@davidw in latest elydtl this could be found here https://github.com/erlydtl/erlydtl/blob/c0af31f3b09e102f4b620be199fe252cd20b55b4/src/erlydtl_beam_compiler.erl#L275

As it's some undocumented option, we need to ask @kaos how to disable it. I believe it should be disabled by default

Contributor

kaos commented Mar 1, 2014

You must be passing 'debug_info' in the compile options. If you really want the debug info in the compiled beam, you can replace that option with '{compiler_options, [debug_info]}'. Otherwise just drop that option.

Contributor

kaos commented Mar 1, 2014

Bah, I see what's going on now. My fix in rebar for older versions of erlydtl unwraps the compiler options. I'll change the option for triggering the source dump in erlydtl.

@kaos kaos referenced this pull request in erlydtl/erlydtl Mar 1, 2014

Closed

Don't dump source on 'debug_info' #139

Contributor

kaos commented Mar 2, 2014

The fix is now in release 0.9.1.

I've not tested it on CB, though, so please do and let me know if there are any nasty surprises.
(notice one incompatible change that you may need to be aware of in the result to the render function of a compile_dir template which no matches that of the normal render functions).

Contributor

danikp commented Mar 2, 2014

thanks @kaos

Contributor

kaos commented Mar 2, 2014

It seems to compile just fine with erlydtl 0.9.1. Running the tests seems to give some errors, though. But I'm not sure what it relates to (it doesn't feel like erlydtl related, but I haven't looked closer at it)

boss_web_controller_handle_request_test: make_etag_test...*failed*
in function erlang:'++'/2
  called as {error,bad_name} ++ "//empty"
in call from boss_web_controller_handle_request:make_etag/3 (src/boss/boss_web_controller_handle_request.erl, line 83)
in call from boss_web_controller_handle_request_test:make_etag_test/0 (test/boss_web_controller_handle_request_test.erl, line 38)
**error:badarg


....................................................................................................
OK: Passed 100 test(s).
....................................................................................................
OK: Passed 100 test(s).
....................................................................................................
OK: Passed 100 test(s).
....................................................................................................
OK: Passed 100 test(s).
....................................................................................................
OK: Passed 100 test(s).
....................................................................................................
OK: Passed 100 test(s).
....................................................................................................
OK: Passed 100 test(s).
....................................................................................................
OK: Passed 100 test(s).
....................................................................................................
OK: Passed 100 test(s).
....................................................................................................
OK: Passed 100 test(s).
....................................................................................................
OK: Passed 100 test(s).
....................................................................................................
OK: Passed 100 test(s).
....................................................................................................
OK: Passed 100 test(s).
undefined
*** test generator boss_mq_test:spec_test_/0 failed ***
**in function prop_runner:gen/2
  called as gen([#Fun<boss_mq_test.4.13352445>,#Fun<boss_mq_test.3.13352445>,
 #Fun<boss_mq_test.2.13352445>,
 {stop,0},
 {convert_to_ms,1},
 {make_queue_options,0}],boss_mq)
in call from boss_mq_test:spec_test_/0
**error:undef


=======================================================
  Failed: 1.  Skipped: 0.  Passed: 9.

I also noticed that make test doesn't work, as the test target isn't marked as phony in the makefile (and as there is a test dir, make always reports the test target as being up-to-date).

Contributor

davidw commented Mar 3, 2014

I tried adding 0.9.1 and it's still generating these things:

Compiling src/boss/boss_html_errors_template.dtl.erl failed:
src/boss/boss_html_errors_template.dtl.erl:86: syntax error before: _9
src/boss/boss_html_errors_template.dtl.erl:12: function render_internal/2 undefined

Here's how:

rm -rf deps
make
# so far so good
make clean
make
# errors!
Contributor

davidw commented Mar 3, 2014

I have no idea about CB's test suite, I think that was kind of an open question when Zach stepped down as CB maintainer, so I would not worry too much about it.

Contributor

danikp commented Mar 3, 2014

@davidw are you removed all .dtl.erl files from /src/boss prior to compiling?

Contributor

davidw commented Mar 3, 2014

Ugh, that was it, @danikp - I'm a bit sleepy today. So yes, this seems to fix that particular problem. Thanks everyone!

Contributor

choptastic commented Mar 6, 2014

Given @davidw's error recompiling after a make clean, this change seems an appropriate fix for make clean, or is there a more appropriate place for this?

Or maybe I'm misunderstanding things altogether.

Contributor

kaos commented Mar 6, 2014

👍

Contributor

mihawk commented Mar 17, 2014

fix eunit test for a given CB app, not for CB itself

make app PROJECT=test_cb
cd ../test_cb/src/test/eunit
write some eunit for your awesome app
lunch your test
./rebar boss c=test_eunit

and it failed :(

this patch should fix that prb,

in the latest version of CB v0.8.11 it s still not working that pretty bad.

my 2 kui

@choptastic choptastic merged commit b1abf10 into ChicagoBoss:master Mar 19, 2014

Contributor

choptastic commented Mar 19, 2014

Merged. Seems to work just fine. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment