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
Update regression tests first for marriage-abroad Denmark change #2591
Update regression tests first for marriage-abroad Denmark change #2591
Conversation
@chrisroos I'm confused. Perhaps you could make the commit statements match the bullet points in the PR description. I don't see how you have update the test artefacts before changing the code if you aren't adding Denmark as another option to be tested in the |
Copied from outcome_opposite_sex_marriage_in_consular_cni_countries_when_residing_in_uk_or_ceremony_country. This outcome is used for opposite sex ceremonies when the user is resident of UK or Denmark. I know that both of these outcomes need to be changed, and that we'll also need to use this same outcome for same sex ceremonies. I'll rename it at the point it's also used for same sex ceremonies. I used the following command to determine which template is being used for residents of UK and Denmark: $ rails r script/marriage-abroad-query-responses-and-expected-results.rb \ denmark uk The next step will be to remove the non-Denmark related code from the template. I've updated the responses-and-expected-results and the regression tests are passing in this commit.
I've removed all the code that obviously doesn't apply to Denmark. I've added "# CJR" to lines that I need to investigate further; because they may not apply to Denmark. The regression tests are passing so I'm confident I've not removed something I shouldn't have.
This isn't required because Denmark isn't in the list of `OS_21_DAYS_RESIDENCY_REQUIRED_COUNTRIES` countries, which means that the condition will never be true.
Denmark isn't in the CNI_POSTED_AFTER_14_DAYS_COUNTRIES array so this condition is never true.
Denmark is in the THREE_DAY_RESIDENCY_REQUIREMENT_COUNTRIES so this will always be true.
This will never be true because Denmark is in the list of NO_BIRTH_CERT_REQUIREMENT, and the `calculator.birth_certificate_required_as_supporting_document?` method checks for the absence of the ceremony country from that list.
Denmark is not in the CNI_NOTARY_PUBLIC_COUNTRIES array of countries so `#resident_of_ceremony_country?` will never be true.
As per the last commit, `calculator.notary_public_ceremony_country?` is always false, `calculator.partner_is_same_sex` is always false, which means that this condition will never be true.
As per the commit 2 before this, `notary_public_ceremony_country?` will never be true for Denmark.
Denmark is not in the REQUIRES_7_DAY_NOTICE_CEREMONY_COUNTRIES array.
Denmark has consular facilities so this will always be true.
This template is specific to Denmark so this conditional is always true.
This is within a check for the user being a resident of the ceremony country, which means they'll always be resident outside the UK, which means this is always true.
This makes me think that there are probably two separate outcomes in this file. The regression tests are passing at this point.
In preparation for amending the content.
According to the changes in the Google Doc[1]. This results in 3 failing regression tests for paths containing "denmark/uk/*/opposite_sex". [1]: https://docs.google.com/document/d/1QMLTHznjIMN7__cMhlp_4GCrTMa5MNgkUFHaOMLu04U/edit
…efacts As per the changes in the Google Doc[1]. This results in 3 failing regression tests for paths containing "denmark/ceremony_country/*/opposite_sex". There are now 6 failing regression tests as the previous commit also introduced 3. [1]: https://docs.google.com/document/d/1QMLTHznjIMN7__cMhlp_4GCrTMa5MNgkUFHaOMLu04U/edit
According to the Google doc the "No trace letters" needs to live in a different place depending on whether you're resident of uk or denmark. I think this is another indication that these should be two templates. This fixes the 6 failing regression tests introduced in the previous 2 commits.
As per the changes in the Google Doc[1]. Copy the equivalent opposite-sex outcome, leave the title as "Civil partnership" and add the synonyms of civil partnership section. This results in 3 failing regression tests for paths containing "denmark/uk/*/same_sex". [1]: https://docs.google.com/document/d/1QMLTHznjIMN7__cMhlp_4GCrTMa5MNgkUFHaOMLu04U/edit
As per the changes in the Google Doc[1]. Copy the equivalent opposite-sex outcome, leave the title as "Civil partnership" and add the synonyms of civil partnership section. This results in 3 failing regression tests for paths containing "denmark/ceremony_country/*/same_sex. There are now 6 failing regression tests as the previous commit also introduced 3. [1]: https://docs.google.com/document/d/1QMLTHznjIMN7__cMhlp_4GCrTMa5MNgkUFHaOMLu04U/edit
This fixes the 6 failing regression tests introduced in the previous 2 commits. I've renamed the outcome to indicate that it's no longer only used for opposite sex ceremonies. I've updated the marriage_abroad_services.yml file so that the same sex services when resident in Denmark match their opposite sex counterparts. Note that I had to change the `same_sex/default` service to `third_country` to avoid these services showing up on denmark/uk outcomes. I've updated the _contact_method partial to add a special case for Denmark. This is because we now display the same contact information on opposite and same sex outcomes when the user is resident of the UK or Denmark. The regression tests pass in this commit.
3a40d90
to
42a4244
Compare
Hey @leenagupte. Denmark was already in marriage-abroad-questions-and-responses.yml which is why I didn't have to add it in this branch. I don't quite follow what you mean by making "the commit statements match the bullet points in the PR description". The 6 top-level bullet points in the PR description contain the titles of, and links to, commits in this PR. The indented bullet points below each of those 6 points contain a summary of the commit. I've just updated the top level bullet points to a numbered list (1 to 6) in case that helps make it clearer that these represent the 6 commits I talk about in the description. I've also amended the commit notes of those 6 commits:
Does any of that make things any clearer? |
@chrisroos This statement is confusing as the Regresssion test artefacts are not updated until commit 19.:
|
@leenagupte: I've updated the PR description in the hope that it's clearer that you can ignore all the preparatory commits. These just refactor the code in order to make the actual change easier to implement. The approach I'm trying to describe/promote in this branch can be seen in the last 6 commits, which are all linked from the description. Does that help?
|
@chrisroos My confusion stems from the fact that you are manually updating the test artefacts. That's fine if you only have to change 3 artefacts, but a change I made to a partial template used in outcome page affected over 2,500 test artefacts and it would be madness to have updated all of those manually. See PR: #2427 Unless, are you actually just committing the changes in reverse order?
|
Ah, OK. I should've made it clearer that this approach almost certainly won't work for all types of content changes. Although, having just looked, I do think it would've been possible to use this test-first approach in PR #2427. By automatically replacing all occurrences of the removed line ("You can [claim back sick pay]...") from the test artefacts, we would've been left with failing regression tests that can then be fixed by removing the same line from "entitled_to_sick_pay.govspeak.erb".
Nope. The order is:
The current workflow (at least for marriage-abroad) is something like:
The main problem I'm trying to solve with the approach in this PR is to avoid having to carefully review/explain the changes to regression test artefacts in step 3. By updating the artefacts first, and then changing the system until the tests pass, we can be confident that our changes are correct. Does that make it any clearer, @leenagupte? |
Automatically how? Relying on your IDE to do a find and replace? The problem is that there are so many test artefacts generated. And in the case of #2427 it's impossible for a human being to review them all. Either as the developer or the code reviewer. I think that we should take into account when a change modifies the flow and when they just update the copy. I think that for flow changes, or more specifically, adding a new option, then yes, update the questions and responses file first and then regenerate the test artefacts and start with failing tests, but for parts of the change that are just changes to the copy in templates, it's fine to do those changes first, and the regenerate the test artefacts to match them. The copy in the templates is not as not as important to me as the structure of the file path that used to mimic the order of the questions and the URL. |
Hi @chrisroos, I find it very interesting. Content designers are more used to work with documents than with reusable templates. So..., two nice wins here:
I am happy to explore this approach for incoming PRs, but I would delay it a few weeks; the main reason is that we would need to get up to speed in creating PRs, organising commits / PRs, tests and delivering stories. Starting a new exploratory path right now seems a bit too early for me, to be honest. Does it sound ok to you? As a side note, It would be worth discussing about:
So to summarise my feeling about it:
When it comes to involving content designers, I would try first with developers until the process is fully understood and agreed among all of us. |
I imagine Chris means that you would craft one or more command lines (e.g. using
If the commands mentioned above were included in the commit note, then there would be no need to inspect the changes in the artefacts. The reviewer could simply re-run the command(s) against the original source and check that the result is the same as that in the commit. |
@pmanrubia: I agree with your assessment. It would be great if you could try this out in another card in the next few weeks. |
@chrisroos: This looks good to me. It feels as if it's an extension of what I described in the Preparatory commits section of the Regression tests documentation. If I get that merged, it might be worth extending or adding to that documentation to suggest this as an alternative approach. |
Update the regression tests for overseas passports according to the specification document [1] As per discussion in: #2591, this story seem to fit well to explore a new way to work with regression tests. We are following an approach similar to TDD approach, where we have a set of failing tests and we try to move them into green state though multiple commits. [1]: https://docs.google.com/document/d/1I-s8kOeguhIaIgJQ5UKhJ5rIAuKtERPPXaj_P2r7q6M/edit These are the expected failures: SmartAnswersRegressionTest#test_: Smart Answer: overseas-passports should zzzzzzzzzzz run me last and generate the same set of output files. [test/regression/smart_answers_regression_test.rb:140]: Changes in outcome page artefacts have been detected: M test/artefacts/overseas-passports/afghanistan/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/applying/adult/south-africa.txt M test/artefacts/overseas-passports/afghanistan/applying/child/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/applying/child/south-africa.txt M test/artefacts/overseas-passports/afghanistan/renewing_new/adult.txt M test/artefacts/overseas-passports/afghanistan/renewing_new/child.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/afghanistan/replacing/adult.txt M test/artefacts/overseas-passports/afghanistan/replacing/child.txt M test/artefacts/overseas-passports/algeria/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/algeria/applying/adult/south-africa.txt M test/artefacts/overseas-passports/algeria/applying/child/afghanistan.txt M test/artefacts/overseas-passports/algeria/applying/child/south-africa.txt M test/artefacts/overseas-passports/algeria/renewing_new/adult.txt M test/artefacts/overseas-passports/algeria/renewing_new/child.txt M test/artefacts/overseas-passports/algeria/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/algeria/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/algeria/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/algeria/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/algeria/replacing/adult.txt M test/artefacts/overseas-passports/algeria/replacing/child.txt M test/artefacts/overseas-passports/georgia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/georgia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/georgia/applying/child/afghanistan.txt M test/artefacts/overseas-passports/georgia/applying/child/south-africa.txt M test/artefacts/overseas-passports/georgia/renewing_new/adult.txt M test/artefacts/overseas-passports/georgia/renewing_new/child.txt M test/artefacts/overseas-passports/georgia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/georgia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/georgia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/georgia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/georgia/replacing/adult.txt M test/artefacts/overseas-passports/georgia/replacing/child.txt M test/artefacts/overseas-passports/pakistan/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/pakistan/applying/adult/south-africa.txt M test/artefacts/overseas-passports/pakistan/applying/child/afghanistan.txt M test/artefacts/overseas-passports/pakistan/applying/child/south-africa.txt M test/artefacts/overseas-passports/pakistan/renewing_new/adult.txt M test/artefacts/overseas-passports/pakistan/renewing_new/child.txt M test/artefacts/overseas-passports/pakistan/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/pakistan/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/pakistan/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/pakistan/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/pakistan/replacing/adult.txt M test/artefacts/overseas-passports/pakistan/replacing/child.txt M test/artefacts/overseas-passports/russia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/russia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/russia/applying/child/afghanistan.txt M test/artefacts/overseas-passports/russia/applying/child/south-africa.txt M test/artefacts/overseas-passports/russia/renewing_new/adult.txt M test/artefacts/overseas-passports/russia/renewing_new/child.txt M test/artefacts/overseas-passports/russia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/russia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/russia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/russia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/russia/replacing/adult.txt M test/artefacts/overseas-passports/russia/replacing/child.txt M test/artefacts/overseas-passports/tunisia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/tunisia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/tunisia/applying/child/south-africa.txt M test/artefacts/overseas-passports/tunisia/renewing_new/adult.txt M test/artefacts/overseas-passports/tunisia/renewing_new/child.txt M test/artefacts/overseas-passports/tunisia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/tunisia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/tunisia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/tunisia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/tunisia/replacing/adult.txt M test/artefacts/overseas-passports/tunisia/replacing/child.txt If these changes are expected then re-generate the checksums, re-run the regression test, and commit all the changes. 324 runs, 324 assertions, 1 failures, 0 errors, 0 skips
Update the regression tests for overseas passports according to the specification document [1] As per discussion in: #2591, this story seem to fit well to explore a new way to work with regression tests. We are following an approach similar to TDD approach, where we have a set of failing tests and we try to move them into green state though multiple commits. [1]: https://docs.google.com/document/d/1I-s8kOeguhIaIgJQ5UKhJ5rIAuKtERPPXaj_P2r7q6M/edit These are the expected failures: SmartAnswersRegressionTest#test_: Smart Answer: overseas-passports should zzzzzzzzzzz run me last and generate the same set of output files. [test/regression/smart_answers_regression_test.rb:140]: Changes in outcome page artefacts have been detected: M test/artefacts/overseas-passports/afghanistan/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/applying/adult/south-africa.txt M test/artefacts/overseas-passports/afghanistan/applying/child/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/applying/child/south-africa.txt M test/artefacts/overseas-passports/afghanistan/renewing_new/adult.txt M test/artefacts/overseas-passports/afghanistan/renewing_new/child.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/afghanistan/replacing/adult.txt M test/artefacts/overseas-passports/afghanistan/replacing/child.txt M test/artefacts/overseas-passports/algeria/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/algeria/applying/adult/south-africa.txt M test/artefacts/overseas-passports/algeria/applying/child/afghanistan.txt M test/artefacts/overseas-passports/algeria/applying/child/south-africa.txt M test/artefacts/overseas-passports/algeria/renewing_new/adult.txt M test/artefacts/overseas-passports/algeria/renewing_new/child.txt M test/artefacts/overseas-passports/algeria/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/algeria/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/algeria/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/algeria/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/algeria/replacing/adult.txt M test/artefacts/overseas-passports/algeria/replacing/child.txt M test/artefacts/overseas-passports/georgia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/georgia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/georgia/applying/child/afghanistan.txt M test/artefacts/overseas-passports/georgia/applying/child/south-africa.txt M test/artefacts/overseas-passports/georgia/renewing_new/adult.txt M test/artefacts/overseas-passports/georgia/renewing_new/child.txt M test/artefacts/overseas-passports/georgia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/georgia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/georgia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/georgia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/georgia/replacing/adult.txt M test/artefacts/overseas-passports/georgia/replacing/child.txt M test/artefacts/overseas-passports/pakistan/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/pakistan/applying/adult/south-africa.txt M test/artefacts/overseas-passports/pakistan/applying/child/afghanistan.txt M test/artefacts/overseas-passports/pakistan/applying/child/south-africa.txt M test/artefacts/overseas-passports/pakistan/renewing_new/adult.txt M test/artefacts/overseas-passports/pakistan/renewing_new/child.txt M test/artefacts/overseas-passports/pakistan/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/pakistan/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/pakistan/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/pakistan/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/pakistan/replacing/adult.txt M test/artefacts/overseas-passports/pakistan/replacing/child.txt M test/artefacts/overseas-passports/russia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/russia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/russia/applying/child/afghanistan.txt M test/artefacts/overseas-passports/russia/applying/child/south-africa.txt M test/artefacts/overseas-passports/russia/renewing_new/adult.txt M test/artefacts/overseas-passports/russia/renewing_new/child.txt M test/artefacts/overseas-passports/russia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/russia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/russia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/russia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/russia/replacing/adult.txt M test/artefacts/overseas-passports/russia/replacing/child.txt M test/artefacts/overseas-passports/tunisia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/tunisia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/tunisia/applying/child/south-africa.txt M test/artefacts/overseas-passports/tunisia/renewing_new/adult.txt M test/artefacts/overseas-passports/tunisia/renewing_new/child.txt M test/artefacts/overseas-passports/tunisia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/tunisia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/tunisia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/tunisia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/tunisia/replacing/adult.txt M test/artefacts/overseas-passports/tunisia/replacing/child.txt If these changes are expected then re-generate the checksums, re-run the regression test, and commit all the changes. 324 runs, 324 assertions, 1 failures, 0 errors, 0 skips
Update the regression tests for overseas passports according to the specification document [1] As per discussion in: #2591, this story seems to fit well to explore a new way to work with regression tests. We are following an approach similar to TDD, where we have a set of failing tests and we try to move them into green state though multiple commits. Once all tests are green we will be satisfying the requirements of the document[1]. [1]: https://docs.google.com/document/d/1I-s8kOeguhIaIgJQ5UKhJ5rIAuKtERPPXaj_P2r7q6M/edit These are the expected failures: SmartAnswersRegressionTest#test_: Smart Answer: overseas-passports should zzzzzzzzzzz run me last and generate the same set of output files. [test/regression/smart_answers_regression_test.rb:140]: Changes in outcome page artefacts have been detected: M test/artefacts/overseas-passports/afghanistan/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/applying/adult/south-africa.txt M test/artefacts/overseas-passports/afghanistan/applying/child/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/applying/child/south-africa.txt M test/artefacts/overseas-passports/afghanistan/renewing_new/adult.txt M test/artefacts/overseas-passports/afghanistan/renewing_new/child.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/afghanistan/replacing/adult.txt M test/artefacts/overseas-passports/afghanistan/replacing/child.txt M test/artefacts/overseas-passports/algeria/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/algeria/applying/adult/south-africa.txt M test/artefacts/overseas-passports/algeria/applying/child/afghanistan.txt M test/artefacts/overseas-passports/algeria/applying/child/south-africa.txt M test/artefacts/overseas-passports/algeria/renewing_new/adult.txt M test/artefacts/overseas-passports/algeria/renewing_new/child.txt M test/artefacts/overseas-passports/algeria/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/algeria/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/algeria/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/algeria/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/algeria/replacing/adult.txt M test/artefacts/overseas-passports/algeria/replacing/child.txt M test/artefacts/overseas-passports/georgia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/georgia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/georgia/applying/child/afghanistan.txt M test/artefacts/overseas-passports/georgia/applying/child/south-africa.txt M test/artefacts/overseas-passports/georgia/renewing_new/adult.txt M test/artefacts/overseas-passports/georgia/renewing_new/child.txt M test/artefacts/overseas-passports/georgia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/georgia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/georgia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/georgia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/georgia/replacing/adult.txt M test/artefacts/overseas-passports/georgia/replacing/child.txt M test/artefacts/overseas-passports/pakistan/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/pakistan/applying/adult/south-africa.txt M test/artefacts/overseas-passports/pakistan/applying/child/afghanistan.txt M test/artefacts/overseas-passports/pakistan/applying/child/south-africa.txt M test/artefacts/overseas-passports/pakistan/renewing_new/adult.txt M test/artefacts/overseas-passports/pakistan/renewing_new/child.txt M test/artefacts/overseas-passports/pakistan/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/pakistan/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/pakistan/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/pakistan/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/pakistan/replacing/adult.txt M test/artefacts/overseas-passports/pakistan/replacing/child.txt M test/artefacts/overseas-passports/russia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/russia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/russia/applying/child/afghanistan.txt M test/artefacts/overseas-passports/russia/applying/child/south-africa.txt M test/artefacts/overseas-passports/russia/renewing_new/adult.txt M test/artefacts/overseas-passports/russia/renewing_new/child.txt M test/artefacts/overseas-passports/russia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/russia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/russia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/russia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/russia/replacing/adult.txt M test/artefacts/overseas-passports/russia/replacing/child.txt M test/artefacts/overseas-passports/tunisia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/tunisia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/tunisia/applying/child/south-africa.txt M test/artefacts/overseas-passports/tunisia/renewing_new/adult.txt M test/artefacts/overseas-passports/tunisia/renewing_new/child.txt M test/artefacts/overseas-passports/tunisia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/tunisia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/tunisia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/tunisia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/tunisia/replacing/adult.txt M test/artefacts/overseas-passports/tunisia/replacing/child.txt If these changes are expected then re-generate the checksums, re-run the regression test, and commit all the changes. 324 runs, 324 assertions, 1 failures, 0 errors, 0 skips
Update the regression tests for overseas passports according to the specification document [1] As per discussion in: #2591, this story seems to fit well to explore a new way to work with regression tests. We are following an approach similar to TDD, where we have a set of failing tests and we try to move them into green state though multiple commits. Once all tests are green we will be satisfying the requirements of the document[1]. [1]: https://docs.google.com/document/d/1I-s8kOeguhIaIgJQ5UKhJ5rIAuKtERPPXaj_P2r7q6M/edit These are the expected failures: SmartAnswersRegressionTest#test_: Smart Answer: overseas-passports should zzzzzzzzzzz run me last and generate the same set of output files. [test/regression/smart_answers_regression_test.rb:140]: Changes in outcome page artefacts have been detected: M test/artefacts/overseas-passports/afghanistan/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/applying/adult/south-africa.txt M test/artefacts/overseas-passports/afghanistan/applying/child/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/applying/child/south-africa.txt M test/artefacts/overseas-passports/afghanistan/renewing_new/adult.txt M test/artefacts/overseas-passports/afghanistan/renewing_new/child.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/afghanistan/replacing/adult.txt M test/artefacts/overseas-passports/afghanistan/replacing/child.txt M test/artefacts/overseas-passports/algeria/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/algeria/applying/adult/south-africa.txt M test/artefacts/overseas-passports/algeria/applying/child/afghanistan.txt M test/artefacts/overseas-passports/algeria/applying/child/south-africa.txt M test/artefacts/overseas-passports/algeria/renewing_new/adult.txt M test/artefacts/overseas-passports/algeria/renewing_new/child.txt M test/artefacts/overseas-passports/algeria/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/algeria/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/algeria/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/algeria/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/algeria/replacing/adult.txt M test/artefacts/overseas-passports/algeria/replacing/child.txt M test/artefacts/overseas-passports/georgia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/georgia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/georgia/applying/child/afghanistan.txt M test/artefacts/overseas-passports/georgia/applying/child/south-africa.txt M test/artefacts/overseas-passports/georgia/renewing_new/adult.txt M test/artefacts/overseas-passports/georgia/renewing_new/child.txt M test/artefacts/overseas-passports/georgia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/georgia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/georgia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/georgia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/georgia/replacing/adult.txt M test/artefacts/overseas-passports/georgia/replacing/child.txt M test/artefacts/overseas-passports/pakistan/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/pakistan/applying/adult/south-africa.txt M test/artefacts/overseas-passports/pakistan/applying/child/afghanistan.txt M test/artefacts/overseas-passports/pakistan/applying/child/south-africa.txt M test/artefacts/overseas-passports/pakistan/renewing_new/adult.txt M test/artefacts/overseas-passports/pakistan/renewing_new/child.txt M test/artefacts/overseas-passports/pakistan/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/pakistan/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/pakistan/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/pakistan/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/pakistan/replacing/adult.txt M test/artefacts/overseas-passports/pakistan/replacing/child.txt M test/artefacts/overseas-passports/russia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/russia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/russia/applying/child/afghanistan.txt M test/artefacts/overseas-passports/russia/applying/child/south-africa.txt M test/artefacts/overseas-passports/russia/renewing_new/adult.txt M test/artefacts/overseas-passports/russia/renewing_new/child.txt M test/artefacts/overseas-passports/russia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/russia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/russia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/russia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/russia/replacing/adult.txt M test/artefacts/overseas-passports/russia/replacing/child.txt M test/artefacts/overseas-passports/tunisia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/tunisia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/tunisia/applying/child/south-africa.txt M test/artefacts/overseas-passports/tunisia/renewing_new/adult.txt M test/artefacts/overseas-passports/tunisia/renewing_new/child.txt M test/artefacts/overseas-passports/tunisia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/tunisia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/tunisia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/tunisia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/tunisia/replacing/adult.txt M test/artefacts/overseas-passports/tunisia/replacing/child.txt If these changes are expected then re-generate the checksums, re-run the regression test, and commit all the changes. 324 runs, 324 assertions, 1 failures, 0 errors, 0 skips
Update the regression tests for overseas passports according to the document [1] with the requirements. As per discussion in: #2591, this story seems to be a good candidate to explore a new way to work with regression tests. We follow an approach similar to TDD, where we have a set of failing tests and we try to make them pass. Once all tests are green we will be satisfying the requirements of the document[1]. [1]: https://docs.google.com/document/d/1I-s8kOeguhIaIgJQ5UKhJ5rIAuKtERPPXaj_P2r7q6M/edit These are the expected failures: SmartAnswersRegressionTest#test_: Smart Answer: overseas-passports should zzzzzzzzzzz run me last and generate the same set of output files. [test/regression/smart_answers_regression_test.rb:140]: Changes in outcome page artefacts have been detected: M test/artefacts/overseas-passports/afghanistan/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/applying/adult/south-africa.txt M test/artefacts/overseas-passports/afghanistan/applying/child/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/applying/child/south-africa.txt M test/artefacts/overseas-passports/afghanistan/renewing_new/adult.txt M test/artefacts/overseas-passports/afghanistan/renewing_new/child.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/afghanistan/replacing/adult.txt M test/artefacts/overseas-passports/afghanistan/replacing/child.txt M test/artefacts/overseas-passports/algeria/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/algeria/applying/adult/south-africa.txt M test/artefacts/overseas-passports/algeria/applying/child/afghanistan.txt M test/artefacts/overseas-passports/algeria/applying/child/south-africa.txt M test/artefacts/overseas-passports/algeria/renewing_new/adult.txt M test/artefacts/overseas-passports/algeria/renewing_new/child.txt M test/artefacts/overseas-passports/algeria/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/algeria/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/algeria/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/algeria/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/algeria/replacing/adult.txt M test/artefacts/overseas-passports/algeria/replacing/child.txt M test/artefacts/overseas-passports/georgia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/georgia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/georgia/applying/child/afghanistan.txt M test/artefacts/overseas-passports/georgia/applying/child/south-africa.txt M test/artefacts/overseas-passports/georgia/renewing_new/adult.txt M test/artefacts/overseas-passports/georgia/renewing_new/child.txt M test/artefacts/overseas-passports/georgia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/georgia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/georgia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/georgia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/georgia/replacing/adult.txt M test/artefacts/overseas-passports/georgia/replacing/child.txt M test/artefacts/overseas-passports/pakistan/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/pakistan/applying/adult/south-africa.txt M test/artefacts/overseas-passports/pakistan/applying/child/afghanistan.txt M test/artefacts/overseas-passports/pakistan/applying/child/south-africa.txt M test/artefacts/overseas-passports/pakistan/renewing_new/adult.txt M test/artefacts/overseas-passports/pakistan/renewing_new/child.txt M test/artefacts/overseas-passports/pakistan/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/pakistan/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/pakistan/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/pakistan/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/pakistan/replacing/adult.txt M test/artefacts/overseas-passports/pakistan/replacing/child.txt M test/artefacts/overseas-passports/russia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/russia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/russia/applying/child/afghanistan.txt M test/artefacts/overseas-passports/russia/applying/child/south-africa.txt M test/artefacts/overseas-passports/russia/renewing_new/adult.txt M test/artefacts/overseas-passports/russia/renewing_new/child.txt M test/artefacts/overseas-passports/russia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/russia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/russia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/russia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/russia/replacing/adult.txt M test/artefacts/overseas-passports/russia/replacing/child.txt M test/artefacts/overseas-passports/tunisia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/tunisia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/tunisia/applying/child/south-africa.txt M test/artefacts/overseas-passports/tunisia/renewing_new/adult.txt M test/artefacts/overseas-passports/tunisia/renewing_new/child.txt M test/artefacts/overseas-passports/tunisia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/tunisia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/tunisia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/tunisia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/tunisia/replacing/adult.txt M test/artefacts/overseas-passports/tunisia/replacing/child.txt If these changes are expected then re-generate the checksums, re-run the regression test, and commit all the changes. 324 runs, 324 assertions, 1 failures, 0 errors, 0 skips
@chrisroos shall we keep this PR opened? I guess it served its purpose. |
Update the regression tests for overseas passports according to the document [1] with the requirements. As per discussion in: #2591, this story seems to be a good candidate to explore a new way to work with regression tests. We follow an approach similar to TDD, where we have a set of failing tests and we try to make them pass. Once all tests are green we will be satisfying the requirements of the document[1]. [1]: https://docs.google.com/document/d/1I-s8kOeguhIaIgJQ5UKhJ5rIAuKtERPPXaj_P2r7q6M/edit These are the expected failures: SmartAnswersRegressionTest#test_: Smart Answer: overseas-passports should zzzzzzzzzzz run me last and generate the same set of output files. [test/regression/smart_answers_regression_test.rb:140]: Changes in outcome page artefacts have been detected: M test/artefacts/overseas-passports/afghanistan/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/applying/adult/south-africa.txt M test/artefacts/overseas-passports/afghanistan/applying/child/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/applying/child/south-africa.txt M test/artefacts/overseas-passports/afghanistan/renewing_new/adult.txt M test/artefacts/overseas-passports/afghanistan/renewing_new/child.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/afghanistan/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/afghanistan/replacing/adult.txt M test/artefacts/overseas-passports/afghanistan/replacing/child.txt M test/artefacts/overseas-passports/algeria/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/algeria/applying/adult/south-africa.txt M test/artefacts/overseas-passports/algeria/applying/child/afghanistan.txt M test/artefacts/overseas-passports/algeria/applying/child/south-africa.txt M test/artefacts/overseas-passports/algeria/renewing_new/adult.txt M test/artefacts/overseas-passports/algeria/renewing_new/child.txt M test/artefacts/overseas-passports/algeria/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/algeria/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/algeria/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/algeria/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/algeria/replacing/adult.txt M test/artefacts/overseas-passports/algeria/replacing/child.txt M test/artefacts/overseas-passports/georgia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/georgia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/georgia/applying/child/afghanistan.txt M test/artefacts/overseas-passports/georgia/applying/child/south-africa.txt M test/artefacts/overseas-passports/georgia/renewing_new/adult.txt M test/artefacts/overseas-passports/georgia/renewing_new/child.txt M test/artefacts/overseas-passports/georgia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/georgia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/georgia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/georgia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/georgia/replacing/adult.txt M test/artefacts/overseas-passports/georgia/replacing/child.txt M test/artefacts/overseas-passports/pakistan/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/pakistan/applying/adult/south-africa.txt M test/artefacts/overseas-passports/pakistan/applying/child/afghanistan.txt M test/artefacts/overseas-passports/pakistan/applying/child/south-africa.txt M test/artefacts/overseas-passports/pakistan/renewing_new/adult.txt M test/artefacts/overseas-passports/pakistan/renewing_new/child.txt M test/artefacts/overseas-passports/pakistan/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/pakistan/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/pakistan/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/pakistan/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/pakistan/replacing/adult.txt M test/artefacts/overseas-passports/pakistan/replacing/child.txt M test/artefacts/overseas-passports/russia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/russia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/russia/applying/child/afghanistan.txt M test/artefacts/overseas-passports/russia/applying/child/south-africa.txt M test/artefacts/overseas-passports/russia/renewing_new/adult.txt M test/artefacts/overseas-passports/russia/renewing_new/child.txt M test/artefacts/overseas-passports/russia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/russia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/russia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/russia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/russia/replacing/adult.txt M test/artefacts/overseas-passports/russia/replacing/child.txt M test/artefacts/overseas-passports/tunisia/applying/adult/afghanistan.txt M test/artefacts/overseas-passports/tunisia/applying/adult/south-africa.txt M test/artefacts/overseas-passports/tunisia/applying/child/south-africa.txt M test/artefacts/overseas-passports/tunisia/renewing_new/adult.txt M test/artefacts/overseas-passports/tunisia/renewing_new/child.txt M test/artefacts/overseas-passports/tunisia/renewing_old/adult/afghanistan.txt M test/artefacts/overseas-passports/tunisia/renewing_old/adult/south-africa.txt M test/artefacts/overseas-passports/tunisia/renewing_old/child/afghanistan.txt M test/artefacts/overseas-passports/tunisia/renewing_old/child/south-africa.txt M test/artefacts/overseas-passports/tunisia/replacing/adult.txt M test/artefacts/overseas-passports/tunisia/replacing/child.txt If these changes are expected then re-generate the checksums, re-run the regression test, and commit all the changes. 324 runs, 324 assertions, 1 failures, 0 errors, 0 skips
I agree that it's served its purpose. I'll close it now.
This is great! I'm glad you found the approach useful. |
This PR demonstrates an approach to making marriage-abroad content changes by updating the regression test artefacts first.
We currently make these sort of changes by updating the flows/templates and then regenerating the regression test artefacts to confirm that the changes have had the desired effect. One of the problems with this approach is that it's not always easy/possible to see the effect of the changes by looking at the diff of the regression test artefacts. This, in combination with the overly complicated marriage-abroad code, makes it possible to commit unintentional changes to the rendered outcomes.
Updating the regression test artefacts first, and then updating the flows/templates, gives us confidence that the changes we make only affect the things we want.
I chose a recent marriage-abroad content change (PR #2576) and have reimplemented it in this branch by updating the regression test artefacts first.
The branch contains a number of preparatory commits that aren't interesting when it comes to understanding this approach. These commits refactor the code (i.e. don't change behaviour and therefore don't result in changes to the regression test artefacts) to make the actual change easier.
The last 6 commits are the only ones of real interest:
I think there's an additional benefit of this approach in that I can imagine helping the content team/department to make changes to the regression test artefacts directly; allowing us to remove the intermediate step of translating the requirements in a Google Doc.
What do you think, @ikennaokpala, @pmanrubia, @leenagupte and @floehopper? Does this seem like a good approach to you?
Note that while I've focussed on marriage-abroad, I can't see any reason we can't use this approach for all these sort of content changes.