Skip to content

Commit 91bcf3e

Browse files
committed
chore: native parallel tests
1 parent 3b94ffd commit 91bcf3e

File tree

6 files changed

+14
-237
lines changed

6 files changed

+14
-237
lines changed

.github/workflows/framework-golden-tests.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ jobs:
4545
timeout: 10m
4646
- name: TestTonSmoke
4747
config: smoke_ton.toml
48-
count: 1
49-
timeout: 10m
50-
- name: TestTonParallel
51-
config: parallel_ton.toml
52-
count: 1
48+
count: 3
5349
timeout: 10m
5450
- name: TestUpgrade
5551
config: upgrade.toml

framework/components/blockchain/ton.go

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,16 @@ func generateUniquePortsFromBase(basePort string) (*hostPortMapping, error) {
120120
return nil, fmt.Errorf("invalid base port %s: %w", basePort, err)
121121
}
122122

123-
// use larger multipliers to ensure no overlap between different base ports
124-
// 8000->0, 8001->100, 8002->200, etc.
125-
portMultiplier := (base - DefaultTonSimpleServerPort) * 100
126-
127123
mapping := &hostPortMapping{
128124
SimpleServer: basePort,
129-
HTTPAPIPort: strconv.Itoa(DefaultTonHTTPAPIPort + portMultiplier),
130-
ExplorerPort: strconv.Itoa(DefaultTonTONExplorerPort + portMultiplier),
131-
IndexAPIPort: strconv.Itoa(DefaultTonIndexAPIPort + portMultiplier),
132-
FaucetPort: strconv.Itoa(DefaultTonFaucetPort + portMultiplier),
133-
LiteServer: strconv.Itoa(DefaultTonLiteServerPort + portMultiplier),
134-
DHTServer: strconv.Itoa(DefaultTonDhtServerPort + portMultiplier),
135-
Console: strconv.Itoa(DefaultTonValidatorConsolePort + portMultiplier),
136-
ValidatorUDP: strconv.Itoa(DefaultTonValidatorPublicPort + portMultiplier),
125+
HTTPAPIPort: strconv.Itoa(base + 10),
126+
ExplorerPort: strconv.Itoa(base + 20),
127+
IndexAPIPort: strconv.Itoa(base + 30),
128+
FaucetPort: strconv.Itoa(base + 40),
129+
LiteServer: strconv.Itoa(base + 50),
130+
DHTServer: strconv.Itoa(base + 60),
131+
Console: strconv.Itoa(base + 70),
132+
ValidatorUDP: strconv.Itoa(base + 80),
137133
}
138134

139135
return mapping, nil

framework/examples/myproject/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ require (
1313
github.com/blocto/solana-go-sdk v1.30.0
1414
github.com/ethereum/go-ethereum v1.15.0
1515
github.com/go-resty/resty/v2 v2.16.3
16+
github.com/hashicorp/consul/sdk v0.16.2
1617
github.com/smartcontractkit/chainlink-testing-framework/framework v0.8.9
1718
github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2
1819
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10

framework/examples/myproject/parallel_ton.toml

Lines changed: 0 additions & 24 deletions
This file was deleted.

framework/examples/myproject/parallel_ton_test.go

Lines changed: 0 additions & 196 deletions
This file was deleted.

framework/examples/myproject/smoke_ton_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ package examples
22

33
import (
44
"fmt"
5+
"strconv"
56
"strings"
67
"testing"
78

9+
"github.com/hashicorp/consul/sdk/freeport"
810
"github.com/stretchr/testify/require"
11+
912
"github.com/xssnick/tonutils-go/liteclient"
1013
"github.com/xssnick/tonutils-go/ton"
1114
"github.com/xssnick/tonutils-go/ton/wallet"
@@ -22,6 +25,7 @@ func TestTonSmoke(t *testing.T) {
2225
in, err := framework.Load[CfgTon](t)
2326
require.NoError(t, err)
2427

28+
in.BlockchainA.Port = strconv.Itoa(freeport.GetOne(t))
2529
bc, err := blockchain.NewBlockchainNetwork(in.BlockchainA)
2630
require.NoError(t, err)
2731

0 commit comments

Comments
 (0)