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

defer integration tests #6007

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

defer integration tests #6007

wants to merge 7 commits into from

Conversation

Geal
Copy link
Contributor

@Geal Geal commented Sep 16, 2024

This adds support for testing @defer in integration tests


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Tests added and passing3
    • Unit Tests
    • Integration Tests
    • Manual Tests

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

Copy link
Contributor

@Geal, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.

@@ -582,7 +582,6 @@ impl IntegrationTest {

let mut request = builder.json(&query).build().unwrap();
telemetry.inject_context(&mut request);
request.headers_mut().remove(ACCEPT);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BrynCooke do you remember why the integration tests were removing the Accept header from the request?

@Geal
Copy link
Contributor Author

Geal commented Sep 16, 2024

interestingly, multer is unable to parse the multipart body we send with defer and subs:

--graphql
content-type: application/json

{"data":null,"errors":[{"message":"HTTP fetch failed from 'accounts': 404: Not Found","path":[],"extensions":{"code":"SUBREQUEST_HTTP_ERROR","service":"accounts","reason":"404: Not Found","http":{"status":404}}},{"message":"HTTP fetch failed from 'accounts': subgraph response does not contain 'content-type' header; expected content-type: application/json or content-type: application/graphql-response+json","path":[],"extensions":{"code":"SUBREQUEST_HTTP_ERROR","service":"accounts","reason":"subgraph response does not contain 'content-type' header; expected content-type: application/json or content-type: application/graphql-response+json","http":{"status":404}}}],"hasNext":true}
--graphql
content-type: application/json

{"hasNext":false}
--graphql--

it fails with the error incomplete multipart stream. Maybe some different assumptions in how we chunk the response?

@Geal
Copy link
Contributor Author

Geal commented Sep 17, 2024

the multer failure was due to a boundary reported as a quoted string

@Geal Geal marked this pull request as ready for review September 17, 2024 08:33
@Geal Geal requested review from a team as code owners September 17, 2024 08:33
@Geal
Copy link
Contributor Author

Geal commented Sep 17, 2024

Supporting subscriptions in those tests would be challenging, as they are not designed to execute tasks asynchronously, so we cannot(for now) use the HTTP callback while we are already waiting for a response. We could have subgraph emulation support websockets though

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.

1 participant