Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
84b7df6
Install gems without documentation group
mhashizume Dec 5, 2024
6887f4a
Use native Rake directory
mhashizume Dec 11, 2024
e183a51
(PE-40092) Use virt-what to populate cloud.provider fact on kvm, xen,…
AriaXLi Jan 28, 2025
335c407
(FACT-3488) Fix potential NoMethodError
joshcooper Jan 27, 2025
94c3eb2
(FACT-3488) Add more debugging to VirtualDetector
joshcooper Jan 30, 2025
f8d93f2
(FACT-3488) Check for /.dockerenv
joshcooper Jan 30, 2025
a006632
Fix rubocop 'Style/RedundantCondition' offenses
shubhamshinde360 Mar 4, 2025
cd6e193
Add rubocop-{factory_bot,capybara} as plugins
joshcooper Mar 21, 2025
9778992
(PA-7238) Fix os.release fact spec for windows 2025
skyamgarp Feb 28, 2025
25a4ba8
(maint) resolve rubocop failures
joshcooper Apr 24, 2025
106ebfa
(FACT-3495) Add missing chassis types
AriaXLi Apr 29, 2025
27d12ad
Run integration tests consistently
joshcooper May 1, 2025
4dc6fb8
Don't load spec/**/*.rb as custom facts (again)
joshcooper May 1, 2025
7a22f1b
Force networking fact values to UTF-8
joshcooper Apr 4, 2025
5e82c84
Force rubysitedir to UTF-8
joshcooper Apr 4, 2025
74a4419
Don't return binary string from custom fact
joshcooper Apr 4, 2025
ff435ed
Handle ENV variables on Windows Ruby < 3
joshcooper Apr 29, 2025
34a8782
Validate resolved facts
joshcooper May 1, 2025
160ecbd
Clear more global state
joshcooper May 2, 2025
6f12881
Force AIX networking facts to UTF-8
joshcooper May 2, 2025
705b4ac
Force Solaris networking facts to UTF-8
joshcooper May 5, 2025
555da78
(PA-7511) Fix test failures with os.description,processor.isa and net…
skyamgarp May 30, 2025
8917a46
Include the help header in the gem
joshcooper Jul 3, 2025
d0db933
Modify files in facter gem
joshcooper Jul 3, 2025
56f4841
(FACT-3497) Facter should not fail when binary data is detected
AriaXLi Jul 2, 2025
b601642
(FACT-3488) Ignore unknown container types
joshcooper Jan 27, 2025
e583ea2
Delete GH acceptance tests
joshcooper Apr 28, 2025
ac9c24b
Use ubuntu-latest
joshcooper Apr 24, 2025
fc561c9
(maint) Bump to windows-2022
joshcooper Jul 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 0 additions & 157 deletions .github/actions/presuite.rb

This file was deleted.

67 changes: 0 additions & 67 deletions .github/workflows/acceptance_tests.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
rubocop_checks:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
name: RuboCop
steps:
- name: Checkout current PR
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- {os: ubuntu-22.04, ruby: '3.2'} # with openssl 3
- {os: ubuntu-22.04, ruby: 'jruby-9.3.14.0'}
- {os: ubuntu-latest, ruby: 'jruby-9.4.8.0'}
- {os: windows-2019, ruby: '2.7'}
- {os: windows-2019, ruby: '3.2'} # with openssl 3
- {os: windows-2022, ruby: '2.7'}
- {os: windows-2022, ruby: '3.2'} # with openssl 3
runs-on: ${{ matrix.cfg.os }}
env:
BUNDLE_SET: 'with integration'
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ jobs:
- '3.2'
- 'jruby-9.3.14.0'
- 'jruby-9.4.8.0'
runs-on: ubuntu-20.04
# 24.04 doesn't support older jruby versions, so use 22.04 as middle ground
# When we drop testing against puppet7, then we can use newer ubuntu.
runs-on: ubuntu-22.04
steps:
- name: Checkout current PR
uses: actions/checkout@v4
Expand All @@ -43,7 +45,7 @@ jobs:
ruby:
- '2.7'
- '3.2'
runs-on: windows-2019
runs-on: windows-2022
steps:
- name: Checkout current PR
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ build-iPhoneSimulator/
.rvmrc

.rspec_status
.rspec_integration_status
Gemfile.lock
Gemfile.local
acceptance/vendor
Expand Down
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ require:
- rubocop-performance
- rubocop-rspec

plugins:
- rubocop-factory_bot
- rubocop-capybara

Layout/LineLength:
Enabled: false

Expand Down Expand Up @@ -43,6 +47,7 @@ Naming/MethodName:
Exclude:
- 'spec/mocks/win32ole.rb'
- 'spec/mocks/ffi.rb'
- 'spec/facter/util/windows/network_utils_spec.rb'

Naming/PredicateName:
Exclude:
Expand Down
2 changes: 0 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ require 'open3'
require 'rspec/core/rake_task'
require 'facter/version'

Dir.glob(File.join('tasks/**/*.rake')).each { |file| load file }

task default: :spec

desc 'Generate changelog'
Expand Down
12 changes: 10 additions & 2 deletions acceptance/lib/facter/acceptance/base_fact_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def debian_expected_facts(agent)

# el (RedHat, Centos)
def el_expected_facts(agent)
version = agent['platform'].match(/(el|centos)-(\d)/)
version = agent['platform'].match(/(el|centos)-(\d+)/)
os_version = if version.nil?
/\d+/
else
Expand All @@ -143,6 +143,11 @@ def el_expected_facts(agent)
os_distro_description = /Rocky Linux release #{os_version}\.\d+ \(.+\)/
os_distro_id = 'Rocky'
os_distro_release_full = /#{os_version}\.\d+/
when /rhel/
os_name = 'RedHat'
os_distro_description = /Red Hat Enterprise Linux( Server)? release #{os_version}\.\d+( Beta)? \(\w+\)/
os_distro_id = /^RedHatEnterprise(Server)?$/
os_distro_release_full = /#{os_version}\.\d+/
when /centos/
os_name = 'CentOS'
os_distro_description = /CentOS( Linux)? release #{os_version}\.\d+(\.\d+)? \(\w+\)/
Expand All @@ -154,6 +159,7 @@ def el_expected_facts(agent)
os_distro_id = /^RedHatEnterprise(Server)?$/
os_distro_release_full = /#{os_version}\.\d+/
end

if agent['platform'] =~ /x86_64/
os_arch = 'x86_64'
os_hardware = 'x86_64'
Expand Down Expand Up @@ -190,7 +196,7 @@ def el_expected_facts(agent)
expected_facts['os.release.minor'] = /(\d+)?/
expected_facts['processors.count'] = /[1-9]/
expected_facts['processors.physicalcount'] = /[1-9]/
expected_facts['processors.isa'] = os_hardware
expected_facts['processors.isa'] = /unknown|#{os_hardware}/
expected_facts['processors.models'] = processor_model_pattern
expected_facts['kernel'] = 'Linux'
expected_facts['kernelrelease'] = /\d+\.\d+\.\d+/
Expand Down Expand Up @@ -437,6 +443,8 @@ def windows_expected_facts(agent)
os_version = '2019'
elsif agent['platform'] =~ /2022/
os_version = '2022'
elsif agent['platform'] =~ /2025/
os_version = '2025'
else
fail_test "Unknown Windows version #{agent['platform']}"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
setcode do
require 'win32ole'
locator = WIN32OLE.new('WbemScripting.SWbemLocator')
locator.ConnectServer('', "root/CIMV2", '', '', nil, nil, nil, nil).to_s
locator.ConnectServer('', "root/CIMV2", '', '', nil, nil, nil, nil).class.to_s
end
end
EOM
Expand All @@ -26,7 +26,7 @@
# Test is assumed to have hung if it takes longer than 5 seconds.
Timeout::timeout(5) do
on agent, facter('--custom-dir', custom_dir, 'custom_fact_ole') do |facter_result|
assert_match(/#<WIN32OLE:0x[0-9a-f]+>/, facter_result.stdout.chomp, 'Custom fact output does not match expected output')
assert_match(/WIN32OLE/, facter_result.stdout.chomp, 'Custom fact output does not match expected output')
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion acceptance/tests/facts/networking_facts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

agents.each do |agent|
expected_networking = {
%w[networking dhcp] => agent['platform'] =~ /fedora-|el-8-|el-9-/ ? '' : @ip_regex, # https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/426
%w[networking dhcp] => agent['platform'] =~ /fedora-|el-(8|9|10)/ ? '' : @ip_regex, # https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/426
%w[networking ip] => @ip_regex,
%w[networking ip6] => /[a-f0-9]+:+/,
%w[networking mac] => /[a-f0-9]{2}:/,
Expand Down
12 changes: 3 additions & 9 deletions facter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@ Gem::Specification.new do |spec|
spec.description = 'You can prove anything with facts!'
spec.license = 'Apache-2.0'

dirs =
Dir[File.join(__dir__, 'bin/facter')] +
Dir[File.join(__dir__, 'LICENSE')] +
Dir[File.join(__dir__, 'lib/**/*.rb')] +
Dir[File.join(__dir__, 'lib/**/*.json')] +
Dir[File.join(__dir__, 'lib/**/*.conf')] +
Dir[File.join(__dir__, 'lib/**/*.erb')]
base = "#{__dir__}#{File::SEPARATOR}"
spec.files = dirs.map { |path| path.sub(base, '') }
spec.files =
%w[LICENSE README.md Gemfile facter.gemspec] +
Dir['{bin,lib}/**/*'].reject { |f| File.directory?(f) || f.end_with?('.dox') || f.end_with?('.yaml') }

spec.required_ruby_version = '>= 2.5', '< 4.0'
spec.bindir = 'bin'
Expand Down
Loading