From 091457724459f8047411d0dbafc4cf434081dafb Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Tue, 23 Apr 2019 17:26:11 -0600 Subject: [PATCH] Disable strict variables for unit tests So rspec-puppet 2.4+ has strict variables enabled which causes test failures. The problem is that the puppet modules have never worked with strict_variables = true due to backwards compatibility & import ordering. Since this has not been true, lets disable it in the unit testing for now. Perhaps some day we will be able to turn this back to true. This should allow us to lift the 2.3.x cap that we added as part of https://review.opendev.org/#/c/618854/. Change-Id: Idbf837e87072c829c94e0356b8536088cf98c3bb --- playbooks/run-libraries-unit-tests.yaml | 7 +++++++ playbooks/run-unit-tests.yaml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/playbooks/run-libraries-unit-tests.yaml b/playbooks/run-libraries-unit-tests.yaml index d9199746d..f8fe3f1be 100644 --- a/playbooks/run-libraries-unit-tests.yaml +++ b/playbooks/run-libraries-unit-tests.yaml @@ -9,6 +9,13 @@ fi # TODO(tobias-urdin): Remove when we dont pin rspec-puppet export RSPEC_PUPPET_VERSION='{{ rspec_puppet_version }}' + # NOTE(aschultz): rspec-puppet 2.4+ has strict variables enabled + # which causes test failures. The problem is that the puppet modules + # have never worked with strict_variables = true due to backwards + # compatibility & import ordering. Since this has not been true, + # lets disable it in the unit testing for now. Perhaps some day + # we will be able to turn this back to true. + export STRICT_VARIABLES=no ./run_unit_tests.sh executable: /bin/bash chdir: '{{ ansible_user_dir }}/workspace' diff --git a/playbooks/run-unit-tests.yaml b/playbooks/run-unit-tests.yaml index d375af6e5..f8bfb3f63 100644 --- a/playbooks/run-unit-tests.yaml +++ b/playbooks/run-unit-tests.yaml @@ -8,6 +8,13 @@ fi # TODO(tobias-urdin): Remove when we dont pin rspec-puppet export RSPEC_PUPPET_VERSION='{{ rspec_puppet_version }}' + # NOTE(aschultz): rspec-puppet 2.4+ has strict variables enabled + # which causes test failures. The problem is that the puppet modules + # have never worked with strict_variables = true due to backwards + # compatibility & import ordering. Since this has not been true, + # lets disable it in the unit testing for now. Perhaps some day + # we will be able to turn this back to true. + export STRICT_VARIABLES=no mkdir .bundled_gems export GEM_HOME=`pwd`/.bundled_gems ruby <