Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quiet prometheus end to end tests #4205

Merged
merged 1 commit into from
Oct 14, 2022
Merged

Conversation

jaydoane
Copy link
Contributor

@jaydoane jaydoane commented Oct 12, 2022

Overview

Currently, applications are restarted during individual tests, resulting in noisy output:

module 'couch_prometheus_e2e_tests'
  Prometheus E2E Tests
    couch_prometheus_e2e_tests:66: node_call_chttpd...ok
Application config was left running!
Application asn1 was left running!
Application b64url was left running!
Application public_key was left running!
Application ssl was left running!
Application couch_dist was left running!
Application couch_epi was left running!
Application khash was left running!
Application couch_event was left running!
Application folsom was left running!
Application couch_stats was left running!
Application hyper was left running!
Application ibrowse was left running!
Application inets was left running!
Application hqueue was left running!
Application compiler was left running!
Application syntax_tools was left running!
Application xmerl was left running!
Application mochiweb was left running!
Application sasl was left running!
Application ets_lru was left running!
Application rexi was left running!
Application fabric was left running!
    couch_prometheus_e2e_tests:98: node_call_prometheus_http...ok
Application config was left running!
Application asn1 was left running!
Application b64url was left running!
Application public_key was left running!
Application ssl was left running!
Application couch_dist was left running!
Application couch_epi was left running!
Application khash was left running!
Application couch_event was left running!
Application folsom was left running!
Application couch_stats was left running!
Application hyper was left running!
Application ibrowse was left running!
Application inets was left running!
Application hqueue was left running!
Application compiler was left running!
Application syntax_tools was left running!
Application xmerl was left running!
Application mochiweb was left running!
Application sasl was left running!
Application ets_lru was left running!
Application rexi was left running!
Application fabric was left running!
    couch_prometheus_e2e_tests:109: deny_prometheus_http...ok
    couch_prometheus_e2e_tests:82: node_see_updated_metrics...ok
    [done in 6.595 s]
  [done in 8.739 s]

To reduce the noise, this factors the current test generator into two:
one where a separate prometheus HTTP server is started on a dedicated
port, and one where it is not.

Additionally, tests have been changed to use the TDEF_FE macro,
cleaned up, and renamed to make them easier to understand.

Finally, this simplifies the test for observing metric updates by
picking a metric that increments automatically with the passage of
time.

Testing recommendations

make eunit apps=couch_prometheus suites=couch_prometheus_e2e_tests

Should have a lot less log spam now.

Related Issues or Pull Requests

Checklist

  • Code is written and works correctly
  • Changes are covered by tests
  • Any new configurable parameters are documented in rel/overlay/etc/default.ini
  • Documentation changes were made in the src/docs folder

@jaydoane jaydoane force-pushed the quiet-prometheus-e2e-tests branch 2 times, most recently from 536bb9d to d21bac8 Compare October 13, 2022 21:19
Currently, applications are restarted during individual tests,
resulting in noisy output:

module 'couch_prometheus_e2e_tests'
  Prometheus E2E Tests
    couch_prometheus_e2e_tests:66: node_call_chttpd...ok
Application config was left running!
Application asn1 was left running!
Application b64url was left running!
Application public_key was left running!
Application ssl was left running!
Application couch_dist was left running!
Application couch_epi was left running!
Application khash was left running!
Application couch_event was left running!
Application folsom was left running!
Application couch_stats was left running!
Application hyper was left running!
Application ibrowse was left running!
Application inets was left running!
Application hqueue was left running!
Application compiler was left running!
Application syntax_tools was left running!
Application xmerl was left running!
Application mochiweb was left running!
Application sasl was left running!
Application ets_lru was left running!
Application rexi was left running!
Application fabric was left running!
    couch_prometheus_e2e_tests:98: node_call_prometheus_http...ok
Application config was left running!
Application asn1 was left running!
Application b64url was left running!
Application public_key was left running!
Application ssl was left running!
Application couch_dist was left running!
Application couch_epi was left running!
Application khash was left running!
Application couch_event was left running!
Application folsom was left running!
Application couch_stats was left running!
Application hyper was left running!
Application ibrowse was left running!
Application inets was left running!
Application hqueue was left running!
Application compiler was left running!
Application syntax_tools was left running!
Application xmerl was left running!
Application mochiweb was left running!
Application sasl was left running!
Application ets_lru was left running!
Application rexi was left running!
Application fabric was left running!
    couch_prometheus_e2e_tests:109: deny_prometheus_http...ok
    couch_prometheus_e2e_tests:82: node_see_updated_metrics...ok
    [done in 6.595 s]
  [done in 8.739 s]

To reduce the noise, this factors the current test generator into two:
one where a separate prometheus HTTP server is started on a dedicated
port, and one where it is not.

Additionally, tests have been changed to use the TDEF_FE macro,
cleaned up, and renamed to make them easier to understand.

Finally, this simplifies the test for observing metric updates by
picking a metric that increments automatically with the passage of
time.
@jaydoane jaydoane marked this pull request as ready for review October 14, 2022 02:08
Copy link
Contributor

@nickva nickva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

It looks much better. Well done!

======================== EUnit ========================
module 'couch_prometheus_util'
  module 'couch_prometheus_util_tests'
    couch_prometheus_util_tests:19: couch_prometheus_util_test_...[0.009 s] ok
    couch_prometheus_util_tests:23: couch_prometheus_util_test_...ok
    couch_prometheus_util_tests:27: couch_prometheus_util_test_...ok
    couch_prometheus_util_tests:31: couch_prometheus_util_test_...ok
    [done in 0.021 s]
  [done in 0.021 s]
module 'couch_prometheus_sup'
module 'couch_prometheus_app'
module 'couch_prometheus_server'
module 'couch_prometheus_http'
module 'couch_prometheus_e2e_tests'
  With dedicated port
    couch_prometheus_e2e_tests:40: e2e_test_ (t_chttpd_port)...[0.107 s] ok
    couch_prometheus_e2e_tests:41: e2e_test_ (t_prometheus_port)...[0.003 s] ok
    couch_prometheus_e2e_tests:42: e2e_test_ (t_metric_updated)...[4.894 s] ok    [done in 5.014 s]
  Without dedicated port
    couch_prometheus_e2e_tests:65: reject_test_ (t_reject_prometheus_port)...[0.001 s] ok
    [done in 0.004 s]
  [done in 6.427 s]
=======================================================
  All 8 tests passed.
Cover analysis: /Users/nvatama/asf-1/src/couch_prometheus/.eunit/index.html

Code Coverage:
couch_prometheus_app       : 100%
couch_prometheus_e2e_tests :  96%
couch_prometheus_http      :  56%
couch_prometheus_server    :  77%
couch_prometheus_sup       :  83%
couch_prometheus_util      :  47%

Total                      : 68%
==> rel (eunit)
==> asf-1 (eunit)

@jaydoane jaydoane merged commit bdf8acd into main Oct 14, 2022
@jaydoane jaydoane deleted the quiet-prometheus-e2e-tests branch October 14, 2022 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants