summaryrefslogtreecommitdiff
path: root/java/kotlin_test.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2025-01-29 15:53:21 -0800
committer Colin Cross <ccross@android.com> 2025-01-31 11:31:24 -0800
commit844cb6a6646454aaba28b602cf49284df32cdc9f (patch)
tree7c9ee579c7821f59b44e7a035b2a703fa5a2ab08 /java/kotlin_test.go
parent03272a40f104893ae6082aaeb882216fec4eb1f3 (diff)
Add t.Parallel() to java tests
Speeds up go test ./java from 32 seconds to 9 seconds. Test: go test ./java Change-Id: I4c6640e787c0744c6dfda03b7382839b452e24cf
Diffstat (limited to 'java/kotlin_test.go')
-rw-r--r--java/kotlin_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/java/kotlin_test.go b/java/kotlin_test.go
index ad8734d62..3a203358a 100644
--- a/java/kotlin_test.go
+++ b/java/kotlin_test.go
@@ -24,6 +24,7 @@ import (
)
func TestKotlin(t *testing.T) {
+ t.Parallel()
bp := `
java_library {
name: "foo",
@@ -234,6 +235,7 @@ func TestKotlin(t *testing.T) {
for _, tt := range testCases {
t.Run(tt.name, func(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
PrepareForTestWithJavaDefaultModules,
tt.preparer,
@@ -275,6 +277,7 @@ func TestKotlin(t *testing.T) {
}
func TestKapt(t *testing.T) {
+ t.Parallel()
bp := `
java_library {
name: "foo",
@@ -303,6 +306,7 @@ func TestKapt(t *testing.T) {
}
`
t.Run("", func(t *testing.T) {
+ t.Parallel()
ctx, _ := testJava(t, bp)
buildOS := ctx.Config().BuildOS.String()
@@ -384,6 +388,7 @@ func TestKapt(t *testing.T) {
})
t.Run("errorprone", func(t *testing.T) {
+ t.Parallel()
env := map[string]string{
"RUN_ERROR_PRONE": "true",
}
@@ -434,6 +439,7 @@ func TestKapt(t *testing.T) {
}
func TestKaptEncodeFlags(t *testing.T) {
+ t.Parallel()
// Compares the kaptEncodeFlags against the results of the example implementation at
// https://kotlinlang.org/docs/reference/kapt.html#apjavac-options-encoding
tests := []struct {
@@ -484,6 +490,7 @@ func TestKaptEncodeFlags(t *testing.T) {
for i, test := range tests {
t.Run(strconv.Itoa(i), func(t *testing.T) {
+ t.Parallel()
got := kaptEncodeFlags(test.in)
if got != test.out {
t.Errorf("\nwant %q\n got %q", test.out, got)
@@ -493,6 +500,7 @@ func TestKaptEncodeFlags(t *testing.T) {
}
func TestKotlinCompose(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
PrepareForTestWithJavaDefaultModules,
).RunTestWithBp(t, `
@@ -544,6 +552,7 @@ func TestKotlinCompose(t *testing.T) {
}
func TestKotlinPlugin(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
PrepareForTestWithJavaDefaultModules,
).RunTestWithBp(t, `