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

Add support for running ltest in the plugin #40

Closed
13 tasks done
oubiwann opened this issue Aug 3, 2020 · 3 comments · Fixed by #62
Closed
13 tasks done

Add support for running ltest in the plugin #40

oubiwann opened this issue Aug 3, 2020 · 3 comments · Fixed by #62
Assignees
Milestone

Comments

@oubiwann
Copy link
Member

oubiwann commented Aug 3, 2020

  • Convert the existing LFE plugin to Erlang
  • Bring that Erlang code into rebar3_lfe
  • Stop using test runner's directly
    • use functions that accept options
    • set up the listener based upon parsed options
    • set up the runner based upon parsed options
    • set up the reporter based upon parsed options
  • Ensure all options are being used
    • test types are properly limited by --test-type=
    • listeners can be switched out with --test-listener=
    • ANSI colors in output can be disabled with --color=false (accept --colour too)
    • eunit options are passed on to the appropriate listeners
  • Test in LFE projects
@oubiwann
Copy link
Member Author

oubiwann commented Sep 10, 2020

Update 1: This has been filed as ticket in the ltest project: lfex/ltest#66

Update 2: The problem below ended up being in the plugin, not in ltest. It's now fixed.

Making some good progress here. Tests are passing in sample projects that are pulling all the latest code and plugins (from various branches; nothing's been released for those yet).

One issue I am seeing right now is that, even though a project's tests may pass, I still see an error at the end of the test report printout:

===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badrecord,state_t}

and the sole contents of the rebar3.crashdump file are:

Error: {badrecord,state_t}
[]

There is no state_t reference that I could find in ltest.

I need to dig into the final steps of the ltest plugin (reporting, summing stats, etc.), and see where that might be coming from. I checked in otp_src_23.0/lib/eunit/include/eunit.hrl and there's nothing there by that name. Did the same for Erlang 19.3 (no dice).

@oubiwann
Copy link
Member Author

Ah-ha: state_t is from rebar:

@oubiwann
Copy link
Member Author

Got this error when running tests in lutil project (the release/0.11.x branch of that repo):

=ERROR REPORT==== 13-Sep-2020::23:31:16.475300 ===
Error in process <0.294.0> with exit value:
{{badmatch,nomatch},
 [{'ltest-util','get-beam',1,[{file,"src/ltest-util.lfe"},{line,9}]},
  {'ltest-util','get-module',1,[{file,"src/ltest-util.lfe"},{line,6}]},
  {'ltest-formatter','mod-line',1,
                     [{file,"src/ltest-formatter.lfe"},{line,75}]},
  {'ltest-listener',handle_begin,3,
                    [{file,"src/ltest-listener.lfe"},{line,18}]},
  {eunit_listener,call,3,[{file,"eunit_listener.erl"},{line,137}]},
  {eunit_listener,group,3,[{file,"eunit_listener.erl"},{line,93}]},
  {eunit_listener,group_loop,4,[{file,"eunit_listener.erl"},{line,98}]},
  {eunit_listener,'-init_fun/2-fun-0-',2,
                  [{file,"eunit_listener.erl"},{line,63}]}]}

There were no selenium tests found.

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

Successfully merging a pull request may close this issue.

1 participant