Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Add descriptive names to e2e response tapes #1193

Merged
merged 4 commits into from
Mar 28, 2022
Merged

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Mar 28, 2022

Fixes

Fixes #1050 by @sarayourfriend

Description

To make the end-to-end tests less flaky, we save the API responses and re-use them in subsequent tests. This way, the rendered pages use the same data, and should render the same result.

These responses are saved in /test/tapes/ folder as response-<number>.json5. When trying to fix the end-to-end tests on #1159, I had difficulties debugging. It is unclear, which files are changed when you run e2e tests with:update-tapes.

The main changes in this PR are in test/proxy.js file, and the rest of the 300+ file changes are just the renaming and date updates.

This PR uses requestType_mediaType_queryOrUuid_connectionHeader pattern:

  • thumbs: thumb_audio_4f5c37fd-e6ba-4aa8-b06a-529aed468ca4_closed.json5
  • related: related_images_e9d97a98-621b-4ec2-bf70-f47a74380452_keep-alive.json5
  • search: search_images_q=243f6a8885a308d3.json5
  • detail responses: detail_images_802d76cd-84cf-45bc-81ac-610331dab420.json5

While working on this PR, I noticed had the same url, but differed in their connection headers and compression. When I was saving only one out of these two variants, e2e tests were failing, so I added connection suffix to the tape file names.

I'm setting the priority here as 'high' because I can't get the e2e tests to pass in #1159 without this change.

Testing Instructions

The e2e tests in CI should pass.
If you run pnpm test:playwright:update-tapes, the tests should pass, and no new tapes should be added.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@obulat obulat added 🟧 priority: high Stalls work on the project or its dependents 💻 aspect: code Concerns the software code in the repository 🧰 goal: internal improvement Improvement that benefits maintainers, not users labels Mar 28, 2022
@obulat obulat requested a review from a team as a code owner March 28, 2022 12:25
Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

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

To me it would've made more sense to use the operation names from the API as the tape names.

image

For example a tape for audio detail could have audio as the media type / audio_detail as the operation / <identifier> as the param, making the tape name
audio__audio_detail__<identifier>.

But that's just opinion. This works well so I don't mind.

@obulat obulat requested review from krysal and removed request for sarayourfriend March 28, 2022 15:47
Copy link
Member

@zackkrida zackkrida left a comment

Choose a reason for hiding this comment

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

I quite like the new names, especially after the updates made today.

@obulat obulat merged commit e33d638 into main Mar 28, 2022
@obulat obulat deleted the descriptive_e2e_tape_names branch March 28, 2022 16:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 aspect: code Concerns the software code in the repository 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟧 priority: high Stalls work on the project or its dependents
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Give talkback tapes more descriptive names
3 participants