At Ajourney (YC S22), we recognized early on that CI (Continuous Integration) could become a productivity bottleneck if not properly planned. Here’s the playbook we follow: - Utilize Postgres Template Database: We test against a real database to catch real-world cases. - Utilize Vitest Shards: Automatically distribute test cases among N CI jobs. As of today, we have 2,295 unit test cases, each testing against 𝐚 𝐫𝐞𝐚𝐥 𝐢𝐬𝐨𝐥𝐚𝐭𝐞𝐝 𝐝𝐚𝐭𝐚𝐛𝐚𝐬𝐞, which: - Takes about 2.6 minutes to complete locally. - Takes about 6 minutes to complete in CI. Without these optimizations, we would face over 30 minutes of waiting time for each deployment. We're glad we planned ahead. Can this be improved? Absolutely. Engineering is about continuous improvement.
Cayter Goh Do you only run unit tests, or others tests like UI smoke and API smoke also run
Good thing: My tests complete running in under a minute. Bad thing: I only have 5 tests.
Thanks for sharing this Cayter Goh . Its v insightful If u dm sharing when u test against a real isolated db did u create mock data or replicate the data from dev to test.
Wow thousands of unitest, gamma didn’t have so many 😜
Co-Founder at NodeFlair (S22) | adriangohjw.com
1moYou can get it down to zero minutes if you delete all the tests