refactor: enterprise-grade project structure
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 15s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 15s
- Move test files to tests/ - Archive session notes to docs/archive/ - Remove temp/diagnostic files - Clean src/ to only contain production code
This commit is contained in:
64
tests/test-clients.ts
Normal file
64
tests/test-clients.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import { createHetznerClient } from './api/hetzner';
|
||||
import { createDokployClient } from './api/dokploy';
|
||||
|
||||
async function testHetznerClient() {
|
||||
console.log('\n🔍 Testing Hetzner DNS Client...');
|
||||
|
||||
try {
|
||||
const client = createHetznerClient();
|
||||
const result = await client.testConnection();
|
||||
|
||||
if (result.success) {
|
||||
console.log(`✅ Hetzner: ${result.message}`);
|
||||
return true;
|
||||
} else {
|
||||
console.log(`❌ Hetzner: ${result.message}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(`❌ Hetzner: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function testDokployClient() {
|
||||
console.log('\n🔍 Testing Dokploy Client...');
|
||||
|
||||
try {
|
||||
const client = createDokployClient();
|
||||
const result = await client.testConnection();
|
||||
|
||||
if (result.success) {
|
||||
console.log(`✅ Dokploy: ${result.message}`);
|
||||
return true;
|
||||
} else {
|
||||
console.log(`❌ Dokploy: ${result.message}`);
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(`❌ Dokploy: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
console.log('═══════════════════════════════════════');
|
||||
console.log(' AI Stack Deployer - API Client Tests');
|
||||
console.log('═══════════════════════════════════════');
|
||||
|
||||
const hetznerOk = await testHetznerClient();
|
||||
const dokployOk = await testDokployClient();
|
||||
|
||||
console.log('\n═══════════════════════════════════════');
|
||||
console.log(' Test Summary');
|
||||
console.log('═══════════════════════════════════════');
|
||||
console.log(`Hetzner DNS: ${hetznerOk ? '✅ PASS' : '❌ FAIL'}`);
|
||||
console.log(`Dokploy API: ${dokployOk ? '✅ PASS' : '❌ FAIL'}`);
|
||||
console.log('═══════════════════════════════════════\n');
|
||||
|
||||
if (!hetznerOk || !dokployOk) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user