News for hackers. Stuff that matters.
Re:I Write Tests in Go by coffeebeqn on Wednesday April 10, 2024 @09:38PM (#39997582)
So unless I pepper every test and subtest with t.Parallel() it will always run sequentially ? I gotta try that. Also I wish I could just declare that once
Re:I Write Tests in Go by rickette on Wednesday April 10, 2024 @11:26PM (#39998126)
Tests inside one _test.go file are run sequentially by default, but Go does run tests in parallel across packages.
Re:I Write Tests in Go by hdra on Wednesday April 10, 2024 @11:44PM (#39998196)
what about multiple _test.go files belonging to the same package? and how does this work with "sub-packages"?
Re:I Write Tests in Go by 4death4 on Wednesday April 10, 2024 @10:22PM (#39997786)
If you use suites you can run t.Parallel() once for the entire suite.
Re:I Write Tests in Go by kbolino on Thursday April 11, 2024 @09:07AM (#40001673)
You should wait until you actually need it. Parallel tests can produce interleaved output.