Test harnesses are pre-built testing applications that demonstrate OASIS functionality and provide working examples for alpha testers. Each test harness focuses on specific components and use cases.
Location: NextGenSoftware.OASIS.API.ONODE.Core.TestHarness/
Purpose: Tests core OASIS functionality including NFT minting, avatar operations, and data management.
Key Features:
- NFT minting with various providers
- Avatar registration and authentication
- Data holon operations
- Provider switching and failover
Running the Test Harness:
cd NextGenSoftware.OASIS.API.ONODE.Core.TestHarness
dotnet runTest Output Example:
NEXTGEN SOFTWARE ONODE CORE TEST HARNESS V1.3
Minting SIMPLEST NFT...
✅ Transaction ID: 0x1234...
✅ OASIS NFT ID: your-nft-id
✅ Hash: your-hash...
✅ MintedByAddress: 0xYourWalletAddress
✅ Minted Date: 2024-01-01T00:00:00Z
✅ Meta Data JSON URL: https://gateway.pinata.cloud/ipfs/...
✅ Image URL: https://gateway.pinata.cloud/ipfs/...
Location: holochain-client-csharp/NextGenSoftware.Holochain.HoloNET.Client.TestHarness/
Purpose: Tests Holochain connectivity and HoloNET client functionality.
Available Tests:
WhoAmI- Test basic Holochain connectionNumbers- Test number operationsSignal- Test signaling functionalitySaveLoadOASISEntry- Test OASIS entry operationsLoadTestNumbers- Performance testingAdminInstallApp- Admin operationsAdminEnableApp- Enable hAppAdminListApps- List installed apps
Running the Test Harness:
cd holochain-client-csharp/NextGenSoftware.Holochain.HoloNET.Client.TestHarness
dotnet runProgrammatic Usage:
using NextGenSoftware.Holochain.HoloNET.Client.TestHarness;
// Run specific test
await HoloNETTestHarness.TestHoloNETClientAsync(TestToRun.WhoAmI);
// Run OASIS-specific test
await HoloNETTestHarness.TestHoloNETClientAsync(TestToRun.SaveLoadOASISEntry);Location: STAR ODK/NextGenSoftware.OASIS.STAR.TestHarness/
Purpose: Tests STAR engine functionality including celestial body creation and OAPP generation.
Key Features:
- Celestial body creation (planets, moons, stars)
- OAPP generation from templates
- Provider integration testing
- COSMIC ORM operations
Running the Test Harness:
cd "STAR ODK/NextGenSoftware.OASIS.STAR.TestHarness"
dotnet runTest Configuration:
private const string defaultGenesisNamespace = "NextGenSoftware.OASIS.STAR.TestHarness.Genesis";
private const string celestialBodyDNAFolder = "CelestialBodyDNA";
private const OAPPType DefaultOAPPType = OAPPType.Console;Location: NextGenSoftware.OASIS.API.Providers.ArbitrumOASIS.TestHarness/
Purpose: Tests Arbitrum blockchain integration and NFT operations.
Features:
- Smart contract deployment
- NFT minting on Arbitrum
- Transaction management
- Gas fee handling
Location: NextGenSoftware.OASIS.API.Providers.EthereumOASIS.TestHarness/
Purpose: Tests Ethereum blockchain integration.
Features:
- Ethereum network connectivity
- Smart contract interactions
- Token operations
- Transaction monitoring
Location: NextGenSoftware.OASIS.API.Providers.SOLANAOASIS.TestHarness/
Purpose: Tests Solana blockchain integration.
Features:
- Solana network connectivity
- SPL token operations
- Program interactions
- Account management
Each test harness uses an OASIS_DNA.json file for configuration:
{
"OASIS": {
"TestHarness": {
"IsEnabled": true,
"TestProviders": ["MongoDBOASIS", "ArbitrumOASIS"],
"TestData": {
"AvatarCount": 10,
"NFTCount": 5,
"HolonCount": 20
}
},
"Providers": {
"MongoDBOASIS": {
"IsEnabled": true,
"Priority": 1,
"CustomParams": "mongodb://localhost:27017"
},
"ArbitrumOASIS": {
"IsEnabled": true,
"Priority": 2,
"CustomParams": "https://sepolia-rollup.arbitrum.io/rpc"
}
}
}
}Set these environment variables for testing:
# Database connections
export MONGODB_CONNECTION_STRING="mongodb://localhost:27017"
export NEO4J_CONNECTION_STRING="bolt://localhost:7687"
# Blockchain RPC endpoints
export ARBITRUM_RPC_URL="https://sepolia-rollup.arbitrum.io/rpc"
export ETHEREUM_RPC_URL="https://sepolia.infura.io/v3/YOUR_INFURA_PROJECT_ID"
# Wallet configuration
export PRIVATE_KEY="your-test-private-key-here"
export WALLET_ADDRESS="your-test-wallet-address-here"# Navigate to test harness directory
cd NextGenSoftware.OASIS.API.ONODE.Core.TestHarness
# Run with default configuration
dotnet run
# Run with specific configuration
dotnet run --configuration Release
# Run with custom parameters
dotnet run -- --test-type nft-minting --provider ArbitrumOASIS# Run multiple test harnesses
cd NextGenSoftware.OASIS.API.ONODE.Core.TestHarness && dotnet run
cd ../NextGenSoftware.OASIS.API.Providers.ArbitrumOASIS.TestHarness && dotnet run
cd ../../STAR\ ODK/NextGenSoftware.OASIS.STAR.TestHarness && dotnet runusing NextGenSoftware.OASIS.API.ONODE.Core.TestHarness;
public class CustomTestRunner
{
public async Task RunAllTests()
{
var testHarness = new ONODECoreTestHarness();
// Run specific tests
await testHarness.TestNFTMinting();
await testHarness.TestAvatarOperations();
await testHarness.TestProviderSwitching();
await testHarness.TestDataOperations();
}
}using NextGenSoftware.OASIS.API.Providers.ArbitrumOASIS.TestHarness;
public class ArbitrumTestRunner
{
public async Task RunArbitrumTests()
{
var testHarness = new ArbitrumTestHarness();
await testHarness.TestContractDeployment();
await testHarness.TestNFTMinting();
await testHarness.TestTransactionHandling();
}
}Objective: Verify core OASIS functionality works correctly.
Steps:
- Run ONODE Core Test Harness
- Verify avatar registration
- Test authentication
- Verify NFT minting
- Test data operations
Expected Results:
- All operations complete successfully
- No error messages
- Proper data persistence
Objective: Test multiple provider integration and failover.
Steps:
- Configure multiple providers in OASIS_DNA.json
- Run tests with different providers
- Test provider switching
- Test auto-failover
- Test auto-replication
Expected Results:
- Providers switch correctly
- Failover works as expected
- Data replicates across providers
Objective: Test NFT minting across different blockchains.
Steps:
- Configure blockchain providers
- Set up wallet with test funds
- Run NFT minting tests
- Verify on-chain transactions
- Test metadata storage
Expected Results:
- NFTs mint successfully
- Transactions confirmed on-chain
- Metadata stored correctly
Objective: Test STAR engine and celestial body creation.
Steps:
- Run STAR Test Harness
- Create celestial bodies
- Test OAPP generation
- Verify provider integration
- Test COSMIC ORM operations
Expected Results:
- Celestial bodies created successfully
- OAPPs generated correctly
- ORM operations work properly
Objective: Test Holochain integration via HoloNET.
Steps:
- Set up Holochain conductor
- Run HoloNET Test Harness
- Test zome function calls
- Test entry operations
- Verify data persistence
Expected Results:
- Holochain connection established
- Zome functions execute correctly
- Data persists on Holochain
Problem: Test harness fails to connect to providers.
Solutions:
- Check provider configuration in OASIS_DNA.json
- Verify network connectivity
- Check provider-specific logs
- Ensure required services are running
Problem: Avatar authentication fails in tests.
Solutions:
- Verify avatar registration completed
- Check email verification status
- Ensure proper credentials
- Check JWT token validity
Problem: NFT minting tests fail.
Solutions:
- Verify wallet has sufficient funds
- Check contract deployment status
- Review transaction parameters
- Check gas fee settings
Problem: Database operations fail.
Solutions:
- Check database connection strings
- Verify database services are running
- Check database permissions
- Review connection pool settings
Enable debug mode for detailed logging:
# Set debug environment variable
export OASIS_DEBUG=true
# Run test harness with debug logging
dotnet run -- --debug --verboseTest harnesses generate log files in:
logs/test-harness.log- General test logslogs/provider-errors.log- Provider-specific errorslogs/transaction-logs.log- Blockchain transaction logs
After running tests, clean up test data:
public class TestDataCleanup
{
public async Task CleanupTestData()
{
// Clean up test avatars
await CleanupTestAvatars();
// Clean up test NFTs
await CleanupTestNFTs();
// Clean up test holons
await CleanupTestHolons();
}
}Use separate test databases:
{
"OASIS": {
"Providers": {
"MongoDBOASIS": {
"CustomParams": "mongodb://localhost:27017/oasis_test"
}
}
}
}Run load tests to verify performance:
public class LoadTestRunner
{
public async Task RunLoadTests()
{
var tasks = new List<Task>();
// Create multiple concurrent operations
for (int i = 0; i < 100; i++)
{
tasks.Add(CreateTestAvatar($"testuser{i}"));
}
await Task.WhenAll(tasks);
}
}Monitor these metrics during testing:
- Response times
- Memory usage
- CPU utilization
- Database connection counts
- Transaction success rates
- Group related tests in separate test harnesses
- Use descriptive test names for clarity
- Clean up test data after each run
- Use separate test environments for isolation
- Implement proper error handling in tests
- Log detailed error information for debugging
- Retry failed operations where appropriate
- Validate results after each operation
- Use environment-specific configurations
- Store sensitive data in environment variables
- Document configuration requirements
- Version control configuration templates
- Email: ourworld@nextgensoftware.co.uk
- GitHub Issues: Create an issue
Happy Testing! 🧪
This guide provides comprehensive information for using OASIS test harnesses effectively. Start with the basic functionality tests and gradually move to more advanced scenarios.