Gating on automated tests in Fedora - Greenwave

Factory 2.0

Matt Jia <mjia@redhat.com>

Automated test results in Bodhi

Greenwave is:

Problem #1

No checks are required for all the distributions.

What checks do we want to enforce?

Problem #2

Specifying required checks is a repetitive manual process

Why a new service?

What happens when a test goes bad?

WaiverDB is:

Help Freshmaker enforce quality

Gating on the rebuilds

How Greenwave works under the hood

So the next topic is I would like talk about how Greenwave works under the hood and where are we at today with the current implementation. All of these three services are implemented by using Flask which is a microframework for Python. It is well documented and easy to code.

An example of a Greenwave policy

--- !Policy
id: 1
product_version:
  - fedora-26
decision_context:
  - bodhi_update_push_stable
rules:
  - !PassingTestCaseRule {test_case_name: dist.abicheck}
  - !PassingTestCaseRule {test_case_name: dist.deplint}
  - !PassingTestCaseRule {test_case_name: dist.upgradepath}

An example of calling Greenwave API

$ http POST http://greenwave.stg.fedoraproject.org/api/v1.0/decision \
      decision_context=bodhi_update_push_stable \
      product_version=fedora-26 \
      subject:='[{"item":"glibc-1.0-1.f26", "type": "koji_build"}]'
{
    "applicable_policies": [1],
    "policies_satisified": false,
    "summary": "1 of 3 required tests failed",
    "unsatisfied_requirements": [
        {
            "item": {
                "item": "glibc-1.0-1.f26",
                "type": "koji_build"
            },
            "testcase": "dist.abicheck",
            "type": "test-result-failed"
        }
    ]
}

An example of calling WaiverDB API

$ http --auth-type=negotiate --auth : POST \
     http://waiverdb.stg.fedoraproject.org/api/v1.0/waivers/ \
     result_id=1 \
     product_version=fedora-26 \
     waived=true \
     comment="Because I say it!"
{
    "comment": "Because I say it!",
    "id": 1,
    "product_version": "fedora-26",
    "result_id": 1,
    "timestamp": "2017-08-16T22:21:29.926900",
    "username": "mjia",
    "waived": true
}

Next steps

Questions?

SpaceForward
Right, Down, Page DownNext slide
Left, Up, Page UpPrevious slide
POpen presenter console
HToggle this help