diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 64b1e3e03d..d80f42a215 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -21,7 +21,7 @@ jobs: - '2.3' - '2.7' - '3.0' - - '3.1' + - '3.2.0-preview2' - 'jruby-9.3.7.0' runs-on: ubuntu-latest steps: @@ -38,6 +38,12 @@ jobs: - run: bundle exec rake spec_integration windows_unit_tests: + name: Windows tests with Ruby ${{ matrix.ruby }} + strategy: + matrix: + ruby: + - '2.7' + - '3.1' runs-on: windows-2019 steps: - name: Checkout current PR @@ -46,7 +52,7 @@ jobs: - name: Rspec checks uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: ${{ matrix.ruby }} - run: gem update bundler - run: bundle install --jobs 3 --retry 3 - run: bundle exec rake spec_random diff --git a/lib/facter/util/linux/socket_parser.rb b/lib/facter/util/linux/socket_parser.rb index c4b7b4ccef..c7fd6b2ea5 100644 --- a/lib/facter/util/linux/socket_parser.rb +++ b/lib/facter/util/linux/socket_parser.rb @@ -88,6 +88,7 @@ def mac_from(ifaddr) end rescue StandardError => e @log.debug("Could not read mac for interface #{ifaddr.name}, got #{e}") + nil end def mac_from_sockaddr_of(ifaddr) diff --git a/spec/custom_facts/util/directory_loader_spec.rb b/spec/custom_facts/util/directory_loader_spec.rb index 3f01fb77a1..bb1d5e4f3d 100755 --- a/spec/custom_facts/util/directory_loader_spec.rb +++ b/spec/custom_facts/util/directory_loader_spec.rb @@ -16,7 +16,7 @@ it "does nothing bad when dir doesn't exist" do fakepath = '/foobar/path' my_loader = LegacyFacter::Util::DirectoryLoader.new(fakepath) - allow(FileTest).to receive(:exists?).with(my_loader.directories[0]).and_return(false) + allow(FileTest).to receive(:exist?).with(my_loader.directories[0]).and_return(false) expect { my_loader.load(collection) }.not_to raise_error end diff --git a/spec/custom_facts/util/parser_spec.rb b/spec/custom_facts/util/parser_spec.rb index c45df76fca..e634b00251 100755 --- a/spec/custom_facts/util/parser_spec.rb +++ b/spec/custom_facts/util/parser_spec.rb @@ -354,6 +354,7 @@ def expects_to_parse_powershell(cmd, result) let(:yaml_content) { load_fixture('external_fact_yaml_date').read } it 'loads date' do + pending 'There is a bug in newer versions of Psych and Timecop' if RUBY_VERSION =~ /^3\.2/ expected_result = { 'testsfact' => { 'date' => Date.parse('2020-04-28') } } expect(yaml_parser.parse_results).to eq(expected_result)