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

misc: receive afterSpec durations from app capture code, and report them to the Cloud API #29500

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from

Conversation

cacieprins
Copy link
Contributor

@cacieprins cacieprins commented May 9, 2024

  • Closes

Additional details

Because of the bifurcation of Test Replay capture/upload logic, the durations that are recorded in the afterSpec process will be returned from the protocol capture codebase' afterSpec method. They're collected and reported to the updateInstanceArtifacts Cloud API endpoint.

Steps to test

Verify that, once the related services PR is merged and released, these durations are reported to the update instance artifacts endpoint when recording a spec with Test Replay enabled. When running against staging, these durations should be queryable in Honeycomb.

How has the user experience changed?

PR Tasks

@@ -289,6 +290,9 @@ export type ProtocolMetadata = ArtifactMetadata & {
size: number
offset: number
}
afterSpecDurations?: AfterSpecDurations & {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

AfterSpecDurations is the shape that the protocol capture codebase will return; we're augmenting that with the total duration of afterSpec, so the shape is modified here.

@cacieprins cacieprins marked this pull request as ready for review May 20, 2024 16:13
@cacieprins cacieprins marked this pull request as draft May 20, 2024 17:53
@cacieprins cacieprins marked this pull request as ready for review May 20, 2024 18:06
Copy link

cypress bot commented May 20, 2024

4 flaky tests on run #55569 ↗︎

0 29255 1328 0 Flakiness 4

Details:

fix return sig of protocol afterSpec stub for system tests
Project: cypress Commit: ce66723b0f
Status: Passed Duration: 20:08 💡
Started: May 23, 2024 7:46 PM Ended: May 23, 2024 8:06 PM
Flakiness  waiting.cy.js • 1 flaky test • 5x-driver-chrome:beta

View Output

Test Artifacts
... > errors > throws when waiting for 2nd response to route Test Replay
Flakiness  net_stubbing.cy.ts • 3 flaky tests • 5x-driver-webkit

View Output

Test Artifacts
network stubbing > intercepting request > can delay and throttle a StaticResponse
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <a href="https://cloud.cypress.io/projects/ypt4pf/runs/55569/overview/8ed5f707-3fa6-404b-aa25-c080e584c6cc?reviewViewBy=FLAKY&utm_source=github&utm_medium=flaky&utm_campaign=view%20test">
        ... > with `resourceType` > can match a proxied image request by resourceType
      </a>
    </td>
    <td>
      
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <a href="https://cloud.cypress.io/projects/ypt4pf/runs/55569/overview/8796ef8e-b04a-41d0-97e4-5be0b63570b2?reviewViewBy=FLAKY&utm_source=github&utm_medium=flaky&utm_campaign=view%20test">
        ... > stops waiting when an xhr request is canceled
      </a>
    </td>
    <td>
      
    </td>
  </tr></table>

Review all test suite changes for PR #29500 ↗︎

Co-authored-by: Ryan Manuel <ryanm@cypress.io>
@cacieprins cacieprins requested a review from mschile May 23, 2024 15:24
await this.invokeAsync('afterSpec', { isEssential: true })
const startTime = performance.now() + performance.timeOrigin

debug({ startTime })
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we have a description here around what this is?

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 think this debug can be removed- the important debug is on L191

fileSize: number | bigint
specAccess: ReturnType<AppCaptureProtocolInterface['getDbMetadata']>
} | undefined> {
async uploadCaptureArtifact ({ uploadUrl, fileSize, filePath }: CaptureArtifact, captureErrorsOverride?: boolean) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is captureErrorsOverride just used for testing purposes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. Could refactor a bit to have caller pass in the env var to make things a little cleaner.

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.

None yet

3 participants