Ugh, another discussion about tests and the person wants to remove all "destroy tables at the end of the test" step, 'cause "tests are slow".

If your tests are slow, your system is slow. Fucking up tests won't solve this.

Oh, {deity}.

"I want to increase coverage, but with those slow tests, it is impossible."

I mean, this is all the sort of trigger warning I have about tests...

(The ones that always gets me in trouble 'cause "the internet says it is not so".)

I'm so happy this whole discussion have nothing to do with my project.

My project currently have only 44% coverage, although I'm pretty sure it says absolutely nothing 'cause there are still thousands and business rules that don't have tests -- only tests going through the lines of code, which says nothing.

But going from 0% to 44% gives me enough hope to actually put MyPy to check types now.

@juliobiason Sounds like the "it's cheaper to buy a new house than do the dishes" sort of thinking.

@Gargron Dunno. Maybe the framework does.

But it kills me that the solution for "tests are slow" is "let's set a whole state before every test and never clean up after each one" and not "Hm.... if our tests are slow, maybe our system is slow".

@Gargron (Actually, "set a state before all tests and never clean up after each one". I mean, it's not some fixture that they want to use for every test.)


"The tests are slow" is such a minor problem. I'd much rather deal with "the tests are slow" than "there are no test".

@juliobiason "The tests are slow" is an excuse to get a coffee or something.

@juliobiason What you said about business rules is important. Business rules should have tests

@juliobiason Truncate, or just have a job that clears them separate of the tests? Or why are you even doing tests on persistent tables in the first place? I'd think those tables only needed to exist as long as a container exists.

Sign in to participate in the conversation
Functional Café

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!