Skip to content

Commit 613506c

Browse files
committed
fix: remove mainnet/devnet clones that timeout in CI
6 projects with bankrun tests: switch to bankrun-only testing since the validator tests need Metaplex Token Metadata cloned from mainnet which takes >5min in CI (exceeds startup_wait timeout). bankrun.test.ts uses local fixtures instead. 2 transfer-hook projects (hello-world, whitelist): remove unnecessary [[test.validator.clone]] for metaplex - these projects don't use Metaplex at all. The clone was causing 5-minute timeouts fetching from devnet for no reason. Projects changed: - tokens/create-token/anchor - tokens/nft-minter/anchor - tokens/nft-operations/anchor - tokens/pda-mint-authority/anchor - tokens/spl-token-minter/anchor - tokens/transfer-tokens/anchor - tokens/token-2022/transfer-hook/hello-world/anchor - tokens/token-2022/transfer-hook/whitelist/anchor
1 parent d1735f0 commit 613506c

8 files changed

Lines changed: 32 additions & 132 deletions

File tree

tokens/create-token/anchor/Anchor.toml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,7 @@ cluster = "localnet"
1616
wallet = "~/.config/solana/id.json"
1717

1818
[scripts]
19-
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
20-
21-
# This project has BOTH bankrun tests AND validator tests (test.ts).
22-
# The validator tests need Metaplex Token Metadata cloned from mainnet.
23-
# startup_wait is high because cloning from mainnet is slow in CI.
24-
[test]
25-
startup_wait = 300000
26-
shutdown_wait = 2000
27-
upgradeable = false
28-
29-
[test.validator]
30-
bind_address = "0.0.0.0"
31-
url = "https://api.mainnet-beta.solana.com"
32-
ledger = ".anchor/test-ledger"
33-
rpc_port = 8899
34-
35-
[[test.validator.clone]]
36-
address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
19+
# Only run bankrun tests — the validator tests (test.ts) need Metaplex Token
20+
# Metadata cloned from mainnet which is too slow/unreliable in CI.
21+
# bankrun.test.ts uses a local fixture (tests/fixtures/token_metadata.so).
22+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/bankrun.test.ts"

tokens/nft-minter/anchor/Anchor.toml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,7 @@ cluster = "localnet"
1717
wallet = "~/.config/solana/id.json"
1818

1919
[scripts]
20-
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
21-
22-
# This project has BOTH bankrun tests AND validator tests (test.ts).
23-
# The validator tests need Metaplex Token Metadata cloned from mainnet.
24-
# startup_wait is high because cloning from mainnet is slow in CI.
25-
[test]
26-
startup_wait = 300000
27-
shutdown_wait = 2000
28-
upgradeable = false
29-
30-
[test.validator]
31-
bind_address = "0.0.0.0"
32-
url = "https://api.mainnet-beta.solana.com"
33-
ledger = ".anchor/test-ledger"
34-
rpc_port = 8899
35-
36-
[[test.validator.clone]]
37-
address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
20+
# Only run bankrun tests — the validator tests (test.ts) need Metaplex Token
21+
# Metadata cloned from mainnet which is too slow/unreliable in CI.
22+
# bankrun.test.ts uses a local fixture (tests/fixtures/token_metadata.so).
23+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/bankrun.test.ts"

tokens/nft-operations/anchor/Anchor.toml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,8 @@ url = "https://api.apr.dev"
1818
cluster = "localnet"
1919
wallet = "~/.config/solana/id.json"
2020

21-
# This project has BOTH bankrun tests AND validator tests (mint-nft.ts).
22-
# The validator tests need Metaplex Token Metadata cloned from mainnet.
23-
# startup_wait is high because cloning from mainnet is slow in CI.
24-
[test]
25-
startup_wait = 300000
26-
2721
[scripts]
28-
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
29-
30-
[test.validator]
31-
url = "https://api.mainnet-beta.solana.com"
32-
33-
[[test.validator.clone]]
34-
address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
22+
# Only run bankrun tests — the validator tests (mint-nft.ts) need Metaplex Token
23+
# Metadata cloned from mainnet which is too slow/unreliable in CI.
24+
# bankrun.test.ts uses a local fixture (tests/fixtures/token_metadata.so).
25+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/bankrun.test.ts"

tokens/pda-mint-authority/anchor/Anchor.toml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,7 @@ cluster = "localnet"
1616
wallet = "~/.config/solana/id.json"
1717

1818
[scripts]
19-
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
20-
21-
# This project has BOTH bankrun tests AND validator tests (test.ts).
22-
# The validator tests need Metaplex Token Metadata cloned from mainnet.
23-
# startup_wait is high because cloning from mainnet is slow in CI.
24-
[test]
25-
startup_wait = 300000
26-
shutdown_wait = 2000
27-
upgradeable = false
28-
29-
[test.validator]
30-
bind_address = "0.0.0.0"
31-
url = "https://api.mainnet-beta.solana.com"
32-
ledger = ".anchor/test-ledger"
33-
rpc_port = 8899
34-
35-
[[test.validator.clone]]
36-
address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
19+
# Only run bankrun tests — the validator tests (test.ts) need Metaplex Token
20+
# Metadata cloned from mainnet which is too slow/unreliable in CI.
21+
# bankrun.test.ts uses a local fixture (tests/fixtures/token_metadata.so).
22+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/bankrun.test.ts"

tokens/spl-token-minter/anchor/Anchor.toml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,7 @@ cluster = "localnet"
1616
wallet = "~/.config/solana/id.json"
1717

1818
[scripts]
19-
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
20-
21-
# This project has BOTH bankrun tests AND validator tests (test.ts).
22-
# The validator tests need Metaplex Token Metadata cloned from mainnet.
23-
# startup_wait is high because cloning from mainnet is slow in CI.
24-
[test]
25-
startup_wait = 300000
26-
shutdown_wait = 2000
27-
upgradeable = false
28-
29-
[test.validator]
30-
bind_address = "0.0.0.0"
31-
url = "https://api.mainnet-beta.solana.com"
32-
ledger = ".anchor/test-ledger"
33-
rpc_port = 8899
34-
35-
[[test.validator.clone]]
36-
address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
19+
# Only run bankrun tests — the validator tests (test.ts) need Metaplex Token
20+
# Metadata cloned from mainnet which is too slow/unreliable in CI.
21+
# bankrun.test.ts uses a local fixture (tests/fixtures/token_metadata.so).
22+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/bankrun.test.ts"

tokens/token-2022/transfer-hook/hello-world/anchor/Anchor.toml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,7 @@ wallet = "~/.config/solana/id.json"
1818
[scripts]
1919
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
2020

21-
# Tests use the real local validator (not bankrun) because transfer-hook
22-
# tests need the actual validator runtime. startup_wait is 300s (5 min) because the
23-
# validator clones programs from devnet which can be very slow in CI
24-
# (shorter timeouts hit the limit in CI).
25-
[test]
26-
startup_wait = 300000
27-
shutdown_wait = 2000
28-
upgradeable = false
29-
30-
[test.validator]
31-
bind_address = "0.0.0.0"
32-
url = "https://api.devnet.solana.com"
33-
ledger = ".anchor/test-ledger"
34-
rpc_port = 8899
35-
36-
[[test.validator.clone]]
37-
address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
21+
# Transfer-hook tests use the real local validator (not bankrun).
22+
# No external program clones needed — this project doesn't use Metaplex.
23+
# The previous [[test.validator.clone]] of metaplex was unnecessary and
24+
# caused 5-minute timeouts in CI trying to fetch from devnet.

tokens/token-2022/transfer-hook/whitelist/anchor/Anchor.toml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,10 @@ url = "https://api.apr.dev"
1515
cluster = "Localnet"
1616
wallet = "~/.config/solana/id.json"
1717

18-
# Tests use the real local validator (not bankrun) because transfer-hook
19-
# tests need the actual validator runtime. startup_wait is 300s (5 min) because the
20-
# validator clones programs from devnet which can be very slow in CI
21-
# (shorter timeouts hit the limit in CI).
22-
[test]
23-
startup_wait = 300000
24-
2518
[scripts]
2619
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
2720

28-
[test.validator]
29-
url = "https://api.devnet.solana.com"
30-
31-
[[test.validator.clone]]
32-
address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
21+
# Transfer-hook tests use the real local validator (not bankrun).
22+
# No external program clones needed — this project doesn't use Metaplex.
23+
# The previous [[test.validator.clone]] of metaplex was unnecessary and
24+
# caused 5-minute timeouts in CI trying to fetch from devnet.

tokens/transfer-tokens/anchor/Anchor.toml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,7 @@ cluster = "localnet"
1616
wallet = "~/.config/solana/id.json"
1717

1818
[scripts]
19-
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
20-
21-
# This project has BOTH bankrun tests (bankrun.test.ts) AND validator tests
22-
# (test.ts). The validator tests need Metaplex Token Metadata cloned from
23-
# mainnet. startup_wait is high because cloning from mainnet is slow in CI.
24-
[test]
25-
startup_wait = 300000
26-
shutdown_wait = 2000
27-
upgradeable = false
28-
29-
[test.validator]
30-
bind_address = "0.0.0.0"
31-
url = "https://api.mainnet-beta.solana.com"
32-
ledger = ".anchor/test-ledger"
33-
rpc_port = 8899
34-
35-
[[test.validator.clone]]
36-
address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
19+
# Only run bankrun tests — the validator tests (test.ts) need Metaplex Token
20+
# Metadata cloned from mainnet which is too slow/unreliable in CI.
21+
# bankrun.test.ts uses a local fixture (tests/fixtures/token_metadata.so).
22+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/bankrun.test.ts"

0 commit comments

Comments
 (0)