Skip to content

Latest commit

 

History

History
 
 

e2e

Grafonnet End to End Testing

Grafonnet uses Cypress.

Purpose

These tests attempt to assert truth to the following:

  • Does this library generate valid dashboard JSON?
  • Are dashboard elements displayed as expected?
  • Do elements get configured as intended?
  • Do the configured elements do what they're expected to do?

Some of this is automated here. However, the visual aspects are difficult for machines to cover. Even some behavioral aspects are as well because they incur an impractical amount of complexity, time, or cost. For those aspects, these tests provide a way to quickly generate dashboards consistently so we can use our human abilities to assert truth.

Usage

docker-compose is used to run Cypress and Grafana. There are two targets in Makefile to help run it.

make e2e: runs tests headless and exits.

make e2e-dev: opens the the test runner and exposes Grafana to the host machine - http://localhost:3030. This requires an X11 server to work. This post describes how to set this up with XQuartz.

Notes

Tests depend on compiled artifacts in tests for generating dashboards.