Skip to content

Commit

Permalink
skip test in Github action
Browse files Browse the repository at this point in the history
  • Loading branch information
cherry-yl-sh committed May 7, 2024
1 parent 248fbc7 commit ea275c3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ func Init(strategyPath string, businessConfigPath string) {
}
logrus.Infof("Environment: %s", envirment.Environment.Name)
logrus.Infof("Debugger: %v", envirment.Environment.Debugger)

logrus.Infof("Action ENV : [%v]", os.Getenv("GITHUB_ACTIONS"))
Engine = routers.SetRouters()
}
4 changes: 4 additions & 0 deletions common/global_const/common_const.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package global_const
import (
"crypto/ecdsa"
"encoding/hex"
mapset "github.com/deckarep/golang-set/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"math/big"
Expand Down Expand Up @@ -37,6 +38,9 @@ var (
DummyCallGasLimit = big.NewInt(21754)
DummyVerificationGasLimit = big.NewInt(391733)
EmptyAddress = common.HexToAddress("0x0000000000000000000000000000000000000000")
GitHubActionWhiteListSet = mapset.NewSet(
"testGetAddressTokenBalance", "Test_OptimismSepoliaV06Verify_TryPayUserOpExecute", "Test_EthereumSepoliaV06Verify_TryPayUserOpExecute", "Test_OptimismSepoliaV06Verify_TryPayUserOpExecute", "Test_BaseSepoliaV06Verify_TryPayUserOpExecute",
"Test_ArbitrumSpeoliaV06Verify_TryPayUserOpExecute")
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion rpc_server/middlewares/rate_limit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func testRateLimitShouldPreventRequestWhenOverDefaultLimit(t *testing.T) {

func testRateLimiterShouldAllowDefaultLimitPerSecond(t *testing.T) {
if os.Getenv("GITHUB_ACTIONS") != "" {
t.Skip()
t.Logf("Skip test in GitHub Actions")
return
}
mockApiKey := "TestingAipKey"
Expand Down
5 changes: 5 additions & 0 deletions service/chain_service/chain_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"math/big"
"os"
"testing"
)

Expand Down Expand Up @@ -81,6 +82,10 @@ func TestChainService(t *testing.T) {
},
}
for _, tt := range tests {
if os.Getenv("GITHUB_ACTIONS") != "" && global_const.GitHubActionWhiteListSet.Contains(tt.name) {
t.Logf("Skip test [%s] in GitHub Actions", tt.name)
continue
}
t.Run(tt.name, tt.test)
}
}
Expand Down

0 comments on commit ea275c3

Please sign in to comment.