Commit graph

15 commits

Author SHA1 Message Date
Ryan Davis
a5309ea392 blindly applied chefstyle -a
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-06-11 18:52:03 -07:00
Ryan Davis
9c6965b2ed Minor require cleanup for telemetry.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-20 13:09:38 -07:00
Miah Johnson
1edfeae5f4
Merge pull request #4025 from inspec/mj/3849
Enable user telemetry opt-in / opt-out on cli
2019-05-08 12:56:29 -07:00
Miah Johnson
5a0913e3f6 Add missing tests for DataSeries#enabled? #disable
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-08 00:44:51 -07:00
Miah Johnson
d000f20f34 Update Collector#reset to clear telemetry_toggled_off
Updated the name of #reset -> #reset! as we are modifying state of a
singeton.

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-08 00:36:45 -07:00
Miah Johnson
871b0e9a38 Ensure telemetry can be disabled
The #disable_telemetry method now toggles @telemetry_toggle_off.
The @telemetry_toggle_off is defaulted to false

The #telemetry_enabled? method now checks @telemetry_toggle_off
and we generally check the configuration. We do not flip
@telemetry_toggle_off based on the content of the configuration.

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-08 00:30:24 -07:00
Miah Johnson
640d122327 Update Inspec::Config.mock in collector global methods
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-07 22:37:43 -07:00
Miah Johnson
0b9833dd96 condense true/false enabled tests
Because of the way the test system loads I cannot guarantee that
`Inspec::Config.cached` won't be nil. I have to always pass in a mock
config object with our setting.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-07 19:06:38 -07:00
Miah Johnson
b51ad8acb8 When telemetry is disabled Inspec.record_telemetry_data doesn't record
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-03 16:13:45 -07:00
Miah Johnson
ac2d782266 Pass in mock config object to tests and validate telemetry_enabled?
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-03 16:07:24 -07:00
Miah Johnson
5adf33469a improve testing for DataSeries#to_h and DataSeries#to_json
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-04-11 12:22:29 -07:00
Miah Johnson
55ea2d984c Not sure how to make this not dependant on list_data_series to prove its
functionality.

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-04-11 12:17:59 -07:00
Miah Johnson
3c6db15124 improve tests for Collector#list_data_series
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-04-11 11:47:42 -07:00
Miah Johnson
ac78feb090 Remove list_data_series_by_name.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-04-11 00:41:09 -07:00
Miah Johnson
56a5c80bf5 Rebuild the core telemetry interface.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-04-09 16:58:40 -07:00