aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/src/test_server_ctrl.erl
AgeCommit message (Collapse)Author
2015-01-22Add valid include path to epp in erl2html2 and fix crashing codePeter Andersson
2014-06-16Merge branch 'peppe/common_test/ct_basic_html_error' into maintPeter Andersson
* peppe/common_test/ct_basic_html_error: Fix problem with mismatching html tags when running basic_html log mode OTP-11917
2014-06-05Improve cover analysis via common_testSiri Hansen
This addresses several bugs in common_test (ct) when using the cover analysis mechanism: In a ct test run, one can give a cover spec file which indicates that cover analysis shall be run, including a number of modules and a number of nodes. During the ct test run, multiple jobs may be started in test_server, and when the cover option is used, test_server would cover compile and analyse all given modules for each job. This commit instead allows the compilation and analysis to be explicitly ordered by ct for each test run. This way each module will only be cover compiled and analysed once. The cover log will be located in the common_test log directory (ct_run.<timestamp>), and the "Coverage log" link in each suite.log.html will point to this file. A new button is also added in the top level ct index file, which points to the cover log. This change also reduces the need of using the 'export' and 'import' options, since there is no longer any need to accumulate cover data over multiple test_server jobs. However, these options may still be used for importing and exporting cover data in order to store or accumulate data from multiple ct test runs. The 'nodes' option was earlier only used by ct to start cover on the given nodes before starting the first test_server job. After this job was completed, test_server would stop cover completely and then start it again for the next job without any knowledge of the 'nodes' options. For the next test_server jobs cover would therefore no longer be running on these nodes. Explcit calls to ct_cover:add_nodes had to be done in order to collect data through all test_server jobs. This bug has now been solved, since cover is no longer stopped between each test_server job. Finally, ct no longer stores cover data using ct_util:set_testdata. This was earlier used by ct_cover:add_nodes to make sure no node was added twice.This did, however, cause some problems when ct and cover were out of sync. ct could belive that a node was running cover and thus reject adding this node, while in reality cover had been stopped on the node (e.g. by test_server) so no cover data was collected. ct_cover:add_nodes will now instead use cover:which_nodes to check if a node is already running.
2014-06-03Fix problem with mismatching html tags when running basic_html log modePeter Andersson
2014-05-20Change internal format of CoverInfo in test_serverSiri Hansen
This is in preparation of a future change of the cover API between common_test and test_server.
2014-03-12Merge branch 'peppe/common_test/group_events'Peter Andersson
* peppe/common_test/group_events: Update test suites and fix various remaining problems Update event protocol and CT Hooks API Introduce group name for skipped cases in events, hooks and overview log OTP-11732
2014-03-12Update test suites and fix various remaining problemsPeter Andersson
2014-03-12Update event protocol and CT Hooks APIPeter Andersson
2014-03-12Introduce group name for skipped cases in events, hooks and overview logPeter Andersson
2014-03-06Add more info to file open failurePeter Andersson
2014-02-13Fix problem with parallel test cases getting identical log file namesPeter Andersson
2014-01-21test_server: Fix ts write unicode in config filesDan Gudmundsson
2013-11-19Modify the auto_skip report for group config funcs to include group namePeter Andersson
Also correct failing test cases and find and fix remaining bugs.
2013-11-18Fix problems with info functions and add more testsPeter Andersson
2013-11-18Add test cases for new and modified functionalityPeter Andersson
2013-11-18Fix problem with suites and groups skipped from test specificationPeter Andersson
2013-11-18Change report tag for failed init_per_testcase from skipped to auto_skippedPeter Andersson
2013-11-18Correct tests cases that fail because of modified eventsPeter Andersson
2013-11-18Correct various bugs related to auto_skip and groupsPeter Andersson
2013-11-18Change status from skip to auto_skip for config func that fails due to requirePeter Andersson
2013-10-31Fix problem with handling Config and FW reports correctlyPeter Andersson
2013-10-15Change skip vs auto_skip behaviourPeter Andersson
When a configuration function returns {skip,Reason}, all affected test cases will now get status skipped, not auto_skipped. Furthermore, auto skipped cases will be reported as "auto_skipped" in the textual log file (not "skipped", as in previous versions). OTP-11305
2013-09-02Introduce pre- and post-test i/o logPeter Andersson
2013-08-28Remove the obsolete test_server_h error handlerPeter Andersson
2013-04-19Make test_server close log files properly and include correct footerPeter Andersson
OTP-11046
2013-03-14Merge branch 'siri/cuddle-with-tests' into maintSiri Hansen
* siri/cuddle-with-tests: [sasl] Fix tests that compare execution time [jinterface] Kill process between tests to avoid consequential error [jinterface] Make tests handle space in path on windows [common_test] Extend timers for slave nodes in ct_cover_SUITE [test_server] Clean up unused code in test_server_SUITE [reltool] Increase timetrap timeout for reltool_server_SUTIE to 10 minutes [test_server] Fix encoding of HTML file references to work on windows [test_server] Use simpler tc name in unicode test to make it work on windows
2013-03-04[test_server] Remove unused code related to remote targetsSiri Hansen
After removing the functionality for remote target nodes in R16A, there was still some unused code left and some documentation that was not updated. This is now completed.
2013-03-04[test_server] Fix encoding of HTML file references to work on windowsSiri Hansen
The URI encoding when in unicode file name mode did not preserve @, : and /, and thus some links were did not work on windows (think c:/). This has been corrected.
2013-02-18Repair broken force_stop functionalityPeter Andersson
2013-02-04[test_server] Don't write unicode strings to latin1 log filesSiri Hansen
The unicode update of test_server for R16A introduced a few potential errors when logging to files. Sometimes ~tp or ~ts was used for formatting also when writing to files that were not opened with the {encoding,utf8} option. If then the argument contained unicode characters above 255, the file descriptor would crash. This has been corrected by the following modifications: * Since the 'unexpected_io' log file is used only when the test case HTML file is not available (e.g. between test cases), this file is now also a HTML file and as other test_server HTML logs it is always UTF-8 encoded * Since it is possible to change which information is going to which log file (with test_server_ctrl:set_levels/3), we do not have full control over which information is written to which file. This means that any printout could be written to the 'major' log file (suite.log), which was earlier encoded as latin1. To avoid crashing this file descriptor due to unicode strings, the 'major' log file is now also encoded in UTF-8 (possible incopatibility). * The cross_cover.info file is no longer a text file which can be read with file:consult/1, instead it is written as a pure binary file using term_to_binary when writing and binary_to_term when reading. * The encoding of the file named 'last_name', which only content is the path to the last run.<timestamp> directory, is now dependent on the file name mode of the VM. If file names are expected to be unicode, then the 'last_name' file is UTF-8 encoded, else it is latin1 encoded. Also, ~tp is changed back to ~p unless it is somehow likely that the argument includes strings. It is not obvious that this is the correct thing to do, but some decission had to be taken...
2013-01-25[test_server] Don't escape : and @ in test log linksSiri Hansen
If escaping :, then links of type "file:///c:/ldisk..." will not work. Escaping @ does not create any problems, but the link becomes harder to read and most modern browsers can handle this.
2013-01-25[test_server] Ensure correct encoding in header for erl2html2:convertSiri Hansen
When running under framework common_test, the encoding statement in the HTML header of the file generated with erl2html2:convert would sometimes be faulty. This has been corrected.
2013-01-25[test_server] Update test_server to handle unicodeSiri Hansen
* Use UTF-8 encoding for all HTML files, except the HTML version of the test suite generated with erl2html2:convert, which will have the same encoding as the original test suite (.erl) file. * Encode link targets in HTML files, allowing both special characters like "/", "&", "?" etc, and latin1 or unicode characters. * Use unicode modifier 't' with ~s and ~p when appropriate. * Use unicode:characters_to_list and unicode:characters_to_binary for conversion between binaries and strings instead of binary_to_list and list_to_binary.
2013-01-10Merge branch 'siri/cross-cover/OTP-9870'Siri Hansen
* siri/cross-cover/OTP-9870: [test_server] Don't use print/3 in cross_cover_analyse [common_test] Add documentation for cross cover analysis [common_test] Add test case for cross cover mechanism [test_server] Update documentation about cross cover [test_server] Add test of code cover mechanism [test_server,common_test] Fix cross cover mechansim
2013-01-09test_server: Remove support for packagesBjörn Gustavsson
2012-12-13[test_server] Don't use print/3 in cross_cover_analyseSiri Hansen
Cross cover analysis is executed outside the scope of test_server_ctrl, i.e. test_server_ctrl is not necessarily started. This may cause test_server_ctrl:print/3 to hang. Instead use io:fwrite directly (as it was before).
2012-12-04[test_server,common_test] Fix cross cover mechansimSiri Hansen
Update the interface for cross cover analysis (collection of cover data over multiple tests) so it can be used via common_test and directly with test server. The concept of 'application' in the cross cover interface is removed and replaced with an arbitrary Tag=atom() which identifies a test run.
2012-11-19[test_server] Fix erl2html2.erl to handle badly indented filesSiri Hansen
Line numbering of erlang files that were not correctly indented could be wrong after coverting to html with erl2html2:convert/[2,3]. This has been corrected. This commit also fixes the following: * There are now link targets for each line and not only for each 10th line - meaning that links from test logs are now to the exact line, and not to the last number for which N rem 10 == 0. * there will only be one link target per function, i.e. the faulty link targets for function clauses are removed. * link targets for function now includes the arity (e.g. func/1 has a link target "func-1") And some tests are added.
2012-11-08Merge branch 'bjorn/ct/minor-corrections'Björn Gustavsson
* bjorn/ct/minor-corrections: test_server_io: Correct a few comments Handle ct:abort_current_testcase/1 when executing parallel groups Make sure that "Cover analysing..." is written to stdout Make sure that "Testing..." is not written if testing has finished
2012-11-08Remove stale support for remote target nodesBjörn Gustavsson
The support for remote target nodes has not worked in a long time. We are unlikely to ever need remot target node support and if we'll need it will be easier to start over from scratch.
2012-11-07Handle ct:abort_current_testcase/1 when executing parallel groupsBjörn Gustavsson
ct:abort_current_testcase/1 (which is a wrapper for the function with the same name in test_server_ctrl) would not work as expected when a group with parallel test cases was executing. Essentially, the abort_current_testcase message would be ignored until the group has finished and would then abort the end_per_group testcase for the group. Since there is no unique current testcase when a parallel group is executing, we must handle the abort_current_testcase message and return an error tuple. Also fix the bug that test_server_ctrl:abort_current_testcase/1 would always return 'ok'.
2012-11-07Make sure that "Testing..." is not written if testing has finishedBjörn Gustavsson
When writing messages to stdout, all messages are prefixed with "Testing" followed by the name of the test suite. We don't want to write that prefix if testing has stopped.
2012-11-07[test_server] Skip test cases if init_per_group fails in user timetrapSiri Hansen
'user_timetrap_error' was not detected during any "conf init function" except init_per_suite, so if e.g. init_per_group failed with user_timetrap_error, then the test cases in the group would not be skipped. This has been corrected.
2012-10-30[common_test] Add option cover_stopSiri Hansen
By default, test_server will always stop cover (and thus load back the non cover compiled original beam files) after a test with code coverage analysis is completed. The new option allows the common_test user to specify that cover shall not be stopped. This can be useful if there are processes still running old code, i.e. processes that have not done any fully qualified function call after the cover compilation, since loading the original code then will kill those processes. This is only recommended if the erlang node is to be stopped after the test run, or if cover can be manually stopped.
2012-10-30[test_server] Allow cross cover analysis when testing through common_testSiri Hansen
The cross cover analysis functionality in test_server was broken since OTP converted to running daily tests through common_test. This has been corrected.
2012-10-30[test_server] Multiply timers with timetrap_scale_factor when starting nodesSiri Hansen
In test_server_ctrl:start_node and wait_for_node, the timer in controller_call was not multiplied by the timetrap_scale_factor. This caused unexpected behaviour since the scale factor was used furhter down the the code, and timeout would happen in unexpected order when cover was running.
2012-10-26Merge branch 'bjorn/ct/separate-io-server/OTP-10101'Björn Gustavsson
* bjorn/ct/separate-io-server/OTP-10101: Test ct:capture/start/stop/get Introduce ct_group_leader_SUITE that does nasty things with group leaders Eliminate unexpected I/O to the minor log file Introduce test_server_io and test_server_gl Clean up initialization of parallel test cases Introduce is_io_buffered/0 to somewhat improve readability test_server_ctrl: Consistently use set_io_buffering/1
2012-10-25[test_server] Set data_dir correctly when suite is cover compiledSiri Hansen
If the test suite itself was included in code coverage analysis, then test_server_ctrl would not manage to set data_dir correctly for the test, since it relied on the result of code:which(Suite). This has been corrected.
2012-10-23Eliminate unexpected I/O to the minor log fileBjörn Gustavsson
2012-10-23Introduce test_server_io and test_server_glBjörn Gustavsson