Skip to content

Commit 592e081

Browse files
authored
Merge pull request #878 from onflow/bastian/parallelize-tests
Parallelize tests
2 parents 7ef2fce + 5702cbe commit 592e081

File tree

7 files changed

+27
-0
lines changed

7 files changed

+27
-0
lines changed

adapters/access_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ func accessTest(f func(t *testing.T, adapter *AccessAdapter, emu *mocks.MockEmul
5454

5555
func TestAccess(t *testing.T) {
5656

57+
t.Parallel()
58+
5759
t.Run("Ping", accessTest(func(t *testing.T, adapter *AccessAdapter, emu *mocks.MockEmulator) {
5860
emu.EXPECT().
5961
Ping().

adapters/sdk_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ func sdkTest(f func(t *testing.T, adapter *SDKAdapter, emu *mocks.MockEmulator))
5555

5656
func TestSDK(t *testing.T) {
5757

58+
t.Parallel()
59+
5860
t.Run("Ping", sdkTest(func(t *testing.T, adapter *SDKAdapter, emu *mocks.MockEmulator) {
5961
emu.EXPECT().
6062
Ping().

emulator/script_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ func TestScriptExecutionLimit(t *testing.T) {
252252
// within a script
253253
func TestScriptWithCadenceRandom(t *testing.T) {
254254

255+
t.Parallel()
256+
255257
//language=cadence
256258
code := `
257259
access(all)
@@ -273,6 +275,9 @@ func TestScriptWithCadenceRandom(t *testing.T) {
273275

274276
// TestEVM checks evm functionality
275277
func TestEVM(t *testing.T) {
278+
279+
t.Parallel()
280+
276281
serviceAddr := flowgo.Emulator.Chain().ServiceAddress()
277282
code := []byte(fmt.Sprintf(
278283
`

emulator/transaction_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,6 +2161,9 @@ func TestRollbackTransaction(t *testing.T) {
21612161
// TestTransactionWithCadenceRandom checks Cadence's random function works
21622162
// within a transaction
21632163
func TestTransactionWithCadenceRandom(t *testing.T) {
2164+
2165+
t.Parallel()
2166+
21642167
b, adapter := setupTransactionTests(t)
21652168

21662169
code := `

server/server_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ import (
3535
)
3636

3737
func TestNoPersistence(t *testing.T) {
38+
t.Parallel()
39+
3840
logger := zerolog.Nop()
3941

4042
dbPath := "test_no_persistence"
@@ -54,6 +56,8 @@ func TestNoPersistence(t *testing.T) {
5456
}
5557

5658
func TestPersistenceWithPersistFlag(t *testing.T) {
59+
t.Parallel()
60+
5761
logger := zerolog.Nop()
5862

5963
dbPath := "test_persistence"
@@ -73,6 +77,8 @@ func TestPersistenceWithPersistFlag(t *testing.T) {
7377
}
7478

7579
func TestPersistenceWithSnapshotFlag(t *testing.T) {
80+
t.Parallel()
81+
7682
logger := zerolog.Nop()
7783

7884
dbPath := "test_persistence_with_snapshot"
@@ -92,6 +98,7 @@ func TestPersistenceWithSnapshotFlag(t *testing.T) {
9298
}
9399

94100
func TestExecuteScript(t *testing.T) {
101+
t.Parallel()
95102

96103
logger := zerolog.Nop()
97104
server := NewEmulatorServer(&logger, &Config{})
@@ -114,6 +121,8 @@ func TestExecuteScript(t *testing.T) {
114121
}
115122

116123
func TestExecuteScriptImportingContracts(t *testing.T) {
124+
t.Parallel()
125+
117126
conf := &Config{
118127
WithContracts: true,
119128
}
@@ -144,6 +153,7 @@ func TestExecuteScriptImportingContracts(t *testing.T) {
144153
}
145154

146155
func TestCustomChainID(t *testing.T) {
156+
t.Parallel()
147157

148158
conf := &Config{
149159
WithContracts: true,
@@ -159,6 +169,8 @@ func TestCustomChainID(t *testing.T) {
159169
}
160170

161171
func TestScheduledCallback_IncrementsCounter(t *testing.T) {
172+
t.Parallel()
173+
162174
logger := zerolog.Nop()
163175
conf := &Config{
164176
WithContracts: true,

storage/checkpoint/checkpoint_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ import (
5151

5252
func Test_Checkpoint_Storage(t *testing.T) {
5353

54+
t.Parallel()
55+
5456
dir := t.TempDir()
5557

5658
chainID := flowsdk.Emulator

storage/store_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ func TestTransactions(t *testing.T) {
192192

193193
func TestFullCollection(t *testing.T) {
194194
t.Parallel()
195+
195196
store, dir := setupStore(t)
196197
defer func() {
197198
require.NoError(t, store.Close())

0 commit comments

Comments
 (0)