Skip to content

Commit 39807a6

Browse files
committed
Only run pay-leave-for-parents tests when required
These tests are in place ready for the conversion of this Smart Answer from Smartdown to Ruby. We don't need them to run as part of the main regression test suite until the Smart Answer has been converted. This isn't the best implementation but I think it's probably OK given that I'll revert it as soon as this Smart Answer has been converted to Ruby.
1 parent 85052fe commit 39807a6

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/smart_answer_test_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def source_files_have_changed?
124124
changed_files.any?
125125
end
126126

127-
def explicitly_run_this_regression_test?
127+
public def explicitly_run_this_regression_test?
128128
ENV['RUN_REGRESSION_TESTS'] == @flow_name
129129
end
130130

test/regression/smart_answers_regression_test.rb

+10
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ def teardown_hooks_installed?
5656

5757
next unless smart_answer_helper.run_regression_tests?
5858

59+
if flow_name == 'pay-leave-for-parents'
60+
if smart_answer_helper.explicitly_run_this_regression_test?
61+
puts 'Preloading flows to speed up testing of pay-leave-for-parents Smartdown answer'
62+
FLOW_REGISTRY_OPTIONS[:preload_flows] = true
63+
else
64+
# Skip this Smartdown flow if we're running all regression tests or they're being run because checksums are out of date
65+
next
66+
end
67+
end
68+
5969
smart_answer_helper.delete_saved_output_files
6070
responses_and_expected_results = smart_answer_helper.read_responses_and_expected_results
6171

0 commit comments

Comments
 (0)