Giter Club home page Giter Club logo

scripts's Introduction

os-autoinst scripts

Communication

If you have questions, visit us on IRC in #opensuse-factory

How to use

Checkout the individual scripts and either call them manually or automatically, e.g. in CI jobs

auto-review - Automatically detect known issues in openQA jobs, label openQA jobs with ticket references and optionally retrigger

Based on simple regular expressions in the subject line of tickets on progress.opensuse.org within https://progress.opensuse.org/projects/openqav3 or any subproject of it, commonly https://progress.opensuse.org/projects/openqatests/ , openQA jobs can be automatically labeled with the corresponding ticket and optionally retriggered where it makes sense.

For this the subject line of a ticket must include text following the format auto_review:"<search_term>"[:retry][:force_result:<result>]

Note that the force_result feature is disabled by default.

  • <search_term>: the perl extended regex to search for
  • :retry: (optional) boolean switch after the quoted search term to instruct for retriggering the according openQA job.
  • :force_result:<result>: (optional) give the job a special label which forces the result to be the given string

Examples:

  • auto_review:"error 42 found".
  • auto_review:"error 42 found":retry.
  • auto_review:"error 42 found":force_result:softfailed.
  • auto_review:"error 42 found":retry:force_result:softfailed.

The search terms are crosschecked against the logfiles and "reason" field of the openQA jobs. A multi-line search is possible, for example using the <search_term>

(?s)something to match earlier.*something to match some lines further down

Other double quotes in the subject line than around the search term should be avoided. Also be careful to not specify a too generic search term to prevent false matches of job failures unrelated to the specified ticket.

  • openqa-monitor-incompletes queries the database of an openQA instance (ssh access is necessary) and output the list of "interesting" incompletes, where "interesting" means not all incompletes but the ones likely needing actions by admins, e.g. unreviewed, no clones, no obvious "setup failure", etc.
  • openqa-label-known-issues can take a list of openQA jobs, for example output from "openqa-monitor-incompletes" and look for matching "known issues", for example from progress.opensuse.org, label the job and retrigger if specified in the issue (see the source code for details how to mark tickets)

For tickets referencing "auto_review" it is suggested to add a text section based on the following template:

## Steps to reproduce

Find jobs referencing this ticket with the help of
https://raw.githubusercontent.com/os-autoinst/scripts/master/openqa-query-for-job-label ,
for example to look for ticket 12345 call `openqa-query-for-job-label poo#12345`

openqa-investigate - Automatic investigation jobs with failure analysis in openQA

openQA can be configured to automatically trigger investigation jobs whenever there is no carry-over and no automatic ticket assignment by auto-review.

  • openqa-monitor-investigation-candidates queries the dabase of an openQA instance (ssh access is necessary) and output the list of failed jobs that are suitable for triggering investigation jobs on, compare to "openqa-monitor-incompletes"

  • openqa-investigate can take a list of openQA jobs, for example output of "openqa-monitor-investigation-candidates" and trigger "investigation jobs", e.g. a plain retrigger, using the "last good" tests as well as "last good" build and a combination of both. The results of all these four jobs should give a pretty good indication if something is a test regression, a product regression, an infrastructure problem or a sporadic issue.

Combine auto-review and openqa-investigate

A possible approach to combine handling known issues and unknown issues is to run "openqa-label-known-issues" against all "investigation candidates" and pass all unknown issues to "openqa-investigate":

./openqa-review-failed

which does the equivalent of:

./openqa-monitor-investigation-candidates | ./openqa-label-known-issues | ./openqa-investigate

with minor changes to the input/output format used between the commands.

openQA hook scripts - Call auto-review or investigation steps in openQA after every job is done

openQA supports custom job done hook scripts that can be called whenever a job is done, see http://open.qa/docs/#_enable_custom_hook_scripts_on_job_done_based_on_result for details. For the purpose of being called as these hook scripts here the following scripts are provided:

Contribute

This project lives in https://github.com/os-autoinst/scripts

Feel free to add issues in github or send pull requests.

Rules for commits

If this is too much hassle for you feel free to provide incomplete pull requests for consideration or create an issue with a code change proposal.

Local testing

Functional testing

This is done with the Test::More bash library. It will be automatically cloned.

# only a few functions from openqa-label-known-issues so far
make test

Style checks

make checkstyle

openqa-label-known-issues

Generate a list of recent incomplete jobs of your local openQA instance. Here's an example using psql:

psql \
 --dbname=openqa-local \
 --command="select concat('http://localhost:9526/tests/', id, ' ', TEST) from jobs where result = 'incomplete' order by t_finished desc limit 10;" \
 --csv \
 | tail -n +2 > tests/local_incompletes

Perform a dry run on the local instance using the generated job list:

cat tests/local_incompletes | env scheme=http host=localhost:9526 dry_run=1 sh -ex ./openqa-label-known-issues

License

This project is licensed under the MIT license, see LICENSE file for details.

scripts's People

Contributors

amrysliu avatar asdil12 avatar billanastasiadis avatar coolo avatar ilausuch avatar kalikiana avatar martchus avatar mergify[bot] avatar okurz avatar perlpunk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.