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

Add tests for download #1368

Closed
wants to merge 1 commit into from
Closed

Add tests for download #1368

wants to merge 1 commit into from

Conversation

BenSurgisonGDS
Copy link
Contributor

@BenSurgisonGDS BenSurgisonGDS commented Jun 6, 2022

Tests to download and extract the latest zip file of the prototype kit.
Please note that as cypress has an issue testing a download from an external page, I have created a custom cypress command to retrieve the href of the download and then download the file manually.
Note also that the download test runs in a seperate action.

@BenSurgisonGDS BenSurgisonGDS self-assigned this Jun 6, 2022
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-create-tut-gupurg June 6, 2022 13:37 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-create-tut-gupurg June 6, 2022 13:41 Inactive
@BenSurgisonGDS BenSurgisonGDS changed the title Add tests for tutorial Add tests for download Jun 6, 2022
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-create-tut-gupurg June 6, 2022 13:42 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-create-tut-gupurg June 6, 2022 14:03 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-create-tut-gupurg June 6, 2022 14:15 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-create-tut-gupurg June 6, 2022 14:26 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-create-tut-gupurg June 6, 2022 14:27 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-create-tut-gupurg June 6, 2022 14:39 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-create-tut-gupurg June 6, 2022 14:45 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-create-tut-gupurg June 7, 2022 14:01 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-create-tut-gupurg June 7, 2022 14:06 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-create-tut-gupurg June 8, 2022 13:12 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-create-tut-gupurg June 8, 2022 14:33 Inactive
@BenSurgisonGDS BenSurgisonGDS force-pushed the create-tutorial branch 4 times, most recently from 5627fda to b399ef4 Compare June 20, 2022 13:55
@BenSurgisonGDS BenSurgisonGDS force-pushed the create-tutorial branch 5 times, most recently from c034544 to 8a24d80 Compare June 24, 2022 10:13
@BenSurgisonGDS BenSurgisonGDS force-pushed the create-tutorial branch 3 times, most recently from 91ee3f0 to 60311eb Compare July 22, 2022 10:16
@BenSurgisonGDS BenSurgisonGDS linked an issue Jul 22, 2022 that may be closed by this pull request
@BenSurgisonGDS BenSurgisonGDS force-pushed the create-tutorial branch 2 times, most recently from 86bd033 to 70bcb6e Compare July 25, 2022 09:15
@lfdebrux
Copy link
Member

I'm worried about this test, for a couple of reasons:

  1. It's partially testing code that is in the docs repo rather than this repo
  2. It's testing the production docs site and the production release link, so changes to our code that break the functionality wouldn't actually be tested
  3. If there were issues with hosting or GitHub these tests would fail even if our code hadn't changed

Is there any way to mitigate these issues?

@BenSurgisonGDS
Copy link
Contributor Author

I'm worried about this test, for a couple of reasons:

  1. It's partially testing code that is in the docs repo rather than this repo
  2. It's testing the production docs site and the production release link, so changes to our code that break the functionality wouldn't actually be tested
  3. If there were issues with hosting or GitHub these tests would fail even if our code hadn't changed

Is there any way to mitigate these issues?

I have to admit these are all valid points. I guess the original intention was to attempt to download and install the kit from a zipped file but as we are doing something similar I changed it to just check that the link to download the latest version of the kit as a zip file does indeed download the latest version of the code.

@BenSurgisonGDS BenSurgisonGDS force-pushed the create-tutorial branch 9 times, most recently from e6ed952 to 55d98cc Compare August 3, 2022 13:16
@BenSurgisonGDS BenSurgisonGDS force-pushed the create-tutorial branch 3 times, most recently from 76bd988 to faffd4d Compare August 12, 2022 11:32
Comment on lines +12 to +16
strategy:
fail-fast: false # continue other tests if one test in matrix fails
matrix:
node-version: [12.x, 14.x, 16.x]
os: [macos-latest, windows-latest, ubuntu-latest]
Copy link
Member

Choose a reason for hiding this comment

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

We probably don't need to test this across the whole matrix, I think running it just on ubuntu and the latest version of Node should be fine.

Comment on lines +47 to +59
- run: npm run test:download
env:
CYPRESS_REQUEST_TIMEOUT: 20000
CYPRESS_DEFAULT_COMMAND_TIMEOUT: 40000
CYPRESS_PAGE_LOAD_TIMEOUT: 150000
CYPRESS_RETRIES: 3

- run: npm run test:download:package
env:
CYPRESS_REQUEST_TIMEOUT: 20000
CYPRESS_DEFAULT_COMMAND_TIMEOUT: 40000
CYPRESS_PAGE_LOAD_TIMEOUT: 150000
CYPRESS_RETRIES: 3
Copy link
Member

Choose a reason for hiding this comment

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

Let's run this just once, as a package

Suggested change
- run: npm run test:download
env:
CYPRESS_REQUEST_TIMEOUT: 20000
CYPRESS_DEFAULT_COMMAND_TIMEOUT: 40000
CYPRESS_PAGE_LOAD_TIMEOUT: 150000
CYPRESS_RETRIES: 3
- run: npm run test:download:package
env:
CYPRESS_REQUEST_TIMEOUT: 20000
CYPRESS_DEFAULT_COMMAND_TIMEOUT: 40000
CYPRESS_PAGE_LOAD_TIMEOUT: 150000
CYPRESS_RETRIES: 3
- run: npm run test:download:package
env:
CYPRESS_REQUEST_TIMEOUT: 20000
CYPRESS_DEFAULT_COMMAND_TIMEOUT: 40000
CYPRESS_PAGE_LOAD_TIMEOUT: 150000
CYPRESS_RETRIES: 3

@BenSurgisonGDS BenSurgisonGDS deleted the create-tutorial branch August 24, 2022 09:16
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