test-results/

directory
v0.0.0-...-e560ebb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause

README

test-results

This is the Go module for the test-results server (https://test-results.appspot.com). Remaining parts are in the default Python module located at infra/appengine/test_results. Each handler will eventually be migrated from the Python application to Go.

For the list of paths handled by the Go module, see frontend/app.yaml and dispatch.yaml.

For more details, see the README at infra/appengine/test_results.

Prerequisites

apt-get install nodejs
apt-get install npm
npm install -g bower
npm install -g vulcanize

Google employees should follow instructions at http://go/nodejs to install NodeJS 4.x or later.

To set up the go environment, run:

eval `../../../../env.py`

Devserver

To run test-results locally:

make devserver

You can use the -F flag with curl to send multipart/form data. For example, to send request to test testfile/upload:

curl -v -F master='tryserver.chromium.mac' -F builder='linux_chromium_rel_ng' -F
file=@<local-path-to-test-results-file> -F testtype='browser_tests (with patch)'
http://localhost:8080/testfile/upload

Build

make build

This can be useful if you want to debug a vulcanized file containing combined and compressed source of all used components. This is actual code used in production. Note that this should not be used for normal development on a local devserver since changes to source code of the components will not be result in changes in the tested app. To go back to normal development, please run

make clean

Test

make test

Deploy

make [deploy_staging|deploy_prod]

Use the migrate traffic button on the appengine console to move traffic to the new service. Then monitor viceroy for 10-20 minutes.

How to upload test results to the Test Results Server

Why?

A few services use test results from test launchers running on Chromium Infrastructure to provide useful data for developers:

  • Flakiness Dashboard allows to have a quick look at recent test runs to help the pattern of failures and platforms which are affected.
  • Flakiness Surface, which is still in development, uses this data to show the tests that have highest flakiness and will in future provide detailed information about each specific test to help finding the root cause and fixing them.

How?

You can start uploading your test results in 3 steps:

  1. Read JSON Test Results Format spec.
  2. Modify source code of your test launcher to make a request to the https://test-results.appspot.com/testfile/upload after running the tests and collecting their results. The request should be multipart/form-data POST request and include the following parameters:
    • master, e.g. tryserver.chromium.linux (note the missing master. prefix),
    • builder, e.g. linux_chromium_rel_ng,
    • testtype, e.g. browser_tests (with patch), and
    • file, e.g. this file (but rename to remove the "_0" suffix).
  3. Deploy the changes to production and verify that your test results are shown in Flakiness Dashboard after selecting test type that matches your step name.

Recommended way to implement this is to use test_results.upload function in the recipe that is running your test, e.g. see example. However, if for some reasons you can not do that, you can also use this example in Python.

If something is unclear, please let us know at infra-dev+flakiness@chromium.org and we’ll use your feedback to improve this doc.

Directories

Path Synopsis
Program frontend implements the App Engine based HTTP server behind test-results.appspot.com.
Program frontend implements the App Engine based HTTP server behind test-results.appspot.com.
Package masters provides a list of known masters.
Package masters provides a list of known masters.
Package model provides types that represent Chromium test result files such as "results.json", "full_results.json", etc.
Package model provides types that represent Chromium test result files such as "results.json", "full_results.json", etc.
gen

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL