allure-ruby-commons 2.21.1 → 2.21.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f5c3dfee7eb45d47e68dd2b3e6cea65eee99c6a65d5f26155ef63f047b2e8a6
4
- data.tar.gz: 364026c97cd8be435807e5aff89a525015b79db8817b01ec7b847cdf942dca6b
3
+ metadata.gz: bd98c6464edda2d8f2095866f00cb567c6f3daeb4d591a4e742fbf814b365ded
4
+ data.tar.gz: 0f01fffeda2b9957de193a23070864070cc7ee7adddcbdcfbd8d238db1739567
5
5
  SHA512:
6
- metadata.gz: b8d8a79fe660235dba902c1f0d1a86c799848944a645f52e2548b24fbc3e68f9c6b11ee64e57007370efde535d90580a3626cd5576179baa696147eaf1ea2e59
7
- data.tar.gz: bcfa0e762321315471a07bca0925ebfde15606875036b4a1fb0e30e1eba99725c32fa7bb69cfece308ce2f5ff299b09f1008639624d2cd6cc901e85a47f88692
6
+ metadata.gz: 157cee12a334d96847540fc49096d2d34f2f41e64a38e285f43fee9beb8751a0c7f751d5b13ec99ae02e9dffa4edf68c40af9877fc177ac105d89a050b633c87
7
+ data.tar.gz: 372b8b2cade3f8d461b989087c56fea808e049d272f007aacea695b5e8319b3e0c128170c1dd2d27b3866697e3a1a67387f0b5a7d84f3b3751a99ec914fd7d66
@@ -28,6 +28,7 @@ module Allure
28
28
  define_method(:load_json) do |json|
29
29
  Oj.load_file(json, symbol_keys: true)
30
30
  rescue Oj::ParseError
31
+ Allure.configuration.logger.error("Failed to parse json: #{json}")
31
32
  nil
32
33
  end
33
34
  rescue LoadError
@@ -40,6 +41,7 @@ module Allure
40
41
  define_method(:load_json) do |json|
41
42
  JSON.parse(File.read(json), symbolize_names: true)
42
43
  rescue JSON::ParserError
44
+ Allure.configuration.logger.error("Failed to parse json: #{json}")
43
45
  nil
44
46
  end
45
47
  end
@@ -28,7 +28,25 @@ module Allure
28
28
  #
29
29
  # @return [Array<Hash>]
30
30
  def tests
31
- @tests ||= load_json(ENV[TESTPLAN_PATH])&.fetch(:tests) if ENV[TESTPLAN_PATH]
31
+ @tests ||= load_json(test_plan_path)&.fetch(:tests) if test_plan_path
32
+ end
33
+
34
+ # Fetch test plan path
35
+ #
36
+ # @return [<String, nil>]
37
+ def test_plan_path
38
+ return @test_plan_path if defined?(@test_plan_path)
39
+
40
+ @test_plan_path = ENV[TESTPLAN_PATH].then do |path|
41
+ next unless path
42
+ next path if File.file?(path)
43
+
44
+ json = File.join(path, "testplan.json")
45
+ next json if File.exist?(json)
46
+
47
+ Allure.configuration.logger.warn("'ALLURE_TESTPLAN_PATH' env var is set, but no testplan.json found!")
48
+ nil
49
+ end
32
50
  end
33
51
  end
34
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allure-ruby-commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.21.1
4
+ version: 2.21.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrejs Cunskis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-29 00:00:00.000000000 Z
11
+ date: 2023-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types