Commit Graph

115 Commits (0cf5f89cf4c7aaeb0691dc552c56a862f99e139f)

Author SHA1 Message Date
Przemek Wirkus 4c45ed1cb1 Parallel functionality, marge conflicts resolved (v2)
Description
===========

Added thread model for function SingleTest::execute where for each target we
have separate thread.

Added new experimental feature. Currently we are only building in parallel
mbed SDK and libraries with dependencies.
Each MUT is flashed separately, but with this new feature we are able to
flash multiple boards at the same time and get results in parallel.

Test execution time is reduced by n where n is number of MUTs (MUT: mbed under
test).

using --parallel means that:
* separate thread will be spawned to build mbed SDK and dependencies (libraries)
    for each unique target with all declared toolchains.
    E.g:
            Thread(n==1):   LPC1768:        ARM, uARM, GCC_ARM
            Thread(n==2):   K64F:           ARM, GCC_ARM
            Thread(n==3):   NUCLEO_X:       uARM
    .
    .
    .
    Thread(4): for toolchain in NUCLEO_Z[toolchains]
               -> build mbed SDK
                            -> build libs
                             -> build project
                              -> run MUT testrunner
                                    return test results for NUCLEO_Z[toolchain]

Done:
1. Added option --parallel.
2. Decoupled execute function so it can be run in parallel with other execute
    functions.
3. Thread join via Queue, not Thread::Join() to avoid deadlocks or waits for
    particular thread to finish.
4. All builds are in parallel, but because each target and library for each
    toolchain have different directory we do not worry about building in
    parallel and compiler collisions.

Missing:
1. No sync for 'print' (TODO).
2. No sync on test result structures - not needed because we only append to
    them (?).

Experimental --parallel bugfix: self.test_suite_properties_ext dict was not
populated with target name.
2015-03-12 09:55:11 +00:00
Przemek Wirkus 50ef6207f0 Added new switch -p to force peripheral in autodetection mode (--auto) 2015-03-04 09:48:39 +00:00
Przemek Wirkus 4d5b8776d4 Bugfix for IOTSFW-345:
Adde missing check for optional auto_detect parameter in CLI options.

Test procedure:

* Check with mbed-ls installed:

$ singletest.py --auto -j 8
MBEDLS: Detecting connected mbed-enabled devices...
MBEDLS: Detected K64F, port: COM61, mounted: E:
Building library CMSIS (K64F, ARM)
Copy: startup_MK64F12.o
Copy: sys.o
Copy: cmsis_nvic.o
Copy: system_MK64F12.o

* Uninstall mbed-ls iools:

$ pip uninstall mbed-ls
Uninstalling mbed-ls:
  c:\python27\lib\site-packages\mbed_ls-0.1.4-py2.7.egg
  c:\python27\scripts\mbedls-script.py
  c:\python27\scripts\mbedls.exe
  c:\python27\scripts\mbedls.exe.manifest
Proceed (y/n)? y
  Successfully uninstalled mbed-ls

$ mbedls
'mbedls' is not recognized as an internal or external command,
operable program or batch file.

$ python
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import mbed_lstools
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named mbed_lstools

* Check singletest.py work flow without mbed-ls:

$ singletest.py -i test_spec.json -M muts_all.json
Building library CMSIS (K64F, ARM)
Building library MBED (K64F, ARM)
Building project DETECT (K64F, ARM)
TargetTest::K64F::ARM::DTCT_1::Simple detect test [OK] in 0.50 of 10 sec
Building project DEV_NULL (K64F, ARM)
TargetTest::K64F::ARM::EXAMPLE_1::/dev/null [OK] in 3.49 of 20 sec
Building project HELLO (K64F, ARM)
TargetTest::K64F::ARM::MBED_10::Hello World [OK] in 0.38 of 5 sec
Building project TICKER (K64F, ARM)
TargetTest::K64F::ARM::MBED_11::Ticker Int [OK] in 11.35 of 15 sec
2015-02-19 11:16:45 +00:00
Przemek Wirkus 2882c4e961 Fixed bug in --config and --auto switches 2015-02-10 21:50:56 +00:00
Przemek Wirkus f38a53ba21 Added new switch --auto to force autodetection with mbed_lstools
Added switch --tc to force certain toolchains.

Switch --auto and -tc works well with switch --config so do not hesitate to
check your configuration before running your test suite.
2015-02-10 21:19:01 +00:00
Przemek Wirkus bcfbc3575d Added -f (filter) to configuration switch --config
We can now use --config -f <mcu> to filter only targets we are interested in
2015-01-30 08:38:15 +00:00
Przemek Wirkus 197a1afe5e Unlocked --db switch. Added Wiki page entry to explain how to use MySQL DB with test suite 2014-11-21 13:57:19 +00:00
Przemek Wirkus 858196ffff When users are using 'build only flag' (switch -O) and test do not have specified peripherals (muts.json file is just empty dictionary) we can allow test building by default. This supposed to be Yotta related improvement. 2014-11-12 18:02:07 +00:00
Przemek Wirkus ad70273249 Removed opts.db_url from optional params list in singletest constructor 2014-10-20 11:38:51 +01:00
Przemek Wirkus b3c342bf7c Unlocked option -f (--filter) to filter result by first column 2014-10-20 10:51:02 +01:00
Przemek Wirkus 7935e0f5ea Removed exit(-1) when checking for missing modules. Instead now it will be prompted to used when singletest starts 2014-10-16 14:34:37 +01:00
Przemek Wirkus 12a9051aba Removed few minor pyFlakes warnings 2014-10-15 16:33:30 +01:00
Przemek Wirkus 51223ef6d1 Refactoring of report exporter to support HTML and JUNIT. TODO: add support for TEXT output.
Added JUtnit exporter
2014-10-15 11:33:30 +01:00
Przemek Wirkus 0100aa5732 Removed usused imports 2014-10-15 11:33:26 +01:00
Przemek Wirkus ccac8f8339 Midified way singletest script is checking for installed modules required by test suite 2014-10-15 11:33:22 +01:00
Przemek Wirkus 9fe239dcad Added HTML reporting feature, switch --report-html FILENAME to singletest.py so now users can export test results to external HTML file. This feature can be used to display HTML reports on CI dashboards 2014-09-25 17:42:08 +01:00
Przemek Wirkus b031920624 Added clean build switch --clean to singletest script 2014-09-18 11:17:57 +01:00
Przemek Wirkus 63ee01bdd9 Modified host tests to use serial.realine() function to avoid extra timeouts during tests (test will work faster and will be more reliable) 2014-09-15 17:44:30 +01:00
Przemek Wirkus 39e75c042f Changed test suite version to 1.2
Added simple test to check C strings conversions
2014-09-02 17:34:08 +01:00
Przemek Wirkus 52f929f4e0 Feature: Added waterfall test option: if used defines --loops or --global-loops and -W (--waterfall) option; testing of particular test will be tested until test pass (OK result) 2014-09-02 11:43:08 +01:00
Przemek Wirkus 01b0ed20f7 Added test output to test_entry in database so users can browse between results and see console output 2014-09-01 08:43:45 +01:00
Przemek Wirkus 35fd4ad7d9 Database: added new factory and verbose database detection functions
Added separate file to store test suite DB access interface

Added new functionality to database interface: database name, connection status, hostname + uname functionality

Added option --db to singletest.py so users can define database connection url for database access

Added database configuration check with switch --config. Now users can combine switch --db and --config to check database conenctivity
2014-09-01 08:43:25 +01:00
Przemek Wirkus 61f028f050 Fixed commit issues regarding logging mechanism - missed during previous commits 2014-08-13 10:27:10 +01:00
Przemek Wirkus 698fe930e6 Changed functions' docstring format a little to mach singletest, test api and test webapi files 2014-08-13 10:26:58 +01:00
Przemek Wirkus 17c0132d56 Added parts of functionality related to extra reset types, global timeout increments and image configuration file modifications 2014-08-13 10:26:50 +01:00
Przemek Wirkus c1ebcb498b Simple indent for function call parameters 2014-08-13 10:26:46 +01:00
Przemek Wirkus 5947838b2b BUgfix: jobs (-j) value was not properly set in SingletestRunner class parameters 2014-08-13 10:26:41 +01:00
Przemek Wirkus c3c0be5443 Added extra reset option - not yet implemented. Only switches added to test suite CLI and host_test.py optparse 2014-08-07 11:48:47 +01:00
Przemek Wirkus 7bc89f6323 Refactoring: Continue refactoring for separate CLI and webservice API / functionalities in test suite. Separated by subclassing: 'one responsibility per class' 2014-08-05 09:32:44 +01:00
Przemek Wirkus 72fafcf269 Few pyLint and pyFlakes defects fixed 2014-08-04 16:16:47 +01:00
Przemek Wirkus eed8d68789 Refactoring: moved optParse options frm singletest.py CLI script to test_api to group common options in one place. Added new file test_webapi.py to store there web services API and related functions 2014-08-04 15:57:59 +01:00
Przemek Wirkus 13c6c4f13e Refactoring: created test_api.py and moved test code and classes to separate test api file. Prepareing to add MPS2 reset functionality 2014-08-04 14:29:46 +01:00
Przemek Wirkus dcf1ef2130 Added 'firefox' as one of the ways to copy binary to target device (other options are cp, copy, xcopy, shutil.copy() 2014-08-04 14:29:44 +01:00
Przemek Wirkus 5b07b38554 Added script major / minor version 2014-08-04 14:29:39 +01:00
Przemek Wirkus d9fbefd373 Test compliance with LPC1549 and LPC11U68 2014-07-30 17:53:01 +01:00
Przemek Wirkus 4c24cd6665 Fixed shuffle seed print only when shuffling 2014-07-30 17:52:58 +01:00
Przemek Wirkus 12b8dff9f9 First RESTful API functionality draft 2014-07-30 17:52:56 +01:00
Przemek Wirkus 783d20bac8 Added commandline parser help display when -i or -M option is missiog from command line 2014-07-30 17:52:54 +01:00
Przemek Wirkus 62c3118e38 Bugfixed filter target counter when used with filter. 2014-07-30 17:52:51 +01:00
Przemek Wirkus d71e2713dd Added simple filtering switch for -S option. This can be extended in the future to other switches like -r / -R 2014-07-30 17:52:49 +01:00
Przemek Wirkus d28da8ec83 Fixed flow for JSON defect line / column parsing from json exceprion msg string 2014-07-30 17:52:46 +01:00
Przemek Wirkus 03c96a45de Now issues in JSON configuration files will be printed in human readable format. 2014-07-30 17:52:43 +01:00
Przemek Wirkus d0cd53e29f Few pyLint issues fixed 2014-07-30 17:52:41 +01:00
Przemek Wirkus dc12ff6bba Fixed few pyFlakes issues + simple refactoring of unused variables and imports 2014-07-30 17:52:38 +01:00
Przemek Wirkus c75944562f Bugfix: removed blocking continue from shuffling option 2014-07-30 17:52:36 +01:00
Przemek Wirkus 28e4fc4f06 Separation for test class SingletestRunner towards Object Oriented design. Added shuffle seed to recreate test order when shuffling test order 2014-07-30 17:52:31 +01:00
Przemek Wirkus 4c10fbb660 Changed copyright date to 2014 2014-07-25 17:37:16 +01:00
Przemek Wirkus 8fab5bca18 Bugfix: Replaced magic value of UNDEF test result with proper const name 2014-07-24 15:33:46 +01:00
Przemek Wirkus 21ddd8b6cf bugfix: option -t was not displaying all targets 2014-07-22 10:59:54 +01:00
Przemek Wirkus 805f470880 Bugfix reported by Mihail: If image firmware is not found wrong number of rows is reported (returned by SingleTest.handle() method. 2014-07-21 10:03:04 +01:00