From 75e56e77e09dbede6ebccebecb59897652284fbc Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 3 Jan 2024 09:26:54 +0100 Subject: [PATCH] skip NodeJS16 on EL9 --- spec/acceptance/class_spec.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index ad65fac0..91cf3877 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -2,6 +2,12 @@ require 'spec_helper_acceptance' +def nodesource_unsupported + 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' @@ -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 do # Only nodejs 16 is supported on EL7 by nodesource include_examples 'cleanup'