From Fedora Project Wiki

No edit summary
No edit summary
Line 1: Line 1:
{{admon/caution|Draft|This page is only draft, and will change in time.}}
{{admon/caution|Draft|This page is only draft, and will change in time.}}
 
{{admon/tip|See ResultsDB schema|Knowledge from [[AutoQA_resultsdb_schema]] may be required.}}
== Syntax Description ==
== Syntax Description ==


Line 17: Line 17:
<code>start_job ([testplan_url]) -> job_id </code>
<code>start_job ([testplan_url]) -> job_id </code>


=== end_job===
* <code>testplan_url</code> ~ link to wiki page with metadata (usefull for frontends)
* <code>job_id</code> ~ job identifier for Job <-> Testrun relationship.


<code>end_job (job_id) </code>
Intended to be used mostly by the AutoQA scheduler, when one will need to logically connect results of more tests for one package/repo/...
The job_id value will then be passed to the test probably via control file (i.e. another argument for <code>job.run()</code>)


=== start_testrun ===
=== start_testrun ===


<code>start_testrun (test_url, [job_id]) -> testrun_id</code>
<code>start_testrun (test_url, [job_id]) -> testrun_id</code>
* <code>test_url</code> ~ link to wiki page with metadata (usefull for frontends)
* <code>job_id</code> ~ optional argument. If set, new record will be created in the Job <-> Testrun relationship table.
Use to create new entry in the Testrun table. Sets up the start_time


=== end_testrun ===
=== end_testrun ===

Revision as of 14:08, 12 April 2010

Draft
This page is only draft, and will change in time.
See ResultsDB schema
Knowledge from AutoQA_resultsdb_schema may be required.

Syntax Description

method_name (arg1, [arg2, arg3 = "Foo"]) -> return_value

  • method_name ~ name of the respective method (see #Methods)
  • arg1 ~ required argument
  • arg2 ~ optional argument, default value is set to None
  • arg3 ~ optional argument, default value is set to "Foo"
  • -> return_value ~ method gives back the return_value

Methods

start_job

start_job ([testplan_url]) -> job_id

  • testplan_url ~ link to wiki page with metadata (usefull for frontends)
  • job_id ~ job identifier for Job <-> Testrun relationship.

Intended to be used mostly by the AutoQA scheduler, when one will need to logically connect results of more tests for one package/repo/... The job_id value will then be passed to the test probably via control file (i.e. another argument for job.run())

start_testrun

start_testrun (test_url, [job_id]) -> testrun_id

  • test_url ~ link to wiki page with metadata (usefull for frontends)
  • job_id ~ optional argument. If set, new record will be created in the Job <-> Testrun relationship table.

Use to create new entry in the Testrun table. Sets up the start_time

end_testrun

end_testrun (testrun_id, result, [keyval_pairs, summary, highlights])

start_phase

start_phase (testrun_id, name)

end_phase

end_phase (testrun_id, result)

store_keyval

store_keyval (testrun_id, keyval_pairs)

Workflows

Simple

testrun_id = start_testrun ("http://fedoraproject.org/wiki/QA:Some_test_page")
end_testrun (testrun_id, "PASSED")

Phases - simple

testrun_id = start_testrun ("http://fedoraproject.org/wiki/QA:Some_test_page")
  start_phase (testrun_id, "First phase")
  end_phase (testrun_id, "PASSED")
  start_phase (testrun_id, "Second phase")
  end_phase (testrun_id, "PASSED")
end_testrun (testrun_id, "PASSED")

Phases - nested

testrun_id = start_testrun ("http://fedoraproject.org/wiki/QA:Some_test_page")
  start_phase (testrun_id, "First phase")
    start_phase (testrun_id, "Second phase")
    end_phase (testrun_id, "PASSED")
  end_phase (testrun_id, "PASSED")
end_testrun (testrun_id, "PASSED")

Using Job

job_id = start_job ()
  testrun_id = start_testrun ("http://fedoraproject.org/wiki/QA:Some_test_page")
    start_phase (testrun_id, "First phase")
    end_phase (testrun_id, "PASSED")
  end_testrun (testrun_id, "PASSED")

  testrun_id = start_testrun ("http://fedoraproject.org/wiki/QA:Some_other_test_page")
    start_phase (testrun_id, "First phase")
    end_phase (testrun_id, "PASSED")
  end_testrun (testrun_id, "PASSED")