GithubHelp home page GithubHelp logo

cth_readable's People

Contributors

ashleyjlive avatar bjorng avatar egobrain avatar ferd avatar jaseemabid avatar max-au avatar paulo-ferraz-oliveira avatar soranoba avatar thegeorge avatar tsloughter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cth_readable's Issues

v1.4.6 is missing

this comes from my console:

===> Verifying dependencies...
escript: exception error: no match of right hand side value
{error,
{rebar_app_utils,
{missing_package,<<"cth_readable">>,<<"1.4.6">>}}}
in function erl_eval:expr/5 (erl_eval.erl, line 453)
in call from escript:eval_exprs/5 (escript.erl, line 872)
in call from erl_eval:local_func/6 (erl_eval.erl, line 567)
in call from escript:interpret/4 (escript.erl, line 788)
in call from escript:start/1 (escript.erl, line 277)
in call from init:start_em/1 (init.erl, line 1115)
in call from init:do_boot/3 (init.erl, line 823)

Tests missing in hex.pm package

When fetching the package from hex.pm, the tests are missing. Thus one can not check whether the package is actually working (passing tests) in the own environment.

Please add the tests to the hex.pm package (and publch a new version ;-). Thanks.

cth_readable_failonly consumes large amount of memory with lot's of log statements

We ran into an issue with cth_readable where the gen_server in cth_readable_failonly consumes large quantities of memory, due to it buffering all IO in the gen_server state.

Would a PR be considered, where we make this configurable, and only buffer the last X events for printout, with the default being the current behavior?

cth_readable_logger does not exist

I use v1.4.9. In cth_readable_failonly:call_handlers/2 has_logger is cth_readable_logger.
In the next line that handler is called with

gen_event:call(Name, Handler, Msg, 300000)

I've the following error if I put this into a try/catch:

cth_readable_failonly 350 {Error, Stack}: '{{noproc,
                                             {gen_event,call,
                                              [cth_readable_logger,
                                               cth_readable_failonly,flush,
                                               300000]}},
                                            [{gen_event,call1,4,
                                              [{file,"gen_event.erl"},
                                               {line,302}]},
                                             {cth_readable_failonly,
                                              '-call_handlers/2-lc$^0/1-0-',3,
                                              [{file,
                                                "rds/_build/test/lib/cth_readable/src/cth_readable_failonly.erl"},
                                               {line,348}]},
                                             {cth_readable_failonly,
                                              call_handlers,2,
                                              [{file,
                                                "rds/_build/test/lib/cth_readable/src/cth_readable_failonly.erl"},
                                               {line,354}]},

Because of this my tests are failing. When I was debugging it I saw cth_readable_logger was added
using gen_event:handler in adding_handler function before this error.

Do you have an idea what could happen with that process? Have you seen something like this?

Missing ct.hrl dependency

When I try to build this as a standalone rebar project (using d9cefd0), I get the following error:

$ DEBUG=1 ./rebar3 compile
===> Evaluating config script "rebar.config.script"
===> Load global config file /root/.config/rebar3/rebar.config
===> Expanded command sequence to be run: [{default,app_discovery},
                                                  {default,install_deps},
                                                  {default,lock},
                                                  {default,compile}]
===> Provider: {default,app_discovery}
===> Provider: {default,install_deps}
===> Verifying dependencies...
===> Provider: {default,lock}
===> Provider: {default,compile}
===> run_hooks("/mnt/hgfs/Workspace/cth_readable", pre_hooks, compile) -> no hooks defined

===> Compiling cth_readable
===> run_hooks("/mnt/hgfs/Workspace/cth_readable", pre_hooks, compile) -> no hooks defined

===> run_hooks("/mnt/hgfs/Workspace/cth_readable", pre_hooks, erlc_compile) -> no hooks defined

===> erlopts [debug_info]
===> files to compile ["/mnt/hgfs/Workspace/cth_readable/src/cth_readable_transform.erl",
                              "/mnt/hgfs/Workspace/cth_readable/src/cth_readable_compact_shell.erl",
                              "/mnt/hgfs/Workspace/cth_readable/src/cth_readable_helpers.erl",
                              "/mnt/hgfs/Workspace/cth_readable/src/cthr.erl",
                              "/mnt/hgfs/Workspace/cth_readable/src/cth_readable_nosasl.erl",
                              "/mnt/hgfs/Workspace/cth_readable/src/cth_readable_shell.erl",
                              "/mnt/hgfs/Workspace/cth_readable/src/cth_readable_lager_backend.erl",
                              "/mnt/hgfs/Workspace/cth_readable/src/cth_readable_failonly.erl"]
===> Compiling src/cthr.erl failed
src/cthr.erl:3: can't find include lib "common_test/include/ct.hrl"; Make sure common_test is in your app file's 'applications' list

src/cthr.erl:83: Warning: function format/4 is unused

===> Compilation failed: {error,
                                    [["src/cthr.erl:3: can't find include lib \"common_test/include/ct.hrl\"; Make sure common_test is in your app file's 'applications' list\n"]],
                                    [["src/cthr.erl:83: Warning: function format/4 is unused\n"]]}

This is using rebar 3.9.0 on Erlang/OTP 21 Erts 10.2.3 (Centos 7.6.1810).

Is there something I'm doing wrong?

Skipping tests in test spec

This is mostly for information - at least for now. The main problem is in common_test, but when that is corrected it might require an update of cth_readable_shell.

Since the hook function on_tc_skip/3 does not include the name of the suite, cth_readable_shell is depending on pre_init_per_suite/3 to get the suite name and store it in the hook state. The problem is that when a suite is skipped by specifying a skip_suites statement in the test spec, there is no call to pre_init_per_suite/3 or any other hook function except on_tc_skip/3 (with TC=all). The consequence of this is that cth_readable_shell will print skip info for either the previous suite (if there is one), or for the suite undefined (if the skipped suite is the first to be handled):

%%% undefined ==> all: SKIPPED
%%% undefined ==> {tc_user_skip,"...skip reason..."}

There is currently no workaround for this problem, but it might be a good idea to 'unset' the suite name in the state on post_end_per_suite/4 in order to avoid the faulty skip info if a previous suite existed, for example:

%%% reltool_app_SUITE ==> fields: OK
%%% reltool_app_SUITE ==> modules: OK
%%% reltool_app_SUITE ==> export_all: OK
%%% reltool_app_SUITE ==> app_depend: OK
%%% reltool_app_SUITE ==> undef_funcs: OK
%%% reltool_app_SUITE ==> appup: OK
%%% reltool_app_SUITE ==> all: SKIPPED                            <-----------
%%% reltool_app_SUITE ==> {tc_user_skip,"...skip reason..."}      <-----------

Add support for `cthr:pal/5`

Problem

During testing it was discovered that calls to ct:pal/5 were failing with undef errors when the parse_transform cth_readable_transform was used. This is because cthr:pal/5 does not exist.

Solution

Implement cthr:pal/5 (which has support for opts).

Please see commit ashleyjlive@46c0a80

Incorrect group names when groups running in parallel

Given the following suite foo_SUITE:

-module(foo_SUITE).

-export([
    suite/0,
    all/0,
    groups/0,
    init_per_suite/1,
    end_per_suite/1,
    init_per_group/2,
    end_per_group/2,
    init_per_testcase/2,
    end_per_testcase/2
]).

-export([a/1, b/1, c/1]).

suite() ->
    [{timetrap, {seconds, 10}}].

init_per_suite(Config) ->
    Config.

end_per_suite(_Config) ->
    ok.

init_per_group(_GroupName, Config) ->
    Config.

end_per_group(_GroupName, _Config) ->
    ok.

init_per_testcase(_TestCase, Config) ->
    Config.

end_per_testcase(_TestCase, _Config) ->
    ok.

groups() ->
    [
        {as, [parallel], [
            a,
            {group, bs}
        ]},
        {bs, [parallel], [
            b
        ]},
        {all, [parallel], [
            {group, as},
            c
        ]}
    ].

all() ->
    [
        {group, all}
    ].

a(_) -> timer:sleep(1000), error(a).

b(_) -> timer:sleep(1000), error(b).

c(_) -> timer:sleep(1000), error(c).

Running the default rebar3 ct produces:

%%% foo_SUITE:
%%% foo_SUITE ==> all.as.bs.a: FAILED
%%% foo_SUITE ==> {a,[{foo_SUITE,a,1,
               [{file,"/data/users/micmus/github/erlfmt/test/foo_SUITE.erl"},
                {line,58}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1748}]},
    {test_server,run_test_case_eval1,6,[{file,"test_server.erl"},{line,1263}]},
    {test_server,run_test_case_eval,9,
                 [{file,"test_server.erl"},{line,1195}]}]}

%%% foo_SUITE ==> all.as.bs.b: FAILED
%%% foo_SUITE ==> {b,[{foo_SUITE,b,1,
               [{file,"/data/users/micmus/github/erlfmt/test/foo_SUITE.erl"},
                {line,60}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1748}]},
    {test_server,run_test_case_eval1,6,[{file,"test_server.erl"},{line,1263}]},
    {test_server,run_test_case_eval,9,
                 [{file,"test_server.erl"},{line,1195}]}]}

%%% foo_SUITE ==> all.c: FAILED
%%% foo_SUITE ==> {c,[{foo_SUITE,c,1,
               [{file,"/data/users/micmus/github/erlfmt/test/foo_SUITE.erl"},
                {line,62}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1748}]},
    {test_server,run_test_case_eval1,6,[{file,"test_server.erl"},{line,1263}]},
    {test_server,run_test_case_eval,9,
                 [{file,"test_server.erl"},{line,1195}]}]}

Note the incorrecy name all.as.bs.a - test a does not belong to bs group.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.