NAME

Tapper::Cmd::Testrun

SYNOPSIS

This project offers backend functions for all projects that manipulate testruns or preconditions in the database. This module handles the testrun part.

use Tapper::Cmd::Testrun;

my $bar = Tapper::Cmd::Testrun->new();
$bar->add($testrun);
...

NAME

Tapper::Cmd::Testrun - Backend functions for manipluation of testruns in the database

FUNCTIONS

find_matching_hosts

create

Create new testruns from a data structure that contains all information including requested hosts and features. If the new testruns belong to a test plan instance the function expects the id of this instance as second parameter.

@param hash ref - testrun description OR string - YAML @optparam instance - test plan instance id

@return array - testrun ids

@throws die()

add

Add a new testrun. Owner/owner_id and requested_hosts/requested_host_ids allow to specify the associated value as id or string which will be converted to the associated id. If both values are given the id is used and the string is ignored. The function expects a hash reference with the following options: -- optional -- * requested_host_ids - array of int or * requested_hosts - array of string

* notes - string * shortname - string * topic - string * date - DateTime * instance - int

* owner_id - int or * owner - string

@param hash ref - options for new testrun

@return success - testrun id) @return error - exception

@throws exception without class

update

Changes values of an existing testrun. The function expects a hash reference with the following options (at least one should be given):

* hostname - string * notes - string * shortname - string * topic - string * date - DateTime * owner_id - int or * owner - string

@param int - testrun id @param hash ref - options for new testrun

@return success - testrun id @return error - undef

del

Delete a testrun with given id. Its named del instead of delete to prevent confusion with the buildin delete function.

@param int - testrun id

@return success - 0 @return error - error string

rerun

Insert a new testrun into the database. All values not given are taken from the existing testrun given as first argument.

@param int - id of original testrun @param hash ref - different values for new testrun

@return success - testrun id @return error - exception

@throws exception without class

pause

Pause an existing testrun by setting its state to 'prepare'.

@param int - id of original testrun

@return success - testrun id @return error - exception

@throws exception without class

continue

Continue a paused testrun (status 'prepare') by setting its state back to 'schedule'.

@param int - id of original testrun

@return success - testrun id @return error - exception

@throws exception without class

cancel

Stop a running testrun by sending the appropriate message to MCP. As convenience to the user the function will also work on testruns that are not running. In that case the return value contains a warning that the caller should present to the user.

@param int - testrun id @optparam string - comment

@return success - success string @return error - error string

@throws die()

status

Get information of one testrun.

@param int - testrun id

@return - hash ref - * status - one of 'prepare', 'schedule', 'running', 'pass', 'fail' * success_ratio - percentage of success

@throws - die

AUTHOR

AMD OSRC Tapper Team, <tapper at amd64.org>

COPYRIGHT & LICENSE

Copyright 2012 AMD OSRC Tapper Team, all rights reserved.

This program is released under the following license: freebsd

AUTHORS

  • AMD OSRC Tapper Team <tapper@amd64.org>

  • Tapper Team <tapper-ops@amazon.com>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2022 by Advanced Micro Devices, Inc.

This is free software, licensed under:

The (two-clause) FreeBSD License