Skip to content

Commit

Permalink
Only run pay-leave-for-parents tests when required
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chrisroos committed Oct 15, 2015
1 parent 85052fe commit 39807a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/smart_answer_test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def source_files_have_changed?
changed_files.any?
end

def explicitly_run_this_regression_test?
public def explicitly_run_this_regression_test?
ENV['RUN_REGRESSION_TESTS'] == @flow_name
end

Expand Down
10 changes: 10 additions & 0 deletions test/regression/smart_answers_regression_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ def teardown_hooks_installed?

next unless smart_answer_helper.run_regression_tests?

if flow_name == 'pay-leave-for-parents'
if smart_answer_helper.explicitly_run_this_regression_test?
puts 'Preloading flows to speed up testing of pay-leave-for-parents Smartdown answer'
FLOW_REGISTRY_OPTIONS[:preload_flows] = true
else
# Skip this Smartdown flow if we're running all regression tests or they're being run because checksums are out of date
next
end
end

smart_answer_helper.delete_saved_output_files
responses_and_expected_results = smart_answer_helper.read_responses_and_expected_results

Expand Down

0 comments on commit 39807a6

Please sign in to comment.