-
Notifications
You must be signed in to change notification settings - Fork 247
Expand file tree
/
Copy pathRUST_TESTS.makefile
More file actions
66 lines (57 loc) · 2.86 KB
/
RUST_TESTS.makefile
File metadata and controls
66 lines (57 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Run unit tests only (no integration tests)
test:
@cargo test --lib --workspace --exclude tests --quiet 2>/dev/null || true
# Build transfer hook program (is checked in, so only need to build if changes are made)
build-transfer-hook:
$(call print_header,BUILDING TRANSFER HOOK PROGRAM)
$(call print_step,Building transfer hook program...)
cd tests/src/common/transfer-hook-example && \
chmod +x build.sh && \
./build.sh
$(call print_success,Transfer hook program built at tests/src/common/transfer-hook-example/target/deploy/)
# Run all integration tests with clean output
test-integration:
$(call print_header,KORA INTEGRATION TEST SUITE)
$(call print_step,Initializing test infrastructure)
@$(call start_solana_validator)
$(call print_substep,Setting up base test environment...)
@KORA_PRIVATE_KEY="$$(cat tests/src/common/local-keys/fee-payer-local.json)" cargo run -p tests --bin setup_test_env $(QUIET_OUTPUT)
$(call print_success,Infrastructure ready)
@$(call run_integration_phase,1,RPC tests,$(REGULAR_CONFIG),,--test rpc,)
@$(call run_integration_phase,2,token tests,$(REGULAR_CONFIG),,--test tokens,)
@$(call run_integration_phase,3,external tests,$(REGULAR_CONFIG),,--test external,)
@$(call run_integration_phase,4,auth tests,$(AUTH_CONFIG),,--test auth,)
@$(call run_integration_phase,5,payment address tests,$(PAYMENT_ADDRESS_CONFIG),,--test payment_address,true)
@$(call run_multi_signer_phase,6,multi-signer tests,$(REGULAR_CONFIG),$(MULTI_SIGNERS_CONFIG),--test multi_signer)
$(call print_header,TEST SUITE COMPLETE)
@$(call stop_solana_validator)
# Individual test targets for development
test-regular:
$(call print_header,REGULAR TESTS)
@$(call start_solana_validator)
@cargo run -p tests --bin setup_test_env $(QUIET_OUTPUT)
$(call run_integration_phase,1,Regular Tests,$(REGULAR_CONFIG),,--test rpc,)
@$(call stop_solana_validator)
test-token:
$(call print_header,TOKEN TESTS)
@$(call start_solana_validator)
@cargo run -p tests --bin setup_test_env $(QUIET_OUTPUT)
$(call run_integration_phase,1,Tokens Tests,$(REGULAR_CONFIG),,--test tokens,)
@$(call stop_solana_validator)
test-auth:
$(call print_header,AUTHENTICATION TESTS)
@$(call start_solana_validator)
@cargo run -p tests --bin setup_test_env $(QUIET_OUTPUT)
$(call run_integration_phase,1,Authentication Tests,$(AUTH_CONFIG),,--test auth,)
@$(call stop_solana_validator)
test-payment:
$(call print_header,PAYMENT ADDRESS TESTS)
@$(call start_solana_validator)
@cargo run -p tests --bin setup_test_env $(QUIET_OUTPUT)
$(call run_integration_phase,1,Payment Address Tests,$(PAYMENT_ADDRESS_CONFIG),,--test payment_address,true)
@$(call stop_solana_validator)
test-multi-signer:
$(call print_header,MULTI-SIGNER TESTS)
@$(call start_solana_validator)
$(call run_multi_signer_phase,1,Multi-Signer Tests,$(REGULAR_CONFIG),$(MULTI_SIGNERS_CONFIG),--test multi-signers)
@$(call stop_solana_validator)