cem_win_spec 0.1.4 → 0.1.5

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: b8483cd4acfa3729cf4bd453fe3ef09a67c71ddd3dcee46f5dc3986e755ddf07
4
- data.tar.gz: a4ef098f7125bf68579dd1b5902d5cb553ccfcbef355d8bd0e4f1d8900eae395
3
+ metadata.gz: 155b49bb4366a1b2fca4237d9da909e05093d907a5e7ff326f4d7a9c4e75f375
4
+ data.tar.gz: f374c915ab3afcf1636315c02b869fdd4690291070f8429418108d292a922cce
5
5
  SHA512:
6
- metadata.gz: 8a1a521b044cc4c14a26efd6b8936f662dc1d2b173918337e49b591fe1178f6357aff317cd7dab4ae167688eea2304b75dc89fde8273bb8e7dcc3d22b8df8d33
7
- data.tar.gz: a31a1631d32ca72d34f276920de7a9f22f34175afac7306e64f7158ec309cc66ce0e80aab6b3ac430627f170291b9e442fd7516a7231b242c059a39836f5e3e1
6
+ metadata.gz: 5709e80190d88d38826deae83c379a948d5e7de72202891db48b00521801ef56e9718a64c681b17ccc7eb82a275af72c955737fef9ee2ab62a8c1fbdccb0aa51
7
+ data.tar.gz: 3ec1282194e8a3afe8df90e3e13e7bd80428bf9d2a70f7d7b8fe6aea0437460bc3b35e8f7e19e8d3a55ded60076b489b078ba80b551b25aa917ccb9cdc0526d0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cem_win_spec (0.1.4)
4
+ cem_win_spec (0.1.5)
5
5
  parallel_tests (~> 3.4)
6
6
  puppet_forge (~> 4.1)
7
7
  winrm (~> 2.3)
@@ -15,7 +15,7 @@ GEM
15
15
  coderay (1.1.3)
16
16
  diff-lcs (1.5.0)
17
17
  erubi (1.12.0)
18
- faraday (2.7.5)
18
+ faraday (2.7.10)
19
19
  faraday-net_http (>= 2.0, < 3.1)
20
20
  ruby2_keywords (>= 0.0.4)
21
21
  faraday-follow_redirects (0.3.0)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CemWinSpec
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
data/lib/cem_win_spec.rb CHANGED
@@ -56,12 +56,34 @@ module CemWinSpec
56
56
  raise ArgumentError, "Unknown operation: #{operation}"
57
57
  end
58
58
  rescue StandardError => e
59
- logger.fatal "Error: #{e.message}"
60
- logger.debug e.backtrace.join("\n")
61
- exit 1
59
+ if operation == :spec
60
+ begin
61
+ logger.warn "Error running spec: #{e.message}"
62
+ logger.debug e.backtrace.join("\n")
63
+ retry_spec_on_error(runner, module_dir, **options)
64
+ rescue StandardError => err
65
+ handle_run_error(err)
66
+ end
67
+ else
68
+ handle_run_error(e)
69
+ end
62
70
  end
63
71
  end
64
72
 
73
+ def self.handle_run_error(err)
74
+ logger.fatal "Error: #{err.message}"
75
+ logger.debug err.backtrace.join("\n")
76
+ exit 1
77
+ end
78
+
79
+ def self.retry_spec_on_error(runner, module_dir, **options)
80
+ logger.info 'Cleaning cache and trying again...'
81
+ clean_fixture_cache_out = clean_fixture_cache(runner, module_dir, **options)
82
+ check_output!(clean_fixture_cache_out, runner)
83
+ spec_out = run_spec(runner, module_dir, **options)
84
+ check_output!(spec_out, runner)
85
+ end
86
+
65
87
  def self.setup_remote_environment(runner)
66
88
  runner.enable_long_paths.run
67
89
  runner.enable_symlinks.run
@@ -99,8 +121,7 @@ module CemWinSpec
99
121
  def self.check_output!(output, runner = nil)
100
122
  unless output.success?
101
123
  runner&.iap_tunnel&.stop(wait: false, log: false)
102
- logger.fatal "Command failed with exit code #{output.exitcode}"
103
- exit output.exitcode
124
+ raise "Command failed with exit code #{output.exitcode}"
104
125
  end
105
126
  end
106
127
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cem_win_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heston Snodgrass
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-31 00:00:00.000000000 Z
11
+ date: 2023-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: winrm
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []
142
- rubygems_version: 3.4.10
142
+ rubygems_version: 3.4.18
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: Write a short summary, because RubyGems requires one.