Skip to content

Commit

Permalink
skip NodeJS16 on EL9
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Jan 3, 2024
1 parent 809be69 commit ea16ac7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

require 'spec_helper_acceptance'

def nodesource_unsupported(nodejs_version)
return unless fact('os.family') == 'RedHat'
return 'Only NodeJS 16 is supported on EL7' if nodejs_version != '16' && fact('os.release.major') == '7'
return 'NodeJS 16 is not supported on EL9' if nodejs_version == '16' && fact('os.release.major') == '9'
end

describe 'nodejs' do
case fact('os.family')
when 'RedHat'
Expand Down Expand Up @@ -29,7 +35,7 @@
end
end

context "explicitly using version #{nodejs_version} from nodesource", if: %w[RedHat Debian].include?(fact('os.family')), skip: (nodejs_version != '16' && fact('os.family') == 'RedHat' && fact('os.release.major') == '7' ? 'Only NodeJS 16 is supported on EL7' : nil) do
context "explicitly using version #{nodejs_version} from nodesource", if: %w[RedHat Debian].include?(fact('os.family')), skip: nodesource_unsupported(nodejs_version) do
# Only nodejs 16 is supported on EL7 by nodesource

include_examples 'cleanup'
Expand Down

0 comments on commit ea16ac7

Please sign in to comment.