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

Populate timestamp of CustomButtonEvent. #17899

Merged
merged 1 commit into from
Aug 24, 2018

Conversation

lfu
Copy link
Member

@lfu lfu commented Aug 24, 2018

A timestamp without value would break MiqReport.

Followup of #17764.

https://bugzilla.redhat.com/show_bug.cgi?id=1511126

@miq-bot assign @gmcculloug
@miq-bot add_label automate, enhancement, events
cc @skateman

@@ -317,6 +317,7 @@
:event_type => 'button.trigger.start',
:user_id => user.id
)
expect(CustomButtonEvent.first.timestamp).not_to be_nil
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to use Timecop.freeze so we can validate this time instead of only checking that it is not nil.

@gmcculloug
Copy link
Member

Tests are failing because the time is losing some precision:

expected: 2018-08-24 13:28:43.030727136 +0000
     got: 2018-08-24 13:28:43.030727000 +0000

Looking over other specs for examples I see be_within(0.1).of being used:
https://github.com/ManageIQ/manageiq/blob/master/spec/models/drift_state/purging_spec.rb#L41

Or you can set the time like this example: Timecop.freeze(Time.utc(2015, 1, 2, 4, 30))
https://github.com/ManageIQ/manageiq/blob/master/spec/models/dialog_field_date_time_control_spec.rb#L120

@skateman
Copy link
Member

Thanks 🍻

@miq-bot
Copy link
Member

miq-bot commented Aug 24, 2018

Checked commit lfu@54c0388 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. ⭐

@gmcculloug gmcculloug merged commit 8cbdcbf into ManageIQ:master Aug 24, 2018
@gmcculloug gmcculloug added this to the Sprint 93 Ending Aug 27, 2018 milestone Aug 24, 2018
@lfu lfu deleted the ansible_reporting2 branch September 29, 2018 14:31
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