summaryrefslogtreecommitdiff
path: root/scripts/lib/perl5/QtQA/TestScript.pm
Commit message (Collapse)AuthorAgeFilesLines
* Use SPDX license identifiersLucie Gérard2022-06-081-27/+2
| | | | | | | | | | | Replace the current license header in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: master Task-number: QTBUG-67283 Change-Id: I6ae743e055bbf1cf514abe604157068923fb03c6 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix licensingJani Heikkinen2017-06-011-17/+12
| | | | | | | | | | - Remove unnecessary license files and license header templates - Tools and test are licensed under GPL-EXCEPT nowdays, update correct license header there - Update test data to match current license headers Change-Id: Ia25c9e0989be326e0edeb0325af399edc26f0054 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Update copyright headersAntti Kokko2015-02-131-22/+14
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I5999ee256134fe82ab13f6f06fcd1d0aa150b688 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* TestScript.pm: Workaround Test::Perl::Critic testSergio Ahumada2013-05-311-1/+1
| | | | | | | | | This worksaround not ok 55 - Test::Perl::Critic for "lib/perl5/QtQA/TestScript.pm" Change-Id: I36c22d739ed1eebe064c4918b6679b59f58c20a7 Reviewed-by: Janne Anttila <janne.anttila@digia.com>
* Workaround for Windows 8 "Can't spawn cmd.exe" error.Janne Anttila2013-05-301-0/+23
| | | | | | | | | | | | | | | | Windows 8 CI builds fail randomly with "Can't spawn cmd.exe" error, after some investigation it was found that OS environment gets corrupted on those cases. For more information, please see comments in code. Since the root cause for environment corruption is not yet known, workaround implemented by using environment backup/restore mechanism. With this workaround I managed to run QtQA_master_integration CI in a loop for 100 times, and without workaround the error typically happened between 10-20 executions. Change-Id: I034a3f45a2bd2b791d5beabcd57d8047d1936e68 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
* Add timestamp and phase entry and exit prints to build log.Tony Sarajarvi2013-04-181-0/+8
| | | | | | | | | | | | | When testscript.pm now enters a new job or phase, it will print to log a timestamped entry. This will also be printed with duration at the point of exit. example of entry and exit: 09:34:21 #=# Wed Apr 17 09:34:21 2013 #=# >cleaning existing target directories 09:34:36 #=# Wed Apr 17 09:34:36 2013 #=# <cleaning existing target directories #=# Elapsed 15 second(s). Change-Id: I76a300244ea09193f877f57c3ed1f9e44a4b3d2b Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Simo Fält <simo.falt@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-141-1/+1
| | | | | | Change-Id: I02eaa709ff91d158a3e34f4e719254f2adce873e Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Janne Anttila <janne.anttila@digia.com>
* Differentiate between failures and errors when aborting a test scriptRohan McGovern2012-10-091-14/+46
| | | | | | | | | | | | | | | | | | Previously, fatal_error() was the only way to abort a script with a message to be understood by parse_build_log.pl; however, it makes sense to differentiate between "failure" (we probably found a genuine problem in the software under test) and "error" (something unexpected happened which prevents us from continuing, probably unrelated to the software under test). The main reason to categorize problems as either failures or errors is that it often makes sense to retry and/or notify some responsible CI person on errors, but rarely makes sense to do that on failures. Change-Id: I3b4d71f0431ed06b864b6f576658ada097f13e33 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-241-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I0122cd74f6246a5f20eee2b33ceb328df77a32db Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* QtQA::TestScript: ensure $? is set when exe(), exe_qx() returnRohan McGovern2012-07-241-2/+12
| | | | | | | | | | | | | Set $? to the right value after exe() and exe_qx(), for compatibility with system() and qx(). Actually, $? would often end up being set to the correct value already, but we did not enforce, test or document it, and the usage of QtQA::Proc::Reliable could leave the value set incorrectly. Change-Id: Idd0710ec8afb63ae55a9a0e9d0bbeef40b64f5e6 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Fixed 'QtQA::TestScript: scope mismatch' warnings on WindowsRohan McGovern2012-07-231-1/+1
| | | | | | | | | | | | | | | | | | | | The Windows implemention of exe() uses perl threads. When a new Perl thread is created, all objects are cloned into the new thread (by default). This included the ReleaseAction instances returned by the QtQA::TestScript::doing() method. When the exe() threads were destroyed, the ReleaseActions would sometimes be destroyed in a different order than they were created, resulting in spurious 'scope mismatch' warnings. This did not cause any harm other than the warning messages. Since it never makes sense for these ReleaseActions to be cloned into separate threads, replace them with a ReleaseAction subclass opting-out of thread cloning by sub CLONE_SKIP { 1 }. Change-Id: I2d0f2e01a7df3b707a683f7800deff70d2c92c98 Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Fixed ambiguous handling of YAML errors in test logs.Rohan McGovern2012-05-221-2/+3
| | | | | | | | | | | | | We were using the standard "..." marker to denote the end of a YAML document. Unfortunately, a few other places would also generate a line containing "..." and nothing else, making it hard to parse unambiguously (at least when parsing lines in reverse order). Add a comment as well, which is permitted by the YAML spec and makes the formatting unambiguous. Change-Id: Ie0f3d26465f65c4ccf664a81cd05f38f29f79a9c Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* QtQA::TestScript: during exe, print CWD and PATH when they changeRohan McGovern2012-04-301-0/+25
| | | | | | | | | | | | We always print each command we run, but we weren't printing the CWD or PATH, making the command log often useless. At each exe(), print the current working directory and PATH if they are different from the last exe(). This makes the logs less ambiguous. Change-Id: I78f5e2b5589889f8e98f2e62ee5697e7e6018499 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Add context information to fatal errors.Rohan McGovern2012-04-231-3/+101
| | | | | | | | | | | | | | | | | | | | If a test script does something like: my $doing = $self->doing( 'compiling Qt' ); $self->configure( ); $self->make( ); $self->make_install( ); , and a fatal error occurs somewhere in there, parse_build_log.pl can now produce a nice summary for gerrit: Compiling Qt failed :( (details here ...) Change-Id: I91517517c7f5af3a0ce313a485bfde91aa15b3cc Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Provide a way to make fatal errors parseable by parse_build_log.plRohan McGovern2012-04-231-21/+85
| | | | | | | | | | | | | | | Rather than explicitly hardcoding every possible error case in parse_build_log.pl, we can introduce our own standard error format for scripts under our control. The new fatal_error function will format a fatal error message so that it is both (reasonably) human-readable, and also robustly readable by parse_build_log.pl, potentially with additional metadata. YAML is used to satisfy the "human and machine readable" quality. Change-Id: I03b3012860376fed406602b5d0e529c1ee0d13c7 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Note that the "All rights reserved" line has not been removed from the test data for the license checker's selftest, but the extra blank line has been added to those files. Change-Id: Icf3080dcdb51c2cbf0e825f2f374cb9666eea44c Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | | | | | Replace Nokia contact email address with Qt Project website. Note that the test data for the license checker's selftest are intentionally excluded from this commit, except for the last line of the LGPL-ONLY license text. The test data will be updated when/if the license checker stops allowing the old contact address. Change-Id: I82ef842d2536a4a9bea99832099f53247c8d4b4b Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | | Change-Id: I37b39e61a52db58885e99a4c8f2ba654de09f3c9 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove mentioning of -nokia-developer argumentKai Koehne2012-01-041-1/+1
| | | | | | | | | | The -nokia-developer configure argument will be removed. Use -developer-build instead. Change-Id: I2191262733342d20367d39c35cf6ca5b1f91041e Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* qtmod_test.pl: added support for shadow builds.Rohan McGovern2011-11-181-0/+1
| | | | | | | | | | Introduce a new property, shadowbuild.dir. Shadow builds can be done by setting shadowbuild.dir (build directory) and base.dir (source directory) to two different values. Change-Id: I80bb52e304e5138302f9e91b02ac802dff5e7141 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jyri Tahtela <jyri.tahtela@nokia.com>
* QtQA::TestScript: support usage of `QTQA_' prefix for env varsRohan McGovern2011-10-261-10/+25
| | | | | | | | | | | | | It's silly to hardcode `PULSE_' at the beginning of all environment variables when these scripts are entirely unrelated to Pulse. Use a more generic environment variable name by default. A corresponding commit will be made in qtqa/testconfig.git to start using the new variable names. Change-Id: Idd7ac2b4790a6922ac544a04b24c1dbf8523cce9 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* QtQA::TestScript: increased all exe-related verbosity by 1Rohan McGovern2011-08-201-4/+4
| | | | | | | | | | Log the commands we run by default. Without this, it is too hard to figure out what the test script is doing. Change-Id: Idfab17d3dce2f4a72f1e95926b1b677765d46e73 Reviewed-on: http://codereview.qt.nokia.com/3230 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Keith Isdale <keith.isdale@nokia.com>
* Add missing license headersJason McDonald2011-08-121-0/+41
| | | | | | | | Change-Id: Ie46c826863e546ee2f60796a037cd5c61f9a5192 Reviewed-on: http://codereview.qt.nokia.com/2606 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Automatically recover from some transient errors in test scriptsRohan McGovern2011-07-271-16/+321
| | | | | | | | | | | | | | | | | | | | | | | | | When running complex test procedures, it is unfortunately relatively common that certain types of errors may arise which are unrelated to the code under test. One example of this is a test procedure which attempts to perform a git clone from a remote host. If implemented simply, this test procedure will fail whenever the remote host is undergoing maintenance or a temporary network outage has occurred. This is usually undesirable. This commit adds some infrastructure for test scripts to transparently recover from these types of errors without having to explicitly code for them. Currently handled are various errors from git, ssh and scp relating to network problems. Task: QTQAINFRA-223 Change-Id: I8fb0a505cdbb8ad00f6bd036854b30e24201419b Reviewed-on: http://codereview.qt.nokia.com/644 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* qt_update_submodules: add new script for automatic updates of qt/qt5.gitRohan McGovern2011-07-071-0/+83
| | | | | | | | | | | | This script may be run periodically to automatically update all submodules of qt/qt5.git to their newest tested SHA1. Change-Id: Ia5278f69549a5729f17dd5012f74242b85ebdde1 Reviewed-on: http://codereview.qt.nokia.com/1197 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Keith Isdale <keith.isdale@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Rename `Qt' namespace used in qtqa perl scripts to `QtQA'Rohan McGovern2011-06-031-0/+620
The `Qt' perl namespace should be reserved for code which conceptually forms a part of the Qt API, e.g. the Qt perl bindings. Reviewed-by: Keith Isdale Change-Id: I0f2a69156e03abebd177bc7f5231e5d4a84499a2