Skip to content

Commit b9340b6

Browse files
committed
feat: speed up integration tests
1 parent 56ac9f9 commit b9340b6

26 files changed

Lines changed: 158 additions & 144 deletions

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,19 @@ Sample skips:
154154
- `"Get/invalid_name"` skips the "invalid name" test for Get standard method.
155155
- `"Get"` skips all tests for a Get standard method.
156156

157+
### Parallel tests
158+
159+
The `*testing.T` passed to each config provider method is the subtest's
160+
`*testing.T`. To run resource tests in parallel, call `t.Parallel()` at the top
161+
of each provider method:
162+
163+
```go
164+
func (a *myTests) FreightServiceShipper(t *testing.T) *examplefreightv1.FreightServiceShipperTestSuiteConfig {
165+
t.Parallel()
166+
// ...
167+
}
168+
```
169+
157170
## Suites
158171

159172
<!-- BEGIN suites -->

internal/aiptest/list/deleted.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ var deleted = suite.Test{
2828
listMethod.Output.Desc,
2929
scope.Resource,
3030
).Name()))
31-
f.P("const deleteCount = 5")
31+
// deleteCount needs to be lower than the resourcesCounts in list.go
32+
f.P("const deleteCount = 3")
3233
f.P("for i := 0; i < deleteCount; i++ {")
3334
util.MethodDelete{
3435
Method: deleteMethod,

internal/aiptest/list/list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var withResourcesGroup = suite.TestGroup{
2929
onlyif.HasParent,
3030
),
3131
GenerateBefore: func(f *protogen.GeneratedFile, scope suite.Scope) error {
32-
f.P("const resourcesCount = 15")
32+
f.P("const resourcesCount = 5")
3333
f.P("parent := ", ident.FixtureNextParent, "(t, true)")
3434
f.P("parentMsgs := make([]*", scope.Message.GoIdent, ", resourcesCount)")
3535
f.P("for i := 0; i < resourcesCount; i++ {")
@@ -53,7 +53,7 @@ var withDeletedResourcesGroup = suite.TestGroup{
5353
onlyif.HasParent,
5454
),
5555
GenerateBefore: func(f *protogen.GeneratedFile, scope suite.Scope) error {
56-
f.P("const resourcesCount = 15")
56+
f.P("const resourcesCount = 5")
5757
f.P("parent := ", ident.FixtureNextParent, "(t, true)")
5858
f.P("parentMsgs := make([]*", scope.Message.GoIdent, ", resourcesCount)")
5959
f.P("for i := 0; i < resourcesCount; i++ {")

proto/gen/einride/example/freight/v1/freight_service_aiptest.pb.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/gen/googleapis/aiplatform/apiv1/aiplatformpb/dataset_service_aiptest.pb.go

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/gen/googleapis/aiplatform/apiv1/aiplatformpb/deployment_resource_pool_service_aiptest.pb.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/gen/googleapis/aiplatform/apiv1/aiplatformpb/endpoint_service_aiptest.pb.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/gen/googleapis/aiplatform/apiv1/aiplatformpb/feature_online_store_admin_service_aiptest.pb.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/gen/googleapis/aiplatform/apiv1/aiplatformpb/feature_registry_service_aiptest.pb.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)