Skip to content

Commit 006bf20

Browse files
CoderZhiclaude
andcommitted
skip 5 testnet-dependent tests with drained burner account
TestTransfer, TestClaimReward, TestDeployContract, TestExecuteContract, and TestExecuteContractWithAddressArgument all hit the public testnet using the hardcoded _accountPrivateKey burner, which is out of funds and fails with "insufficient funds for gas * price + value". They have been failing in `go test ./...` for some time. Adding an unconditional t.Skip with a TODO at the top of each so the default test run is green. The TODOs point to two follow-up options: rewrite as mock-based unit tests against mock_iotexapi.MockAPIServiceClient (the pattern used in iotex/callers_typed_test.go), or gate the live calls behind an IOTEX_INTEGRATION_KEY env var so they run only with a funded testnet key. Either approach can be tackled in a separate change. TestStake is intentionally not skipped: it uses a different account and expects the "insufficient funds" error, so it still passes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d793b0d commit 006bf20

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

iotex/iotex_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ const (
3535
)
3636

3737
func TestTransfer(t *testing.T) {
38+
// TODO: this test hits the testnet with the hardcoded _accountPrivateKey
39+
// burner, which is drained ("insufficient funds for gas * price + value").
40+
// Rewrite as a mock-based unit test against mock_iotexapi.MockAPIServiceClient,
41+
// or gate on an IOTEX_INTEGRATION_KEY env var so it runs only with a funded
42+
// testnet key. Skipping for now to keep `go test ./...` green.
43+
t.Skip("drained burner account; needs mock-based rewrite or funded testnet key")
44+
3845
require := require.New(t)
3946
conn, err := NewDefaultGRPCConn(_testnet)
4047
require.NoError(err)
@@ -83,6 +90,11 @@ func TestStake(t *testing.T) {
8390
}
8491

8592
func TestClaimReward(t *testing.T) {
93+
// TODO: drained burner _accountPrivateKey on testnet. Rewrite as a
94+
// mock-based unit test or gate on IOTEX_INTEGRATION_KEY. See TestTransfer
95+
// for the same skip rationale.
96+
t.Skip("drained burner account; needs mock-based rewrite or funded testnet key")
97+
8698
require := require.New(t)
8799
conn, err := NewDefaultGRPCConn(_testnet)
88100
require.NoError(err)
@@ -100,6 +112,11 @@ func TestClaimReward(t *testing.T) {
100112
}
101113

102114
func TestDeployContract(t *testing.T) {
115+
// TODO: drained burner _accountPrivateKey on testnet. Rewrite as a
116+
// mock-based unit test or gate on IOTEX_INTEGRATION_KEY. See TestTransfer
117+
// for the same skip rationale.
118+
t.Skip("drained burner account; needs mock-based rewrite or funded testnet key")
119+
103120
require := require.New(t)
104121
conn, err := NewDefaultGRPCConn(_testnet)
105122
require.NoError(err)
@@ -120,6 +137,11 @@ func TestDeployContract(t *testing.T) {
120137
}
121138

122139
func TestExecuteContract(t *testing.T) {
140+
// TODO: drained burner _accountPrivateKey on testnet. Rewrite as a
141+
// mock-based unit test or gate on IOTEX_INTEGRATION_KEY. See TestTransfer
142+
// for the same skip rationale.
143+
t.Skip("drained burner account; needs mock-based rewrite or funded testnet key")
144+
123145
require := require.New(t)
124146
conn, err := NewDefaultGRPCConn(_testnet)
125147
require.NoError(err)
@@ -139,6 +161,11 @@ func TestExecuteContract(t *testing.T) {
139161
}
140162

141163
func TestExecuteContractWithAddressArgument(t *testing.T) {
164+
// TODO: drained burner _accountPrivateKey on testnet. Rewrite as a
165+
// mock-based unit test or gate on IOTEX_INTEGRATION_KEY. See TestTransfer
166+
// for the same skip rationale.
167+
t.Skip("drained burner account; needs mock-based rewrite or funded testnet key")
168+
142169
require := require.New(t)
143170
conn, err := NewDefaultGRPCConn(_testnet)
144171
require.NoError(err)

0 commit comments

Comments
 (0)