cem_win_spec 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b5689dd8fae43d58612457473f06c19baa7e798443f6393c87dda2c84b1a2f4
4
- data.tar.gz: 1535bc2325b68cdb08475020b79e1d1d96df40803800e13c5b273cf6e63778f6
3
+ metadata.gz: f78e88ed46fc238a87bd3d95278fbf225c4c43001ee08cbeac1bde53bf4a621e
4
+ data.tar.gz: 4e73a78a8f24afd7c94e6cd6543444521228175277859aeead16903478141231
5
5
  SHA512:
6
- metadata.gz: d58a1f16b67591c42c7566cb102023ab07f5706d0638fc5b2d89cdc4bf1c4d89101779faec8dd864b220b2edd663bd1004e721d5f91db0616af98557ab962ff9
7
- data.tar.gz: cafa3f69e03a737e06f840afd92abe2cc8c95d7f83cb8bfa5c043b2656ab59bec868c84467c3da6ee060451bd0515cfe4fc57c8fb21a73c7c15807fb3edc690f
6
+ metadata.gz: acaa079a43a43cf2cc191cd892ab12dd9ce908bb216e8bd457eeb356d6f53652cd58554e2d069afee7a04f1dc3624dbc91482fd69f9c5733c885df10588a3398
7
+ data.tar.gz: 0315bcb4b2cb6bbbb63d122638fc693012c05b7a0b58a54a4e91d4aaf43d4562dced74e19f43409cf7e1888bd486e263c5f565d52869646ef612ef997bf388f3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cem_win_spec (0.1.9)
4
+ cem_win_spec (0.1.10)
5
5
  parallel_tests (~> 3.4)
6
6
  puppet_forge (~> 4.1)
7
7
  winrm (~> 2.3)
@@ -111,6 +111,7 @@ GEM
111
111
 
112
112
  PLATFORMS
113
113
  arm64-darwin-22
114
+ arm64-darwin-24
114
115
  x86_64-darwin-19
115
116
  x86_64-darwin-20
116
117
 
@@ -27,6 +27,7 @@ module CemWinSpec
27
27
 
28
28
  def initialize
29
29
  validate_platform!
30
+ configure_forge_authorization!
30
31
  @cache_dir = CACHE_DIR
31
32
  @cache_entries = setup_and_load_cache
32
33
  @entries_digest = hexdigest(@cache_entries.to_s)
@@ -73,6 +74,16 @@ module CemWinSpec
73
74
  raise FixtureCacheError, 'FixtureCache must run on Windows'
74
75
  end
75
76
 
77
+ # Premium/entitled Forge modules (e.g. puppetlabs-security_policy) 401 on
78
+ # PuppetForge::Module.find/Release.find/download without this - the gem
79
+ # makes anonymous requests by default. FORGE_API_KEY matches the env var
80
+ # puppetlabs_spec_helper's spec_prep already reads for the same purpose,
81
+ # so a single secret covers both.
82
+ def configure_forge_authorization!
83
+ token = ENV.fetch('FORGE_API_KEY', nil)
84
+ PuppetForge::Connection.authorization = token unless token.nil? || token.strip.empty?
85
+ end
86
+
76
87
  def hexdigest(str)
77
88
  Digest(:SHA256).hexdigest(str)
78
89
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CemWinSpec
4
- VERSION = "0.1.9"
4
+ VERSION = "0.1.10"
5
5
  end
@@ -49,6 +49,7 @@ module CemWinSpec
49
49
 
50
50
  value['PUPPET_GEM_VERSION'] = "~> #{puppet_version}" if puppet_version
51
51
  value['FACTER_GEM_VERSION'] = 'https://github.com/puppetlabs/facter#main' if puppet_version
52
+ value['FORGE_API_KEY'] = ENV['FORGE_API_KEY'] if ENV['FORGE_API_KEY']
52
53
  value.delete('password') if value.key?('password')
53
54
  @env_vars = value
54
55
  end
data/lib/cem_win_spec.rb CHANGED
@@ -148,7 +148,15 @@ module CemWinSpec
148
148
  reuse_tunnel: false,
149
149
  **opts).run
150
150
  end
151
- if output.stderr&.include?('Tests Failed')
151
+ # `output.stderr.include?('Tests Failed')` only catches the specific string
152
+ # parallel_tests prints when some rspec examples fail. It misses any other
153
+ # reason `bundle exec rake cem_win_spec:parallel_spec` can exit non-zero on
154
+ # the remote host - e.g. a `rake aborted!` crash during `cem_win_spec:prep`
155
+ # (fixture cache setup, Hiera data copy, etc.) before rspec ever runs, which
156
+ # never prints "Tests Failed" at all. `ignore_exitcode: true` on the .run
157
+ # call above only suppresses Exec#run's own internal raise; output.exitcode
158
+ # still holds the real remote exit code, so check it too.
159
+ if !output.success? || output.stderr&.include?('Tests Failed')
152
160
  logger.error 'Tests failed'
153
161
  self.exit_code = 1
154
162
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cem_win_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heston Snodgrass
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-03-31 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: winrm
@@ -124,7 +123,6 @@ metadata:
124
123
  homepage_uri: https://github.com/hsnodgrass/cem_win_spec
125
124
  source_code_uri: https://github.com/hsnodgrass/cem_win_spec
126
125
  changelog_uri: https://github.com/hsnodgrass/cem_win_spec/CHANGELOG.md
127
- post_install_message:
128
126
  rdoc_options: []
129
127
  require_paths:
130
128
  - lib
@@ -139,8 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
137
  - !ruby/object:Gem::Version
140
138
  version: '0'
141
139
  requirements: []
142
- rubygems_version: 3.5.18
143
- signing_key:
140
+ rubygems_version: 3.7.2
144
141
  specification_version: 4
145
142
  summary: Write a short summary, because RubyGems requires one.
146
143
  test_files: []