如何在测试文件夹中运行 ejabberd 测试?我安装了 rebar 并确保有一个正在运行的 ejabberd 服务器,并按照此处的步骤: https ://docs.ejabberd.im/developer/extending-ejabberd/testing/ 运行测试套件。
但我收到以下错误:
[ec2-user@ip-173-33-33-236 ejabberd]$CT_BACKENDS=mnesia rebar ct suites=ejabberd groups=mnesia
WARN: Missing plugins: [rebar3_hex]
==> ejabberd (ct)
ERROR: ct_run -noshell -pa "/home/ec2-user/ejabberd/ebin"
"/home/ec2-user/ejabberd/deps/jose/ebin" "/home/ec2-user/ejabberd/deps/idna/ebin"
"/home/ec2-user/ejabberd/deps/yconf/ebin" "/home/ec2-user/ejabberd/deps/jiffy/ebin"
"/home/ec2-user/ejabberd/deps/p1_utils/ebin" "/home/ec2-user/ejabberd/deps/base64url/ebin"
"/home/ec2-user/ejabberd/deps/fast_yaml/ebin" "/home/ec2-user/ejabberd/deps/stringprep/ebin"
"/home/ec2-user/ejabberd/deps/ezlib/ebin" "/home/ec2-user/ejabberd/deps/fast_tls/ebin"
"/home/ec2-user/ejabberd/deps/fast_xml/ebin" "/home/ec2-user/ejabberd/deps/unicode_util_compat/ebin"
"/home/ec2-user/ejabberd/deps/proper/ebin" "/home/ec2-user/ejabberd/deps/base16/ebin"
"/home/ec2-user/ejabberd/deps/lhttpc/ebin"
"/home/ec2-user/ejabberd/deps/eini/ebin" "/home/ec2-user/ejabberd/deps/jsx/ebin"
"/home/ec2-user/ejabberd/deps/meck/ebin" "/home/ec2-user/ejabberd/deps/goldrush/ebin"
"/home/ec2-user/ejabberd/deps/p1_mysql/ebin" "/home/ec2-user/ejabberd/deps/p1_acme/ebin"
"/home/ec2-user/ejabberd/deps/mqtree/ebin" "/home/ec2-user/ejabberd/deps/eimp/ebin"
"/home/ec2-user/ejabberd/deps/pkix/ebin" "/home/ec2-user/ejabberd/deps/p1_oauth2/ebin"
"/home/ec2-user/ejabberd/deps/xmpp/ebin" "/home/ec2-user/ejabberd/deps/cache_tab/ebin"
"/home/ec2-user/ejabberd/deps/uuid/ebin" "/home/ec2-user/ejabberd/deps/erlcloud/ebin"
"/home/ec2-user/ejabberd/deps/lager/ebin" "/usr/local/bin/rebar/rebar/ebin"
"/usr/local/bin/rebar" "/home/ec2-user/ejabberd/." -include "/home/ec2-user/ejabberd/include"
-name test2876@ip-172-31-32-236.us-east-2.compute.internal -logdir
"/home/ec2-user/ejabberd/logs" -env TEST_DIR "/home/ec2-user/ejabberd/test"
-cover /home/ec2-user/ejabberd/cover.spec -suite test/ejabberd_SUITE.erl
-group mnesia -ct_hooks cth_surefire -include /home/ec2-user/ejabberd/tools
-include /home/ec2-user/ejabberd/include -include /home/ec2-user/ejabberd/deps/p1_utils/include
-include /home/ec2-user/ejabberd/deps/fast_xml/include
-include /home/ec2-user/ejabberd/deps/xmpp/include >>
/home/ec2-user/ejabberd/logs/raw.log 2>&1 failed with error: 1 and output:
ERROR: ct failed while processing /home/ec2-user/ejabberd: rebar_abort
如何运行这些单元测试?另外,是否有推荐的框架来编写 ejabberd/erlang 单元测试?我基本上想在模块中为各种输入运行一些特定功能,并确保输出正确,我是否需要为此运行服务器部分?
任何建议/指针将不胜感激。谢谢!