Skip to content
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

Closed
wants to merge 7 commits into from

Conversation

floehopper
Copy link
Contributor

@floehopper floehopper commented May 12, 2016

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:

  • The changes in Simplify 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.
  • The questions & responses file for simplified-expenses-checker contained some invalid YAML.
  • The questions & responses file for 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.

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
It looks as if this was intended to be done in #2256.

More specifically it looks as if it was missed out of 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]: 4801da6
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'
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@chrisroos
Copy link
Contributor

Apart from my single comment, this all looks good to me.

@chrisroos chrisroos added the LGTM label May 13, 2016
@chrisroos
Copy link
Contributor

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?

@chrisroos chrisroos self-assigned this May 13, 2016
@floehopper
Copy link
Contributor Author

@chrisroos:

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks as if this change was the result of this commit: 8053b80 which was part of #2524. I'm therefore happy to include it.

@@ -752,7 +752,7 @@
- :current_node: :which_country_are_you_in?
:responses:
- yemen
:next_node: :cannot_apply
:next_node: :apply_in_neighbouring_country
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see that this change was caused by this commit: 9c71c56 as part of #2463. So I'm happy to include it in this PR.

@floehopper
Copy link
Contributor Author

I'm going to rebase this against master and open a fresh PR so as not to disrupt the comments on this one.

@floehopper
Copy link
Contributor Author

Superseded by #2527. Closing.

@floehopper floehopper closed this May 13, 2016
@floehopper floehopper deleted the fix-responses-and-expected-results-files branch June 1, 2016 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants