47
you are viewing a single comment's thread
view the rest of the comments
[-] AlecSadler@sh.itjust.works -1 points 6 months ago

I worked for a company that required 95% code coverage but simultaneously complained about how slow tests ran.

🤷‍♂️

[-] lysdexic@programming.dev 2 points 6 months ago

Why do you think test times are proportional to coverage rates?

[-] AlecSadler@sh.itjust.works 1 points 6 months ago

When you have 1000+ Cypress tests, for example, it takes time to run, plain and simple.

Now, if they were simple unit tests, sure, one could run thousands in a second or two, but they aren't. Even headless, these just took time.

[-] lysdexic@programming.dev 1 points 6 months ago* (last edited 6 months ago)

When you have 1000+ Cypress tests, for example, it takes time to run, plain and simple.

It's one thing to claim that tests need time to run.

It's an entirely different thing to claim that the time it takes to run tests is proportional to test coverage.

More often than not, you have massively expensive and naive test fixtures in place that act as performance boat anchors and are massive bottlenecks. Thousands of tests run instantly if each test takes around a few milliseconds to run. For perspective, the round trip of network request that crosses the world is around a couple of hundreds of milliseconds. A thousand of sequential requests takes only a couple of minutes. If each of your tests takes that long to run, your tests are fundamentally broken.

[-] AlecSadler@sh.itjust.works 1 points 6 months ago
this post was submitted on 05 Apr 2024
47 points (94.3% liked)

Programming

17248 readers
319 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS