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

Additional tests for queueing of collection of historical metrics #14723

Merged
merged 1 commit into from
Apr 11, 2017

Conversation

gtanzillo
Copy link
Member

This is a followup to #14695.

This adds verification that calling perf_capture_queue("historical") will create the correct number of queue messages and will not queue additional messages when called multiple times.

@miq-bot
Copy link
Member

miq-bot commented Apr 11, 2017

Checked commit gtanzillo@e95be2e with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 5 offenses detected

spec/models/metric/ci_mixin/capture_spec.rb

  • ❗ - Line 115, Col 29 - Rails/TimeZone - Do not use Time.now without zone. Use one of Time.zone.now, Time.current, Time.now.in_time_zone, Time.now.utc, Time.now.getlocal, Time.now.iso8601, Time.now.jisx0301, Time.now.rfc3339, Time.now.to_i, Time.now.to_f instead.
  • ❗ - Line 136, Col 29 - Rails/TimeZone - Do not use Time.now without zone. Use one of Time.zone.now, Time.current, Time.now.in_time_zone, Time.now.utc, Time.now.getlocal, Time.now.iso8601, Time.now.jisx0301, Time.now.rfc3339, Time.now.to_i, Time.now.to_f instead.
  • ❗ - Line 150, Col 29 - Rails/TimeZone - Do not use Time.now without zone. Use one of Time.zone.now, Time.current, Time.now.in_time_zone, Time.now.utc, Time.now.getlocal, Time.now.iso8601, Time.now.jisx0301, Time.now.rfc3339, Time.now.to_i, Time.now.to_f instead.
  • ❗ - Line 165, Col 29 - Rails/TimeZone - Do not use Time.now without zone. Use one of Time.zone.now, Time.current, Time.now.in_time_zone, Time.now.utc, Time.now.getlocal, Time.now.iso8601, Time.now.jisx0301, Time.now.rfc3339, Time.now.to_i, Time.now.to_f instead.
  • ❗ - Line 89, Col 29 - Rails/TimeZone - Do not use Time.now without zone. Use one of Time.zone.now, Time.current, Time.now.in_time_zone, Time.now.utc, Time.now.getlocal, Time.now.iso8601, Time.now.jisx0301, Time.now.rfc3339, Time.now.to_i, Time.now.to_f instead.

@@ -86,6 +86,8 @@ def verify_perf_capture_queue(last_perf_capture_on, total_queue_items)
Timecop.freeze do
Timecop.travel(Time.now.end_of_day - 6.hours)
verify_perf_capture_queue(nil, 1)
Timecop.travel(Time.now + 20.minutes)
verify_perf_capture_queue(nil, 1)
Copy link
Member Author

Choose a reason for hiding this comment

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

I added this so that it tests that no additional messages are added to the queue calling realtime a second time when last_perf_capture_on ids nil.

@Fryguy Fryguy merged commit 6db53a9 into ManageIQ:master Apr 11, 2017
@Fryguy Fryguy added this to the Sprint 59 Ending Apr 24, 2017 milestone Apr 11, 2017
@Fryguy Fryguy self-assigned this Apr 11, 2017
simaishi pushed a commit that referenced this pull request Apr 13, 2017
Additional tests for queueing of collection of historical metrics
(cherry picked from commit 6db53a9)
@simaishi
Copy link
Contributor

Fine backport details:

$ git log -1
commit ed6d2272748403cf00174c77b66d123203a7302a
Author: Jason Frey <fryguy9@gmail.com>
Date:   Tue Apr 11 13:17:02 2017 -0400

    Merge pull request #14723 from gtanzillo/fix-perf-capture_queue-tests
    
    Additional tests for queueing of collection of historical metrics
    (cherry picked from commit 6db53a9bed2c50ce1a602e75e6d6b7cb3f07459c)

simaishi pushed a commit that referenced this pull request Apr 17, 2017
Additional tests for queueing of collection of historical metrics
(cherry picked from commit 6db53a9)
@simaishi
Copy link
Contributor

Euwe backport details:

$ git log -1
commit eb80e79edb04b6d0ee4922986c62d90977adbca9
Author: Jason Frey <fryguy9@gmail.com>
Date:   Tue Apr 11 13:17:02 2017 -0400

    Merge pull request #14723 from gtanzillo/fix-perf-capture_queue-tests
    
    Additional tests for queueing of collection of historical metrics
    (cherry picked from commit 6db53a9bed2c50ce1a602e75e6d6b7cb3f07459c)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants