3 ms·
Ask HN: How do you handle an unwieldy test suite?
IIRC, if one were to follow TDD principles appropriately, it requires you to run tests and run tests often while you work on a change to the codebase. My problem is that I joined a team that has pretty spotty test suite that can run extremely slow at times (it's a Python project that uses pytest). It could take 30-40 minutes for just a single run of the suite.
What ends up happening is that team members (myself included), unfortunately put tests on a backburner only up until it's time to submit a pull request to master, and at that time it reveals that their changes are breaking tests all over the place. Fixing them all could take a whole day's worth of work just to get everything in line.
I have to assume there's got to be a better way of going about this. We are all trying to improve the test suite as we go along, but "improve" seems to kind of a moving target as no one on the team really has strong knowledge of how to write a test suite that is fast and comprehensive and maintainable. Personally, I've been scouring the internet for resources that can touch on this at a deep level, but I've come up short.
Does anyone have any tips for handling this?
- itamarst 9y agoWhat is the test suite spending its time on? CPU? Waiting for a database? `time.sleep()`?