aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server
AgeCommit message (Collapse)Author
2012-12-20[test_server] Stop cover on node after node is terminatedSiri Hansen
Before terminating slave nodes, test_server calls cover:flush/1 to fetch data from the node without actually stopping cover on this node. If cover is not stopped for the node and a new node with the same name is started, then cover will be started on the new node. To avoid this test_server now calls cover:stop/1 after the slave node is terminated.
2012-11-27Merge tag 'OTP_R15B03'Björn-Egil Dahlberg
The R15B03 release
2012-11-26Prepare releaseOTP_R15B03Erlang/OTP
2012-11-26Merge branch 'bjorn/ct/separate-io-server/OTP-10101'Björn Gustavsson
* bjorn/ct/separate-io-server/OTP-10101: Fix race condition in test_server_io
2012-11-26Merge branch 'maint'Raimo Niskanen
2012-11-26Fix erroneous skipping for jinterface, erl_interface and icRaimo Niskanen
2012-11-21Merge branch 'siri/test_server/erl2html-indent-problem/OTP-9710'Siri Hansen
* siri/test_server/erl2html-indent-problem/OTP-9710: [test_server] Minimize memory usage in erl2html2:convert/[2,3] [test_server] Fix erl2html2.erl to handle badly indented files
2012-11-20[test_server] Minimize memory usage in erl2html2:convert/[2,3]Siri Hansen
Reading form by form and line by line, instead of reading the complete file in one go.
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-19Fix race condition in test_server_ioBjörn Gustavsson
In test_server_io:gc/1 we collect the group leaders for all processes. We must handle the case that a process has died after processes/0 was called and process_info(P, group_leader) is called.
2012-11-19Merge branch 'siri/test_server/break-in-end_per_testcase/OTP-10046'Siri Hansen
* siri/test_server/break-in-end_per_testcase/OTP-10046: [test_server] Cancel timetrap for break in end_per_testcase
2012-11-16[test_server] Cancel timetrap for break in end_per_testcaseSiri Hansen
Any call to test_server:break/1 should cancel all active timetramps. In some cases, Suite:end_per_testcase/2 is executed on a different process than the test case itself, and if test_server:break/1 would be called from there, the timetraps would not be cancelled. This has been corrected.
2012-11-15Merge branch 'maint'Siri Hansen
2012-11-14[test_server] Recognize and ignore info_reports for ct connectionsSiri Hansen
test_server_h will now recognize info_reports written by ct connection handlers (according to the description in cth_conn_log) and ignore them as they will be completely handled by by ct_conn_log_h. Earlier test_server_h would print a tag (testcase name) before forwarding the report to error_logger_tty_h. This would cause lots of tags in the log with no info report following (since error_logger_tty_h did not handle them).
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-07test_server_io: Correct a few commentsBjörn Gustavsson
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 "Cover analysing..." is written to stdoutBjörn Gustavsson
If it is written with io:fwrite/2 it will be written to the unexpected_io log, where it will not be of any use.
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-11-07[test_server] Add Config to run_test_case_msgloop/1 from the startSiri Hansen
Earlier, #st.config was set to undefined when entering this loop. Then it was updated when the test case itself started. This means that if the test case process crashed during test case initiation, the parent process would not know the Config. This commit saves the initial Config value in the parent process (run_test_case_msgloop/1) from the start.
2012-11-02Merge branch 'maint'Lukas Larsson
* maint: Skip ct_netconf tests if there is no crypto Migrate timers from test_server to ct interface Update tests to run with an oldshell emulator Move crypto check so that tc is skipped and not failed Update for new version of ppc compilation chain Verify that ebin folder of applications exists Conflicts: lib/asn1/test/asn1_SUITE.erl lib/kernel/test/interactive_shell_SUITE.erl
2012-10-31Merge branch 'siri/cover-tests'Siri Hansen
* siri/cover-tests: (21 commits) [common_test] Extend timer for flushing error logger [cover] Allow reconnection if node has been disconnected or down [cover] Don't kill remote nodes when connection to main node is lost [test_server] Add option {start_cover,false} to test_server:start_node Use code:lib_dir instead of code:which to get application directory [common_test] Add test for OTP-9956 Include all kernel modules in code coverage analysis [common_test] Add test suite for code coverage support [common_test, test_server] Don't flush cover if cover is not running [common_test] Add option cover_stop [test_server] Allow cross cover analysis when testing through common_test [test_server] Start cover in test_server:wait_for_node [test_server] Multiply timers with timetrap_scale_factor when starting nodes Include all stdlib modules in code coverage analysis [test_server] Include all test_server modules in code coverage analysis Skip epp_SUITE:otp_8911 if cover is running [common_test] Start cover on slave nodes if running cover tests [common_test] Don't stop cover before stopping slave node [test_server] Don't stop cover after test is finished [cover] Add support for test_server ... OTP-10427
2012-10-30[test_server] Add option {start_cover,false} to test_server:start_nodeSiri Hansen
By default the test server will start cover on all nodes when the test is run with code coverage analysis. To make sure cover is not started on a new node, this option can be set. This can be useful if the test itself starts cover or if the new node for some reason can not run cover compiled code.
2012-10-30[common_test, test_server] Don't flush cover if cover is not runningSiri Hansen
ct_slave, ct_test_support and test_server_test_lib always called cover:flush/1 when stopping slave nodes. If cover was not running, this would cause cover_server to be started and thus test_server:is_cover/0 to return true afterwards. 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] Start cover in test_server:wait_for_nodeSiri Hansen
Without this change, there is no support in test_server for starting cover on a node started with option {wait,false}.
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-30[test_server] Include all test_server modules in code coverage analysisSiri Hansen
2012-10-30[test_server] Don't stop cover after test is finishedSiri Hansen
This commit removes all calls to cover:stop from test_server. This is to avoid crash in some processes due to old code. The correction shall be further refined for general use. There will, for instance, be an option to turn off cover:stop/0 after completed test run, so the default behaviour is backwards compatible.
2012-10-26Simplify managment of test_server_locBjörn Gustavsson
Before line numbers were included in exceptions (in R15), there were parse transforms and macros that would keep the test_server_loc process dictionary variable updated; therefore there is a mod_loc/1 function that will normalize the representation of locations. Simplify the code as following: * 'test_server_loc' should always contain a list with one or more tuples. ({M,F} or {M,F,Line}) * At the beginning of each test case, set 'test_server_loc' to [{Module,Func}] of the the currently executing test case. * Stop updating 'test_server_loc', except when an exception occurs. (It used to be updated when running 'init_per_testcase' and so on.) * Remove the mod_loc/1 function.
2012-10-26Keep the information about the current test case consistentBjörn Gustavsson
Three pieces of information could be out of sync in testcase supervisor process at the time when a timetrap occurred: * test_server_loc (process dictionary) - may indicate that a framework function is executing * test_server_init_or_end_conf (process dictionary) - indicates whether init_per_testcase or end_per_testcase is executing * The current configuration (#st.config) - set using a synchronous call There could be in a crash in spawn_fw_call/7 because the current configuration was not defined when it was expected to. To avoid the problem, introduce set_tc_state/2 (and a corresponding message) to allow setting both an indication what the testcase is executing (e.g. init_per_testcase, framework call, and so on), and the current configuration. Use only that information to handle a timetrap timeout (and aborted testcase and the other reasons for the testcase process to terminate). Completely remove test_server_init_or_end_conf.
2012-10-26test_server: Eliminate the Loc argument for do_end_tc_call()Björn Gustavsson
The Loc argument was use to determine the name of the currently executing test case, in case that the M and F arguments did not specify a test case. Since a previous commit makes sure that the M and F arguments *are* valied, we can eliminate the Loc argument.
2012-10-26Refactor the handling of the make_priv_dir messageBjörn Gustavsson
The code is not actually shorter, but it avoids duplicating the code for producing an error tuple when theres is no priv_dir tuple in the config data.
2012-10-26test_server: Refactor run_test_case_msgloop()Björn Gustavsson
Keeping all state as separate function arguments does not make it easy to add more pieces of data to the state. Case in point is the CurrConf argument where up to three separate items have been shoehorned in. Instead of the arguments, introduce a state record to hold all of the different pieces of state (taking care to separate the former CurrConf variable into separate fields in the record). While at it, fix a bug. The name of the currently executing test case (module and function) used to be stored in a tuple in the CurrConf variable, and it would only be available after 'set_curr_conf' message has been received. Depending on timing, it was possible in rare circumstances for an EXIT signal to arrive before the 'set_curr_conf' message. Avoid this problem by putting the current test case name into the record from the beginning. That also means that we can eliminate the workaround of getting the currently executing test case from the stack trace using the get_mf/1.
2012-10-26Merge branch 'bjorn/test_server/test-cases'Björn Gustavsson
* bjorn/test_server/test-cases: test_server tests: Be kind to Windows by using shorter pathnames
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-25test_server tests: Be kind to Windows by using shorter pathnamesBjörn Gustavsson
The pathnames gets too long for Windows if we use priv_dir as working directory for the test_server tests in the slave node. Use data_dir instead. Revert this commit when the run-time system can handle long pathnames on Windows.
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
2012-10-23Clean up initialization of parallel test casesBjörn Gustavsson
2012-10-23Introduce is_io_buffered/0 to somewhat improve readabilityBjörn Gustavsson
Note that there are some more direct use of: get(test_server_common_io_handler) that cannot be replaced with a call to is_io_buffered/0.
2012-10-23test_server_ctrl: Consistently use set_io_buffering/1Björn Gustavsson
Since we will want to change the implementation of I/O buffering in a future commit, make sure that all updates of the buffering state is done by calling set_io_buffering/1.
2012-10-12Merge branch 'egil/add-scalefactor-to-start_node'Björn-Egil Dahlberg
* egil/add-scalefactor-to-start_node: test_server: Let start_node/3 utilize scalefactor test_server: Refactor timetrap_scale_factor/0
2012-10-08test_server: Let start_node/3 utilize scalefactorBjörn-Egil Dahlberg
* test_server_node:start_node/3 now uses timetrap_scale_factor for timeouts (peer nodes)
2012-10-08test_server: Refactor timetrap_scale_factor/0Björn-Egil Dahlberg
2012-10-05ts_run: Always turn on timetrap scaling when starting common_testBjörn Gustavsson
Scaling timetraps depending on cover, debug-compiled emulator and so on is built-in to the test_server. Therefore, {multiply_timetraps,Scale} should not be set (it would multiply the timeout value twice). Only {scale_timetraps,true} needs to be set, and it must be set unconditionally as the feature tests in test_server:timetrap_scale_factor() may not return the correct scale factor until the test_server node and test cases have been started (for example, there is no cover server running).