ct_master (common_test v1.30)

Copy Markdown View Source

Distributed test execution control for Common Test.

This module exports functions for running Common Test nodes on multiple hosts in parallel.

Summary

Types

Filename of test spec to be executed.

Functions

Stops all running tests.

Stops tests on specified nodes.

If set to true, the ct_master logs are written on a primitive HTML format, not using the Common Test CSS style sheet.

Gets a reference to the Common Test master event manager. The reference can be used to, for example, add a user-specific event handler while tests are running.

Returns test progress. If Status is ongoing, tests are running on the node and are not yet finished.

Run tests on spawned nodes as specified in TestSpecs (see run/4).

Tests are spawned on the nodes as specified in TestSpecs. Each specification in TestSpec is handled separately. However, it is also possible to specify a list of specifications to be merged into one specification before the tests are executed. Any test without a particular node specification is also executed on the nodes in InclNodes. Nodes in the ExclNodes list are excluded from the test.

Tests are spawned on Node according to TestSpecs.

Tests are spawned on Node using ct:run_test/1

Types

test_spec()

-type test_spec() :: file:name_all().

Filename of test spec to be executed.

Functions

abort() -> ok

Stops all running tests.

abort(Nodes :: Node | [Node]) -> ok

Types

Node = node()

Stops tests on specified nodes.

basic_html(Bool :: boolean()) -> ok

(since OTP R15B01)

If set to true, the ct_master logs are written on a primitive HTML format, not using the Common Test CSS style sheet.

get_event_mgr_ref() -> atom()

(since OTP 17.5)

Gets a reference to the Common Test master event manager. The reference can be used to, for example, add a user-specific event handler while tests are running.

Example:

gen_event:add_handler(ct_master:get_event_mgr_ref(), my_ev_h, [])

progress() -> [{Node, Status}]

Types

Node = node()
Status = atom()

Returns test progress. If Status is ongoing, tests are running on the node and are not yet finished.

run(TestSpecs) -> Result

Types

TestSpecs = TestSpec | [TestSpec] | [[TestSpec]]
Result = [{Specs, ok} | {error, Reason}]
Reason = term()
TestSpec = test_spec()
Specs = [file:filename_all()]

Run tests on spawned nodes as specified in TestSpecs (see run/4).

Equivalent to run(TestSpecs, false, [], []) if called with TestSpecs being list of strings;

Equivalent to run([TS], false, [], []) if called with TS being string.

run(TestSpecs, InclNodes, ExclNodes) ≡ run(TestSpecs, false, InclNodes, ExclNodes)

run(TestSpecs, AllowUserTerms, InclNodes, ExclNodes) -> Result

Types

TestSpecs = TestSpec | [TestSpec] | [[TestSpec]]
AllowUserTerms = boolean()
InclNodes = ExclNodes = [node()]
Result = [{Specs, ok} | {error, Reason}]
Reason = term()
TestSpec = test_spec()
Specs = [file:filename_all()]

Tests are spawned on the nodes as specified in TestSpecs. Each specification in TestSpec is handled separately. However, it is also possible to specify a list of specifications to be merged into one specification before the tests are executed. Any test without a particular node specification is also executed on the nodes in InclNodes. Nodes in the ExclNodes list are excluded from the test.

run_on_node(TestSpecs, Node) ≡ run_on_node(TestSpecs, false, Node)

run_on_node(TestSpecs, AllowUserTerms, Node) -> Result

Types

TestSpecs = TestSpec | [TestSpec] | [[TestSpec]]
AllowUserTerms = boolean()
Node = node()
Result = [{Specs, ok} | {error, Reason}]
Reason = term()
TestSpec = test_spec()
Specs = [file:filename_all()]

Tests are spawned on Node according to TestSpecs.

run_test(Node :: node(), Opts :: [OptTuples]) -> ok

Types

EventHandlers = EH | [EH]
CTHInitArgs = term()
LogOpt = no_nl | no_src
Groups = GroupNameOrPath | [GroupNameOrPath]
CSSFile = YYMoMoDDHHMMSS = HHMMSS = LogDir = DecryptKey = CoverSpecFile = DecryptFile = string()
Category = CallbackMod = CTHModule = CTHsOrder = atom()
LogOpts = [LogOpt]
CreatePrivDir = auto_per_run | auto_per_tc | manual_per_tc
ForceStop = skip_rest | boolean()
InclDirs = TestSpecs = TestDirs = CfgFiles = CfgStrings = [string()] | string()
GroupNameOrPath = [atom()] | atom() | all
CTHs = [CTHModule | {CTHModule, CTHInitArgs}]
OptTuples = {dir, TestDirs} |
          {suite, Suites} |
          {group, Groups} |
          {testcase, Cases} |
          {spec, TestSpecs} |
          {join_specs, boolean()} |
          {label, Label} |
          {config, CfgFiles} |
          {userconfig, UserConfig} |
          {allow_user_terms, boolean()} |
          {logdir, LogDir} |
          {silent_connections, Conns} |
          {stylesheet, CSSFile} |
          {cover, CoverSpecFile} |
          {cover_stop, boolean()} |
          {step, StepOpts} |
          {event_handler, EventHandlers} |
          {include, InclDirs} |
          {auto_compile, boolean()} |
          {abort_if_missing_suites, boolean()} |
          {create_priv_dir, CreatePrivDir} |
          {multiply_timetraps, M} |
          {scale_timetraps, boolean()} |
          {repeat, N} |
          {duration, DurTime} |
          {until, StopTime} |
          {force_stop, ForceStop} |
          {decrypt, DecryptKeyOrFile} |
          {refresh_logs, LogDir} |
          {logopts, LogOpts} |
          {verbosity, VLevels} |
          {basic_html, boolean()} |
          {esc_chars, boolean()} |
          {keep_logs, KeepSpec} |
          {ct_hooks, CTHs} |
          {ct_hooks_order, CTHsOrder} |
          {enable_builtin_hooks, boolean()} |
          {release_shell, boolean()}
InitArgs = [term()]
VLevel = M = N = integer()
StopTime = YYMoMoDDHHMMSS | HHMMSS
DecryptKeyOrFile = {key, DecryptKey} | {file, DecryptFile}
DurTime = HHMMSS
StepOpts = [StepOpt]
UserConfig = [{CallbackMod, CfgStrings}] | {CallbackMod, CfgStrings}
Conns = all | [atom()]
Suites = [string()] | [atom()] | string() | atom()
KeepSpec = all | pos_integer()
EH = atom() | {atom(), InitArgs} | {[atom()], InitArgs}
Label = string() | atom()
StepOpt = config | keep_inactive
VLevels = VLevel | [{Category, VLevel}]
Cases = [atom()] | atom()

Tests are spawned on Node using ct:run_test/1