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

chore: separate unit and integration tests #1567

Merged
merged 18 commits into from
Aug 12, 2022

Conversation

n1ru4l
Copy link
Collaborator

@n1ru4l n1ru4l commented Aug 9, 2022

  • Integration tests must be placed within __integration-tests__
  • Run integration tests via yarn test:integration
  • Use free ports so integration tests can be run in parallel
  • All tests that don't require running as integration tests now use yoga.fetch
  • Remove the repetitive "should" word from test names
  • "unit" tests are now placed within __tests__ folders
  • replace inconsistent .test.ts extensions with .spec.ts
  • split tests into smaller files
  • make all tests as contained as possible (so no context or file switching is required for understanding the test)

closes #1526

@changeset-bot
Copy link

changeset-bot bot commented Aug 9, 2022

🦋 Changeset detected

Latest commit: 1684b24

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 31 packages
Name Type
graphql-yoga Patch
@graphql-yoga/common Patch
@graphql-yoga/node Patch
apollo-federation-gateway-with-yoga Patch
apollo-subgraph-with-yoga Patch
example-azure-function Patch
example-cloudflare-advanced Patch
example-cloudflare-modules Patch
example-defer-stream Patch
example-error-handling Patch
example-express Patch
example-fastify-modules Patch
example-fastify Patch
example-file-upload-nextjs-pothos Patch
example-file-upload-nexus Patch
example-file-upload Patch
example-generic-auth Patch
example-graphql-config Patch
example-hackernews Patch
example-hello-world Patch
example-koa Patch
example-live-query Patch
example-nextjs-auth Patch
example-nextjs Patch
example-node-esm Patch
example-redis-pub-sub Patch
example-service-worker Patch
example-subscriptions Patch
example-sveltekit Patch
hello-world-benchmark Patch
graphql-lambda Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2022

❌ Benchmark Failed

Failed assertions detected

If the performance regression is expected, please increase the failing threshold.

     ✗ no_errors
      ↳  0% — ✓ 0 / ✗ 47731
     ✗ expected_result
      ↳  0% — ✓ 0 / ✗ 47731

     checks.....................: 0.00%   ✓ 0           ✗ 95462
     data_received..............: 13 MB   417 kB/s
     data_sent..................: 5.5 MB  183 kB/s
     http_req_blocked...........: avg=1.89µs   min=1µs      med=1.5µs    max=963.26µs p(90)=2.4µs    p(95)=3.1µs   
     http_req_connecting........: avg=3ns      min=0s       med=0s       max=154.81µs p(90)=0s       p(95)=0s      
   ✓ http_req_duration..........: avg=513.71µs min=315.02µs med=417.22µs max=22.46ms  p(90)=605.04µs p(95)=802.6µs 
     http_req_failed............: 100.00% ✓ 47731       ✗ 0    
     http_req_receiving.........: avg=32.59µs  min=13.6µs   med=25.1µs   max=6.23ms   p(90)=41.1µs   p(95)=50.2µs  
     http_req_sending...........: avg=12.05µs  min=5.3µs    med=8.6µs    max=4.73ms   p(90)=15.3µs   p(95)=17.5µs  
     http_req_tls_handshaking...: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...........: avg=469.05µs min=288.72µs med=378.52µs max=22.07ms  p(90)=551.63µs p(95)=733.95µs
     http_reqs..................: 47731   1590.915685/s
     iteration_duration.........: avg=621.3µs  min=377.92µs med=515.23µs max=22.8ms   p(90)=739.85µs p(95)=958.91µs
     iterations.................: 47731   1590.915685/s
     vus........................: 1       min=1         max=1  
     vus_max....................: 1       min=1         max=1  

@n1ru4l n1ru4l marked this pull request as draft August 10, 2022 07:33
@n1ru4l n1ru4l force-pushed the chore-separate-unit-and-integration-tests branch from 324a323 to 653ac95 Compare August 10, 2022 09:27
@n1ru4l n1ru4l marked this pull request as ready for review August 10, 2022 09:45
@n1ru4l n1ru4l requested review from ardatan and saihaj August 10, 2022 09:52
@n1ru4l n1ru4l force-pushed the chore-separate-unit-and-integration-tests branch from 2df2190 to 51c18a7 Compare August 10, 2022 11:13
@github-actions
Copy link
Contributor

The latest changes of this PR are not available as canary, since there are no linked changesets for this PR.

@ardatan
Copy link
Collaborator

ardatan commented Aug 10, 2022

Looks way better!

@n1ru4l n1ru4l merged commit e7a47b5 into v3 Aug 12, 2022
@n1ru4l n1ru4l deleted the chore-separate-unit-and-integration-tests branch August 12, 2022 09:40
This was referenced Sep 21, 2022
@saihaj saihaj mentioned this pull request Oct 17, 2022
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

4 participants