-
Lin Jen-Shin authored
The same idea is used in !110018 We still use `Gitlab::RspecFlaky::Report.load(flaky_report_path).flaky_examples.to_h` because it does the following, which is more than just `JSON.parse`: * `JSON.parse` * Check if the parsed JSON is a `Hash`: `collection.is_a?(Hash)` and the values can also be converted to be a hash `example.to_h` * `Time.parse(attributes[attr]) if attributes[attr].is_a?(String)` where `attr` is `first_flaky_at` and `last_flaky_at`, and `attributes` is `example.to_h`
aa149a61Lin Jen-Shin authoredThe same idea is used in !110018 We still use `Gitlab::RspecFlaky::Report.load(flaky_report_path).flaky_examples.to_h` because it does the following, which is more than just `JSON.parse`: * `JSON.parse` * Check if the parsed JSON is a `Hash`: `collection.is_a?(Hash)` and the values can also be converted to be a hash `example.to_h` * `Time.parse(attributes[attr]) if attributes[attr].is_a?(String)` where `attr` is `first_flaky_at` and `last_flaky_at`, and `attributes` is `example.to_h`
Loading