-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix responses and expected results files for regression tests #2524
Conversation
This script runs in the Rails `development` environment. Prior to #2498, being in the `development` environment meant that the app always used the production instance of the Whitehall app as the backend for the GDS Worldwide API. After #2498, by default the app would try to use a local development instance of the Whitehall app, unless the `PLEK_SERVICE_WHITEHALL_ADMIN_URI` is set. Since the existing `*-responses-and-expected-results.yml` files were generated with the production instance of the Whitehall app, it seems more sensible to set the `PLEK_SERVICE_WHITEHALL_ADMIN_URI` environment variable to ensure that this continues to be the case.
It looks like the YAML was accidentally broken in this commit [1]. Also updated regression test checksums, because all the regression tests are passing after the changes to the questions and responses file. [1]: 853eeed
These changes should have been made in #2289. Also updated regression test checksums, because all the regression tests are passing after the changes to the responses and expected results file.
These changes should have been made in #2296. Also updated regression test artefacts in the light of these changes and then updated regression test checksums, because all the regression tests are now passing.
These changes should have been made in #2432. Also updated regression test artefacts in the light of these changes and then updated regression test checksums, because all the regression tests are now passing.
These changes should have been made in #2463. Also updated regression test checksums, because all the regression tests are passing after the changes to the responses and expected results file.
@@ -1,3 +1,5 @@ | |||
ENV['PLEK_SERVICE_WHITEHALL_ADMIN_URI'] = 'https://www.gov.uk' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks as though this line should be added to generate-questions-and-responses-for-smart-answer.rb too. It's not clear to me whether that should happen in this PR or not though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I think I might as well add it to this PR.
Apart from my single comment, this all looks good to me. |
I wonder whether it's worth adding tests to avoid these sort of problems in future? Do you think the effort of adding such tests would be warranted? |
I'm not sure. It's not obvious to me how these changes were missed. I suspect that because many PRs only involve content changes people may just get into the habit of only updating the regression test artefacts & checksums, and not think about whether these files need updating. I think the first thing to do would be to check that the documentation makes it clear when you should update these files. Then we could consider adding some kind of check or test to make sure they do get updated. I did wonder whether we could just always run the generate script before running the regression test for that flow. Anyway, I think it's out of scope for this PR, but I've created a Trello card to capture the idea. |
@@ -630,7 +630,7 @@ | |||
- kuwait | |||
- work | |||
- six_months_or_less | |||
:next_node: :outcome_work_m | |||
:next_node: :outcome_work_waiver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -752,7 +752,7 @@ | |||
- :current_node: :which_country_are_you_in? | |||
:responses: | |||
- yemen | |||
:next_node: :cannot_apply | |||
:next_node: :apply_in_neighbouring_country |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to rebase this against master and open a fresh PR so as not to disrupt the comments on this one. |
Superseded by #2527. Closing. |
Description
While looking into something else, I noticed that the
*-responses-and-expected-results.yml
files for a number of flows were out-of-date:check-uk-visa
student-finance-forms
state-pension-through-partner
overseas-passports
This PR updates those files and identifies the PR in which they should have been updated in the first place. I haven't done any checking that these changes are sensible, but I plan to ask the authors of the relevant PRs to check for me, because they will have more context.
While fixing the above, I also came across a few other problems:
Services.worldwide_api
method #2498 meant that the scripts for generating both the "questions & responses" and "responses & expected results" files were trying to use a local instance of the Whitehall app rather than the production instance.simplified-expenses-checker
contained some invalid YAML.landlord-immigration-check
was not up-to-date with the stubbed imminence lookups in the regression test nor its responses & expected results file.I've fixed all of the above and it would be good to get this merged as soon as possible.
Note that I've also noticed that the script for generating the responses & expected results is using the wrong stubbed value of current time for some flows. I plan to address that in a separate PR, but that PR will rely on this one.
External changes
None. These changes only affect test code - no changes to production code.