The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)
Quality/TestPackages
(Created page with "= DRAFT as of 15. Oct. 2012 = There are in several places infos about how to package tests in Mer for automated testing. This page tries to consolidate the info and define a stan…") |
(→tests.xml file definition) |
||
(2 intermediate revisions by one user not shown) | |||
Line 12: | Line 12: | ||
[[Quality/Development#Guidelines]] first part till '''OBS''' will be replaced with a pointer to this page | [[Quality/Development#Guidelines]] first part till '''OBS''' will be replaced with a pointer to this page | ||
− | = | + | [[Quality/Terminology#Test package]] text (which even says to use /usr/share/<packagename>!) will be replaced and point to this page |
− | + | ||
+ | ---- | ||
+ | |||
+ | = Test Packages = | ||
Test package is a RPM package that includes scripts, binaries and/or libraries for testing a feature or function. | Test package is a RPM package that includes scripts, binaries and/or libraries for testing a feature or function. | ||
− | * Test package's name must use <packagename>[-*]-tests format | + | == Guidelines == |
+ | === rpm packaging === | ||
+ | * Test package's name must use '''<packagename>[-*]-tests''' format | ||
** Interfixes shall be used if it makes sense to split up the test package | ** Interfixes shall be used if it makes sense to split up the test package | ||
− | ** The following interfixes shall be used: unit, benchmark, functional, feature<!-- | + | ** The following interfixes shall be used: '''unit, benchmark, functional, feature'''<!-- |
--><p>eg. bluez-tests or bluez-unit-tests</p> | --><p>eg. bluez-tests or bluez-unit-tests</p> | ||
** if a binary and/or library is used in more than one <packagename>*-tests package, then it shall go to a package named:<!-- | ** if a binary and/or library is used in more than one <packagename>*-tests package, then it shall go to a package named:<!-- | ||
− | --><p><packagename>-testutils and the <packagename>*-tests packages shall depend on it</p> | + | --><p>'''<packagename>-testutils''' and the <packagename>*-tests packages shall depend on it</p> |
* '''Doesn't''' have to depend on testrunner-lite | * '''Doesn't''' have to depend on testrunner-lite | ||
− | * Test-definition is not required, however recommended since without no automated testing is possible | + | * Test-definition (tests.xml) is not required, however recommended since without no automated testing is possible |
− | + | ** Test package's test-definition must be installed to '''/opt/tests/<packagename>/tests.xml''' | |
− | + | *** exception if upstream installs it due to historical reasons (e.g. Harmattan) to '''/usr/share/<packagename>/''' it can stay there | |
− | ** Test package's test-definition | + | |
− | *** if upstream installs it due to historical reasons (e.g. Harmattan) to '''/usr/share/<packagename>/''' | + | |
* Test package's files should be installed to '''/opt/tests/<packagename>/''' | * Test package's files should be installed to '''/opt/tests/<packagename>/''' | ||
* If test package provides some common test data (audio, video, image) those files should be installed to '''/opt/tests/<packagename>/{data, audio, video, image, text etc}/''',<br />use common sense! | * If test package provides some common test data (audio, video, image) those files should be installed to '''/opt/tests/<packagename>/{data, audio, video, image, text etc}/''',<br />use common sense! | ||
− | * If tests sets require special hardware then the hwiddetect feature of testrunner-lite | + | |
− | --><p>Mer provides a hwiddetect binary: <tt>/usr/bin/hwiddetect</tt> add the following to your tests.xml: '''TODO:''' the binary does not yet exist, needs to be created! the following list needs to be updated accordingly<br /><code><hwiddetect>/usr/bin/hwiddetect</hwiddetect></code><br />The program can identify the following hardware: N9 | + | === tests.xml file definition === |
+ | * Test definition can have not approved or failing test cases<!-- | ||
+ | --><p>in that case the test case must be marked as insignificant:<br /><code><case name="not-so-important-test" insignificant="true"></code><br />see also [[Quality/TestDefinitionHowTo#Test Cases|Test Definition HowTo]]</p> | ||
+ | * If tests sets require special hardware then the hwiddetect feature of testrunner-lite must be used, see [[Quality/TestDefinitionHowTo#Filtering Based on Hardware Identifier|filtering based on Hardware Identifier]]<!-- | ||
+ | --><p>Mer provides a hwiddetect binary: <tt>/usr/bin/hwiddetect</tt> add the following to your tests.xml to make use of it: '''TODO:''' the binary does not yet exist, needs to be created! the following list needs to be updated accordingly<br /><code><hwiddetect>/usr/bin/hwiddetect</hwiddetect></code><br />The program can identify the following hardware: N9, N950, x86-qemu (Virtual Machine) '''TODO:''' which other hardware adoptions are available for Mer/Nemo?</p> | ||
+ | ** If the Mer provided <tt>/usr/bin/hwiddetect</tt> does not suite you, please provide patches and in the mean time you might use your own tool, but make sure it gets installed with the test package | ||
* It can be expected that tests are run with eat-device package setup, this means that: '''TODO:''' link to eat-device description | * It can be expected that tests are run with eat-device package setup, this means that: '''TODO:''' link to eat-device description | ||
**the tests are run as '''non-root''' '''TODO:''' what shall be done when root permissions are needed for the tests to run? | **the tests are run as '''non-root''' '''TODO:''' what shall be done when root permissions are needed for the tests to run? | ||
**<tt>DISPLAY</tt> and <tt>DBUS_SESSION_BUS_ADDRESS</tt> environment variables are exported | **<tt>DISPLAY</tt> and <tt>DBUS_SESSION_BUS_ADDRESS</tt> environment variables are exported | ||
− | **'''do not''' hard code any user paths, use <tt>$HOME</tt | + | **'''do not''' hard code any user paths, use <tt>$HOME</tt> and <tt>$XDG_*</tt> environment variables instead |
+ | * Testrunner-lite supports host based execution, where testrunner-lite is executed on a PC, and the test steps over ssh on hardware. You should always redirect the stdout, stderr and stdin streams of your background processes, if you don't want your test steps to time out in host-based execution.<!-- | ||
+ | --><p>See [[Quality/QA-tools/Testrunner-lite#About host based execution | testrunner-lite wiki]] and [http://www.snailbook.com/faq/background-jobs.auto.html SSH FAQ] for more information.</p> | ||
+ | |||
+ | '''TODO:''' define values (if needed?!) for some of the key fields like: Level, Type, Domain, Component, Feature, Requirement | ||
+ | |||
+ | [[Category:QA]] |
Latest revision as of 12:19, 16 December 2013
Contents |
[edit] DRAFT as of 15. Oct. 2012
There are in several places infos about how to package tests in Mer for automated testing. This page tries to consolidate the info and define a standard. Also to point form the different places to this page.
The DRAFT shall be discussed at the next QA irc meeting and get it's approval and this note will be removed.
[edit] Work on going
this page is at the moment under construction! so please don't mess with it to much :-) consult kontio in IRC #mer
[edit] Pages/Sections which will point to this page
Packaging_guidelines#Test_Packages text will be replaced and point to this page
Quality/Development#Guidelines first part till OBS will be replaced with a pointer to this page
Quality/Terminology#Test package text (which even says to use /usr/share/<packagename>!) will be replaced and point to this page
[edit] Test Packages
Test package is a RPM package that includes scripts, binaries and/or libraries for testing a feature or function.
[edit] Guidelines
[edit] rpm packaging
- Test package's name must use <packagename>[-*]-tests format
- Interfixes shall be used if it makes sense to split up the test package
- The following interfixes shall be used: unit, benchmark, functional, feature
eg. bluez-tests or bluez-unit-tests
- if a binary and/or library is used in more than one <packagename>*-tests package, then it shall go to a package named:
<packagename>-testutils and the <packagename>*-tests packages shall depend on it
- Doesn't have to depend on testrunner-lite
- Test-definition (tests.xml) is not required, however recommended since without no automated testing is possible
- Test package's test-definition must be installed to /opt/tests/<packagename>/tests.xml
- exception if upstream installs it due to historical reasons (e.g. Harmattan) to /usr/share/<packagename>/ it can stay there
- Test package's test-definition must be installed to /opt/tests/<packagename>/tests.xml
- Test package's files should be installed to /opt/tests/<packagename>/
- If test package provides some common test data (audio, video, image) those files should be installed to /opt/tests/<packagename>/{data, audio, video, image, text etc}/,
use common sense!
[edit] tests.xml file definition
- Test definition can have not approved or failing test cases
in that case the test case must be marked as insignificant:
<case name="not-so-important-test" insignificant="true">
see also Test Definition HowTo - If tests sets require special hardware then the hwiddetect feature of testrunner-lite must be used, see filtering based on Hardware Identifier
Mer provides a hwiddetect binary: /usr/bin/hwiddetect add the following to your tests.xml to make use of it: TODO: the binary does not yet exist, needs to be created! the following list needs to be updated accordingly
<hwiddetect>/usr/bin/hwiddetect</hwiddetect>
The program can identify the following hardware: N9, N950, x86-qemu (Virtual Machine) TODO: which other hardware adoptions are available for Mer/Nemo?- If the Mer provided /usr/bin/hwiddetect does not suite you, please provide patches and in the mean time you might use your own tool, but make sure it gets installed with the test package
- It can be expected that tests are run with eat-device package setup, this means that: TODO: link to eat-device description
- the tests are run as non-root TODO: what shall be done when root permissions are needed for the tests to run?
- DISPLAY and DBUS_SESSION_BUS_ADDRESS environment variables are exported
- do not hard code any user paths, use $HOME and $XDG_* environment variables instead
- Testrunner-lite supports host based execution, where testrunner-lite is executed on a PC, and the test steps over ssh on hardware. You should always redirect the stdout, stderr and stdin streams of your background processes, if you don't want your test steps to time out in host-based execution.
See testrunner-lite wiki and SSH FAQ for more information.
TODO: define values (if needed?!) for some of the key fields like: Level, Type, Domain, Component, Feature, Requirement