cephei8's site

Introducing Greener: store/view test results

Background

Test frameworks usually produce custom test output by default (along with exit code).
For example, pytest (test framework for Python) gives something like this:

tests/test_apikey_controller.py::test_create[db_sqlite] PASSED        [ 25%]
tests/test_apikey_controller.py::test_get[db_sqlite] PASSED           [ 50%]
tests/test_apikey_controller.py::test_list[db_sqlite] PASSED          [ 75%]
tests/test_apikey_controller.py::test_delete[db_sqlite] PASSED        [100%]

This is fine if a number of tests is small, or we mostly care about overall test result - if all the tests in the test session passed.

However, once we need to investigate test failure, especially for larger/longer test sessions (e.g. end-to-end tests), often the following questions need answers:

It may be hard or not possible to answer these questions without additional infrastructure/tools.
Normally, the following comes to help:

The problem is that these additional infrastructure/tools require implementation, setup and maintenance, and that takes resources/focus from doing work that brings the actual value (like building a product).

Introducing Greener

Greener is a platform for storing and viewing test results.

It strives to:

Motivational examples

Track a subset of tests

You can prepare a query to select a certain subset of tests and group the results by session.
In this case you will be able to see how this specific subset of tests behaved over time.
Additionally, group by label e.g. “target” label in case cross-platform builds.

Match application logs to test results

This example requires code changes, but it is can be powerful for end-to-end tests.
The idea is to create OpenTelemetry trace context, and both store it in test case metadata and pass with requests to your API.
It will allow finding traces for specific test cases and finding a test case for specific trace.

Feedback and contact information

Let me know your thoughts at Greener GitHub Discussions.