Live data from Hacker News

Our Rails test suite runs in 1 minute on Buildkite

planetscale.com

21–29 of 29 posts

Re: Our Rails test suite runs in 1 minute on Buildkite

#21
"We never run all of our application’s tests in local development. It’s not a good use of time and will never be as fast as running them on CI. "

Actually I've just released something for that. It's a way of running from your local environment extremely quickly (spoiler alert we use non-local servers).

You can check it out at https://brisktest.com/ we have a demo running Jest at the moment but I'm recording a rails demo right now.

Re: Our Rails test suite runs in 1 minute on Buildkite

#22
post #9
post #5

Earlier quoted context omitted.

If you're not programming in Rust and Julia, are you really programming? /s

I thought HN crowd was more into Nim or Zig?

Hell No. Zig is still a relatively new. But if you search Rust on HN, you still see it wins by a very wide margin.

Re: Our Rails test suite runs in 1 minute on Buildkite

#23
post #8

Earlier quoted context omitted.

In the grand scheme of things it doesn't matter that much. Once you starts parallelizing, CI time is: setup_time + (test_run_time / workers), so assuming money isn't a problem you can add more workers as you keep adding more tests. What really matter is how fast you can setup your test workers and how slow individual tests are.

I think your last statement captures something that not often emphasized, which is that startup time of workers and app are variable costs which scale with the amount of parallelization and so if you have a very large test suite there may be a limit where setup eats up so much time that parallelizing more is going to be pretty "wasteful" and I guess that's where the money comes in. Secondly if you're actually trying…

> Unsure if CI services like buildkite have really made this that much faster

Buildkite doesn't directly help with it, but since you bring your own hardware and that it's highly customizable, it does allow you to invest in improving setup time quite dramatically. It's a great product.

Re: Our Rails test suite runs in 1 minute on Buildkite

#24
post #20

Earlier quoted context omitted.

I hear Verona is beautiful this time of year.

Canada is indeed beautiful

(Epic Systems is probably the biggest user of MUMPS in the world, and is headquartered in Verona, Wisconsin.)

Re: Our Rails test suite runs in 1 minute on Buildkite

#25

Earlier quoted context omitted.

How can you tell that if you don't know the complexity of their projects?

This is because RoR projects do not do unit testing, they do integration testing with a real DB. This approach is terrible and causes the poor performance. There are whole sets of testing "tools" for RoR projects that promote this mechanism of testing - if you're testing an API you need to use an external tool to properly hit that API. If you're writing unit tests, write unit tests with mocked dependencies.

Might be a place to bypass fsync/fdatasync via LD_PRELOAD using libeatmydata, it will save hours of CI time without switching DAO or DB configuration.

Re: Our Rails test suite runs in 1 minute on Buildkite

#26
Our Rails test suite runs in about 20 minutes (mostly integration tests) but parallelized on CircleCI with 3 workers it's down to ~6. If I run our entire suite locally on my 8-core macbook I get about 3 minutes but I can't do much with my laptop during that time because my system is monopolized, a colleague of mine runs it on a threadripper and it's sub-2 minutes. So running on Circle is well worth it, I can go top off my coffee, make a snack, answer emails, etc...

Re: Our Rails test suite runs in 1 minute on Buildkite

#27
post #9
post #5

Earlier quoted context omitted.

If you're not programming in Rust and Julia, are you really programming? /s

I thought HN crowd was more into Nim or Zig?

Nim is 14 years old, why don’t you just recommend FORTRAN you graybeard?

Re: Our Rails test suite runs in 1 minute on Buildkite

#28

Earlier quoted context omitted.

How can you tell that if you don't know the complexity of their projects?

This is because RoR projects do not do unit testing, they do integration testing with a real DB. This approach is terrible and causes the poor performance. There are whole sets of testing "tools" for RoR projects that promote this mechanism of testing - if you're testing an API you need to use an external tool to properly hit that API. If you're writing unit tests, write unit tests with mocked dependencies.

Oh the number of times I've run my tests for springboot in which passed, only to fail because of a subtle db issue when hitting the real DB

I'll take hitting real "_test" db anyday

Re: Our Rails test suite runs in 1 minute on Buildkite

#29

"We never run all of our application’s tests in local development. It’s not a good use of time and will never be as fast as running them on CI. " Actually I've just released something for that. It's a way of running from your local environment extremely quickly (spoiler alert we use non-local servers). You can check it out at https://brisktest.com/ we have a demo running Jest at the moment but I'm recording a rails d…

How do I sign up?
Post reply on HN