You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`TEST_SERVER_URL`| Kora RPC server URL |`http://127.0.0.1:8080`|
165
-
|`TEST_SENDER_KEYPAIR`| Base58 encoded test sender keypair | Built-in test keypair |
166
-
|`TEST_RECIPIENT_PUBKEY`| Test recipient public key | Built-in test pubkey |
167
-
|`KORA_PRIVATE_KEY`| Kora fee payer private key | Built-in test keypair |
168
-
|`TEST_USDC_MINT_KEYPAIR`| Test USDC mint keypair | Built-in test mint |
169
-
|`TEST_USDC_MINT_DECIMALS`| USDC mint decimals |`6`|
174
+
The test suite uses environment variables for configuration specified in `tests/src/common/constants.rs`.
170
175
171
176
Make sure to update the appropriate config file (kora.toml for production, tests/common/fixtures/kora-test.toml for testing) to reflect the public key of TEST_USDC_MINT_KEYPAIR.
Copy file name to clipboardExpand all lines: docs/contributors/ADDING_SIGNERS.md
+55-29Lines changed: 55 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -400,48 +400,74 @@ Define a `example-signer.toml` with your signer's configuration and necessary en
400
400
401
401
### Integration Tests
402
402
403
-
Testing should utilize the existing `sdks/ts/test/integration.test.ts` file. We manage this with an environment variable `KORA_SIGNER_TYPE` that is set to the signer type you are testing.
404
-
405
-
Setup:
406
-
-`sdks/ts/test/setup.ts`: You will need to add an environment variable to `loadEnvironmentVariables` to set the signer type to your service.
407
-
-`sdks/ts/package.json`: You will need to add a new test script that uses the signer type you added to the setup script: `"test:integration:your-service": "KORA_SIGNER_TYPE=your-service pnpm test integration.test.ts"`. When executed, the test will run with the signer type set to your service.
408
-
409
-
Integration testing requires a local Solana test validator and a local Kora node. We can use the [TypeScript Test Makefile](/makefiles/tests_ts.mk) to start a local Solana test validator and a local Kora node by adding a new script for your signer:
410
-
411
-
```makefile
412
-
# Run TypeScript tests with YourService signer
413
-
test-ts-integration-your-service:
414
-
@$(call start_solana_validator)
415
-
@echo "🚀 Starting Kora node with YourService signer..."
416
-
@$(call stop_kora_server)
417
-
@cargo run -p kora-cli --bin kora -- --config $(REGULAR_CONFIG) --rpc-url $(TEST_RPC_URL) rpc start --signers-config $(TEST_SIGNERS_YOUR_SERVICE_CONFIG) --port $(TEST_PORT)$(QUIET_OUTPUT)&
418
-
@echo $$!> .kora.pid
419
-
@echo "⏳ Waiting for server to start..."
420
-
@sleep 5
421
-
@printf "Running TypeScript SDK tests with YourService signer...\n"
Kora uses a unified test runner (`tests/src/bin/test_runner.rs`) that manages all integration testing phases including TypeScript tests. To add tests for your new signer:
404
+
405
+
#### 1. Add Test Configuration
406
+
407
+
Create a new signer configuration file in `tests/src/common/fixtures/` for your service:
0 commit comments