Skip to content

Commit

Permalink
test: reduced crosschain test modules (#262)
Browse files Browse the repository at this point in the history
Co-authored-by: fx0x55 <80245546+fx0x55@users.noreply.github.com>
  • Loading branch information
zakir-code and fx0x55 authored Mar 11, 2024
1 parent 3d78062 commit 19c12a9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ jobs:
env:
TEST_INTEGRATION: true

- name: Run TestCrosschainKeeperTestSuite
run: go test -mod=readonly -v -run TestCrosschainKeeperTestSuite ./x/crosschain/...
env:
TEST_INTEGRATION: true
19 changes: 15 additions & 4 deletions x/crosschain/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package keeper_test
import (
"crypto/ecdsa"
"fmt"
"os"
"reflect"
"regexp"
"testing"
Expand Down Expand Up @@ -43,17 +44,27 @@ type KeeperTestSuite struct {
chainName string
}

func TestKeeperTestSuite(t *testing.T) {
func TestCrosschainKeeperTestSuite(t *testing.T) {
compile := regexp.MustCompile("^Test")
subModules := []string{
bsctypes.ModuleName,
polygontypes.ModuleName,
mustTestModule := []string{
trontypes.ModuleName,
}
otherModules := []string{
ethtypes.ModuleName,
bsctypes.ModuleName,
polygontypes.ModuleName,
avalanchetypes.ModuleName,
arbitrumtypes.ModuleName,
optimismtypes.ModuleName,
}

subModules := mustTestModule
if os.Getenv("TEST_INTEGRATION") != "true" {
subModules = append(subModules, otherModules[tmrand.Int63n(int64(len(otherModules)))])
} else {
subModules = append(subModules, otherModules...)
}

for _, moduleName := range subModules {
methodFinder := reflect.TypeOf(new(KeeperTestSuite))
for i := 0; i < methodFinder.NumMethod(); i++ {
Expand Down

0 comments on commit 19c12a9

Please sign in to comment.