Application test

Introduction

Once you have created and built an application, it is possible to test it. To do so, the app needs to have a -redtest subpackage (for more information please refer to this part of the documentation). But also, the factory needs to know several parameters:

  • The image where the application will be tested
    • This image is the one installed on the target prior to running the test of the application
    • If not set, the factory gets for you the most suitable image to run the application tests
  • The board model to use to run the test
    • If no board model is set, the default one always available inside the factories is qemu-redpesk-x86_64
    • If you want to test an application on a real board, you need first to integrate this board in the redpesk factory

You also have the possibility to specify additional parameters:

  • The time-out: maximum time for the test to take place (default: 5 minutes)
  • Comment: a comment that describes your test (default: “”)

All these parameters can be saved in the factory as “default parameters”. Once set, the factory will use those if nothing is specified or if the test is started automatically (after a successful build if the auto field is activated in the application settings).

Using the WebUI

Start an application test

Enable automatic test

Configure default test settings

Using rp-cli

Start an application test

$ rp-cli applications test redtest-helloworld-api -b qemu-redpesk-x86-64 --project my-demo-image-project
-- Application test requested by user --
Testing the application on build 5264...	

[STATE CHANGE] pending      -- TOTAL => 0   
[STATE CHANGE] deploying    -- TOTAL => 0   
[STATE CHANGE] started      -- TOTAL => 0   
[STATE CHANGE] started      -- TOTAL => 0   
[STATE CHANGE] success      -- TOTAL => 6   
------- Application test succeeded ------

Enable automatic test

$ rp-cli applications update redtest-helloworld-api --auto-test true
-- Application update requested by user --
Processing the distribution(s) settings...	[OK]
Update of "redtest-helloworld-api" application...	[OK]

Configure default test settings

$ rp-cli applications tests set-default-settings redtest-helloworld-api -b qemu-redpesk-x86-64 -i my-demo-image --time-out 10
-- Set default test settings for application --
Update of "redtest-helloworld-api" application...	[OK]