newrelic / newrelic-airflow-plugin

Send airflow metrics to New Relic!
Apache License 2.0
25 stars 19 forks source link

Verify correctness of generated metrics. #1

Closed BrandonTheBuilder closed 2 years ago

BrandonTheBuilder commented 5 years ago

Summary In order to fully test this plugin we need to validate the metrics that are generated. The use of subprocesses and multiprocessing introduces unique challenges that must be addressed.

Success Criteria

Notes Azure pipelines allows configuring docker services MockServer provides functionality to set up endpoints which are expected to be hit and to check and validate all requests that it receives. The goal is to have mock server intercept all calls to new relic's metric API.

Proposed Implementation

  1. Update the plugin to be able to run a development mode, taking a configurable url and overriding the HTTPSConnectionPool to ignore ssl certificates or using HTTPConnectionPool.
  2. Add a MockServer service to azure pipelines
  3. Implement a pytest fixture to control lifecycle of expectations in MockServer
  4. Add a helper function to query MockServer for metrics / yield a list of metrics from the pytest fixture described in the previous step
  5. Implement a basic test exercising an airflow task flow