cem_spec_helper 0.4.1 → 0.5.0

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: bb296d4198901c45d59c2c9282e23ca226a07cf7266b8e480cd26ac1557141ea
4
- data.tar.gz: bebd2b2860f83aad3517f3aad9e59b97535e1efdec829cdda12ef14782197eb4
3
+ metadata.gz: 8c2d0ec6039af7d83108d5eb4d53a433aa813e21b55f75345db84b2fec8e222c
4
+ data.tar.gz: d6b38276b2225289a144c4da1ab926a81b786177189ccd8ff024dff8c282e3ef
5
5
  SHA512:
6
- metadata.gz: 6bd830713bbb81f414a8f6344884aa46e861b98d7ec9b511e7539aa6df3680f942d6221f0a62608528fb4f10672598973fdca9a4435d41581a3d3d6387d5b73a
7
- data.tar.gz: 465cdbd26ef1f669f171f30a7b659b33daccba70fa50752056059213f5a856bf28ea4757032dbe66eb421e0d5f2e6f4721a5f1b46d0132b4725ef2d3baef6a40
6
+ metadata.gz: 8e3e8dac03c30260e976399c23775e396d602bbda0e5ada654e952b6914e7582da8f38ea72c0a195f05bb8d166221628b586bea3b54163d7dcd7dc055c5eed1c
7
+ data.tar.gz: 6d52525a4674577e28d9a068cca9ef29c14e841b8e4fc66f5e552acb7c504c55fc4be290c42a909098a634f41bd536bc9dad51bcd7335cb04ba3c92e6a15023d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.5.0]
4
+
5
+ - Expand `REDHAT_MAJVER` and `ORACLE_MAJVER` to include 9 and 10.
6
+ - Expand `ALMA_MAJVER` to include 9 and 10.
7
+ - Add Rocky Linux resource data support: `ROCKY_ROOT_DIR`, `ROCKY_MAJVER = [8, 9, 10]`, and `rocky_resource_data` shortcut helper. `find_resource_data` now dispatches `'Rocky'`.
8
+
3
9
  ## [0.1.0] - 2023-09-20
4
10
 
5
11
  - Initial release
@@ -11,7 +11,7 @@ module CemSpecHelper
11
11
  # The root directory for RedHat resource data fixtures
12
12
  REDHAT_ROOT_DIR = File.join(REDHAT_FAMILY_ROOT, 'RedHat')
13
13
  # The major versions of RedHat resource data fixtures
14
- REDHAT_MAJVER = [7, 8].freeze
14
+ REDHAT_MAJVER = [7, 8, 9, 10].freeze
15
15
  # The root directory for CentOS resource data fixtures
16
16
  CENTOS_ROOT_DIR = File.join(REDHAT_FAMILY_ROOT, 'CentOS')
17
17
  # The major versions of CentOS resource data fixtures
@@ -19,11 +19,15 @@ module CemSpecHelper
19
19
  # The root directory for OracleLinux resource data fixtures
20
20
  ORACLE_ROOT_DIR = File.join(REDHAT_FAMILY_ROOT, 'OracleLinux')
21
21
  # The major versions of OracleLinux resource data fixtures
22
- ORACLE_MAJVER = [7, 8].freeze
22
+ ORACLE_MAJVER = [7, 8, 9, 10].freeze
23
23
  # The root directory for AlmaLinux resource data fixtures
24
24
  ALMA_ROOT_DIR = File.join(REDHAT_FAMILY_ROOT, 'AlmaLinux')
25
25
  # The major versions of AlmaLinux resource data fixtures
26
- ALMA_MAJVER = [8].freeze
26
+ ALMA_MAJVER = [8, 9, 10].freeze
27
+ # The root directory for Rocky resource data fixtures
28
+ ROCKY_ROOT_DIR = File.join(REDHAT_FAMILY_ROOT, 'Rocky')
29
+ # The major versions of Rocky resource data fixtures
30
+ ROCKY_MAJVER = [8, 9, 10].freeze
27
31
  # The root directory for Windows resource data fixtures
28
32
  WINDOWS_ROOT_DIR = File.join(DATA_ROOT, 'windows', 'windows')
29
33
  # The major versions of Windows resource data fixtures
@@ -52,6 +56,8 @@ module CemSpecHelper
52
56
  oracle_resource_data(majver, as_objects: as_objects)
53
57
  when 'AlmaLinux'
54
58
  alma_resource_data(majver, as_objects: as_objects)
59
+ when 'Rocky'
60
+ rocky_resource_data(majver, as_objects: as_objects)
55
61
  when /^[Ww]indows$/
56
62
  windows_resource_data(majver, as_objects: as_objects)
57
63
  when /^[Ss]ynthetic/
@@ -100,6 +106,15 @@ module CemSpecHelper
100
106
  load_resource_data(ALMA_ROOT_DIR, majver, as_objects: as_objects)
101
107
  end
102
108
 
109
+ # @param (see #redhat_resource_data)
110
+ # @return (see #redhat_resource_data)
111
+ # @raise (see #redhat_resource_data)
112
+ def rocky_resource_data(majver = nil, as_objects: false)
113
+ raise ArgumentError, "major version #{majver} not found" unless majver.nil? || ROCKY_MAJVER.include?(majver.to_i)
114
+
115
+ load_resource_data(ROCKY_ROOT_DIR, majver, as_objects: as_objects)
116
+ end
117
+
103
118
  # @param (see #redhat_resource_data)
104
119
  # @return (see #redhat_resource_data)
105
120
  # @raise (see #redhat_resource_data)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CemSpecHelper
4
- VERSION = '0.4.1'
4
+ VERSION = '0.5.0'
5
5
  end
@@ -0,0 +1,69 @@
1
+ # CEM-6758 — Expand `cem_spec_helper` resource data helpers for v9, v10, and Rocky Linux
2
+
3
+ ## Background
4
+
5
+ `cem_spec_helper` v0.4.1 hard-codes the major versions each RedHat-family OS helper accepts:
6
+
7
+ - `REDHAT_MAJVER = [7, 8]`
8
+ - `ALMA_MAJVER = [8]`
9
+ - `ORACLE_MAJVER = [7, 8]`
10
+ - No `Rocky` helper at all
11
+
12
+ CEM-6756 added v10 clone resource data files to `sce_linux`, but `spec/data_tests/resource_data_spec.rb` in that repo cannot use the OS shortcut helpers (`alma_resource_data`, `oracle_resource_data`, future `rocky_resource_data`) for v10 — every shortcut raises `ArgumentError "major version 10 not found"`. Adding v9/v10 contexts (and any Rocky context) in the consumer is blocked on this gem.
13
+
14
+ ## Current state
15
+
16
+ `lib/cem_spec_helper/resource_data_spec.rb`:
17
+
18
+ - Version constants and `*_ROOT_DIR` constants live at the top of the module (lines 9–30).
19
+ - `find_resource_data` dispatches by OS name (lines 45–62).
20
+ - Each per-OS shortcut helper validates `majver` against its `*_MAJVER` constant and calls `load_resource_data` (lines 70–110).
21
+ - There is no Rocky branch in `find_resource_data` and no `ROCKY_*` constants or helper.
22
+
23
+ `lib/cem_spec_helper/version.rb` currently declares `0.4.1`.
24
+
25
+ ## Change
26
+
27
+ ### `lib/cem_spec_helper/resource_data_spec.rb`
28
+
29
+ 1. Expand version constants:
30
+ - `REDHAT_MAJVER = [7, 8, 9, 10].freeze`
31
+ - `ORACLE_MAJVER = [7, 8, 9, 10].freeze`
32
+ - `ALMA_MAJVER = [8, 9, 10].freeze`
33
+ 2. Add Rocky support alongside the other RedHat-family entries:
34
+ - `ROCKY_ROOT_DIR = File.join(REDHAT_FAMILY_ROOT, 'Rocky')`
35
+ - `ROCKY_MAJVER = [8, 9, 10].freeze`
36
+ - `rocky_resource_data(majver = nil, as_objects: false)` shortcut mirroring `alma_resource_data`.
37
+ 3. Add a `when 'Rocky'` branch to `find_resource_data` that calls `rocky_resource_data`.
38
+
39
+ `CENTOS_MAJVER` is intentionally not touched (see Non-goals).
40
+
41
+ ### `lib/cem_spec_helper/version.rb`
42
+
43
+ Bump `VERSION` from `0.4.1` to `0.5.0` (new public helper method = minor bump).
44
+
45
+ ### `CHANGELOG.md`
46
+
47
+ Add a `0.5.0` entry summarizing the expanded MAJVERs and the new Rocky helper.
48
+
49
+ ## Non-goals
50
+
51
+ - No change to `CENTOS_MAJVER`. CentOS is not in the ticket scope and CentOS 8 is EOL.
52
+ - No change to `MappingDataSpec`, `GeneralSpec`, or any control-ID classification logic.
53
+ - No new unit-test coverage in this gem's own `spec/`. The gem's spec suite is a stub; real coverage lives in consuming modules' data tests.
54
+ - No `Gemfile.lock` bump in `sce_linux` and no new `resource_data_spec.rb` contexts there — those land in a follow-up PR against `sce_linux` once `0.5.0` is published.
55
+ - Publishing the gem to RubyGems is a manual post-merge step, not part of this PR.
56
+
57
+ ## Acceptance criteria
58
+
59
+ - [ ] `REDHAT_MAJVER`, `ORACLE_MAJVER`, `ALMA_MAJVER` expanded as described.
60
+ - [ ] `ROCKY_ROOT_DIR`, `ROCKY_MAJVER`, `rocky_resource_data` added.
61
+ - [ ] `find_resource_data` dispatches `'Rocky'` to `rocky_resource_data`.
62
+ - [ ] `CENTOS_MAJVER` unchanged.
63
+ - [ ] `VERSION` bumped to `0.5.0`; `CHANGELOG.md` updated.
64
+ - [ ] `bundle exec rake spec` passes in this repo.
65
+
66
+ ## Follow-ups (separate tickets/PRs)
67
+
68
+ - Publish `cem_spec_helper` 0.5.0 to RubyGems.
69
+ - Bump `cem_spec_helper` in `puppetlabs-sce_linux` `Gemfile`/`Gemfile.lock` and add v10 + Rocky contexts in `spec/data_tests/resource_data_spec.rb`.
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cem_spec_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - abide-team
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-09-05 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: Provides helper methods, classes, modules, etc. for RSpec testing the
14
13
  CEM modules
@@ -28,6 +27,7 @@ files:
28
27
  - lib/cem_spec_helper/resource_data_spec.rb
29
28
  - lib/cem_spec_helper/version.rb
30
29
  - sig/cem_spec_helper.rbs
30
+ - specifications/CEM-6758.md
31
31
  homepage: https://github.com/puppetlabs/cem_spec_helper
32
32
  licenses:
33
33
  - MIT
@@ -35,7 +35,6 @@ metadata:
35
35
  homepage_uri: https://github.com/puppetlabs/cem_spec_helper
36
36
  source_code_uri: https://github.com/puppetlabs/cem_spec_helper
37
37
  changelog_uri: https://github.com/puppetlabs/cem_spec_helper
38
- post_install_message:
39
38
  rdoc_options: []
40
39
  require_paths:
41
40
  - lib
@@ -50,8 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
49
  - !ruby/object:Gem::Version
51
50
  version: '0'
52
51
  requirements: []
53
- rubygems_version: 3.5.18
54
- signing_key:
52
+ rubygems_version: 3.6.9
55
53
  specification_version: 4
56
54
  summary: Spec helper for testing the CEM modules
57
55
  test_files: []