Skip to content
Open
Show file tree
Hide file tree
Changes from 87 commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
a185d2d
reduce input for testing
smk762 Aug 26, 2025
310da77
Merge branch 'inject-clean-electrums' into postman-collection-builder
smk762 Aug 26, 2025
e45a342
adds postman collection builder from component json
smk762 Aug 26, 2025
519ba58
restore initial inputs
smk762 Aug 26, 2025
c211c4e
update reports
smk762 Aug 26, 2025
52b3a11
DRY responses where common
smk762 Aug 26, 2025
9c82953
sort output to reduce diff spam
smk762 Aug 26, 2025
c0ebad1
extend kdf_methods.json to include environment constraints
smk762 Aug 27, 2025
6370cd2
scripted bespoke postman collections tailored to specific KDF environ…
smk762 Aug 27, 2025
de48bd9
adds newman & kdf native docker containers
smk762 Aug 28, 2025
eae498b
rm comments
smk762 Aug 28, 2025
d91475d
rm empty lines
smk762 Aug 28, 2025
340475c
ensure folders for processor
smk762 Aug 28, 2025
985d628
mmultistage build and healthcheck
smk762 Aug 28, 2025
21a72f8
Merge branch 'dev' into postman-collection-validator
smk762 Aug 28, 2025
8ae4df8
Merge branch 'dev' into postman-collection-builder
smk762 Aug 28, 2025
fa4a0cc
refactor postman generator script, combine script README
smk762 Aug 28, 2025
59901c7
improve generation_summary.json output
smk762 Aug 28, 2025
ebd481a
update postman & reports
smk762 Aug 29, 2025
7b8b8a6
Adds postman reports readme to assist with resolution of missing items
smk762 Aug 29, 2025
18c25c3
useraction -> useractionpin for activation tasks
smk762 Aug 29, 2025
c0752fc
removed duplicated reports, add some translations
smk762 Aug 29, 2025
fecefe1
adds limited self-repair of json component source/report/reference
smk762 Aug 29, 2025
b092772
adds self-repaired methods reference and resultant reduced reports
smk762 Aug 29, 2025
8f82e05
ensure empty reports are generated when missing list is empty.
smk762 Aug 29, 2025
125b927
use relative paths in reports
smk762 Aug 29, 2025
c2fdbe8
Merge branch 'postman-collection-builder' into postman-collection-val…
smk762 Aug 29, 2025
79e5e8f
[Bot] File and author data updated, validated and updated internal li…
smk762 Aug 29, 2025
30051f6
apply common response objects (e.g. task init)
smk762 Aug 29, 2025
40c02ea
sort json keyd during validation
smk762 Aug 30, 2025
4a69ff5
fills useraction responses, include empty in response.json if missing
smk762 Sep 2, 2025
71f0540
adds `deprecated` param to ignore old methods (e.g. `enable_bch_with_…
smk762 Sep 3, 2025
2dbe870
ignore manual methods (trezor/wc/metamask) in auto response logic
smk762 Sep 4, 2025
fd21b7c
Adds response delay report and per-method timeouts
smk762 Sep 4, 2025
27cf7be
handle slow responders and inconsistent responses
smk762 Sep 4, 2025
22a316f
clean up old reports
smk762 Sep 11, 2025
0a8940d
adds `generated` field to harvested responses
smk762 Sep 11, 2025
caf2c4e
addres reposnse harvesting script.
smk762 Sep 11, 2025
6d98fc4
remove deprecated response processor service
smk762 Sep 11, 2025
a59a6e3
set `enable_eth_with_tokens` to iguana only
smk762 Sep 11, 2025
34169eb
fix broken `enable_eth_with_tokens` request
smk762 Sep 11, 2025
1d28c2d
apply `generated` keys to v2 coin activation responses.
smk762 Sep 11, 2025
e569b02
ensure sorted output to reduce diffspam
smk762 Sep 11, 2025
bd4af92
apply sorting to output
smk762 Sep 15, 2025
8c32f24
update "missing" reports
smk762 Sep 15, 2025
8d5b505
add preprocess script to disable all coins
smk762 Sep 15, 2025
5e71100
validate metadata
smk762 Sep 15, 2025
12e406f
filter out deporecated methods from postman and reports.
smk762 Sep 15, 2025
b6c24c9
refactor
smk762 Sep 15, 2025
238f6fb
pre-disbale for activation
smk762 Sep 15, 2025
d395fd2
update reports
smk762 Sep 15, 2025
ac41b3d
Creates TagManager & TableManager; adds missing response/error tables…
smk762 Sep 16, 2025
54fb79e
replace hardcoded req/resp refs to folder globs for kdf reqposnse har…
smk762 Sep 16, 2025
6bffaa2
refactor method name detection
smk762 Sep 17, 2025
3ca9e02
updates `add_node_to_version_stat` to use components
smk762 Sep 17, 2025
2b14468
addds coin config manager
smk762 Sep 18, 2025
834f593
updates activation pre-process disable logic
smk762 Sep 18, 2025
70df332
add test env addresses report to simplify funding
smk762 Sep 18, 2025
29e600a
default to dev branch for tests
smk762 Sep 19, 2025
f617c54
split methods into version files, refactor into classes, set method s…
smk762 Sep 19, 2025
1e478a1
report version
smk762 Sep 19, 2025
39706c8
fix kdf branch/commit configs
smk762 Sep 19, 2025
4f358a5
remove reports output to reduce diff
smk762 Sep 19, 2025
e206f48
add prefferred node selector as pre-harvest process
smk762 Sep 19, 2025
14752bc
handle expected fails
smk762 Sep 22, 2025
7efa00b
ensure reports for expected fail and inconsistent responses.
smk762 Sep 23, 2025
fccd6e5
exclude expected fails from inconsistent report
smk762 Sep 23, 2025
f5c41b8
retry activation where NoSuchCoin or PlatformCoinNotActivated
smk762 Sep 23, 2025
91c82f3
fix unused_params report to include legacy requests
smk762 Sep 23, 2025
701bf01
adds "sync examples" to keep `kdf_methods_*.json` aligned
smk762 Sep 23, 2025
5a57bd1
adds recursive common structure links in param data
smk762 Sep 23, 2025
9db9637
fix tendermint autoactivate
smk762 Sep 24, 2025
53971c0
improve expected error logging
smk762 Sep 24, 2025
f983693
improve task method tracking
smk762 Sep 26, 2025
e5bc5dd
migrate inline activation tables and responses into components
smk762 Sep 26, 2025
8d1f264
Merge pull request #584 from KomodoPlatform/postman-collection-validator
smk762 Sep 26, 2025
68f22d5
Merge branch 'dev' into postman-collection-builder
smk762 Sep 26, 2025
ee06582
handle wasm zhtlc lightwalletd servers
smk762 Oct 1, 2025
a63d8ff
migrate legacy utility methods to components
smk762 Nov 11, 2025
dce062c
lint utxo consolidation docs
smk762 Nov 11, 2025
d7cb2af
fix `get_private_keys` iguana example
smk762 Nov 11, 2025
298c8a4
fix slugs & sidebar if missing
smk762 Nov 11, 2025
f21c27a
componentize get_private_keys
smk762 Nov 11, 2025
c47e262
adds substructure and context props to compact table schema
smk762 Nov 11, 2025
6d0f67b
lint and fix ci errors
smk762 Nov 11, 2025
78138a8
Merge pull request #586 from KomodoPlatform/lint-fix-patches/postman-…
smk762 Nov 11, 2025
3b67670
complete sia methods component use
smk762 Nov 11, 2025
c0acaae
Update src/pages/komodo-defi-framework/api/v20/wallet/consolidate_utx…
gcharang Nov 11, 2025
2c67cd4
Update src/pages/komodo-defi-framework/api/v20/wallet/fetch_utxos/ind…
gcharang Nov 11, 2025
3fbe79a
Apply suggestion from @Copilot
gcharang Nov 11, 2025
03395d4
Merge branch 'dev' into postman-collection-builder
gcharang Nov 11, 2025
cdf4c82
componentize legacy `coins_needed_for_kick_start` & `validateaddress`
smk762 Nov 12, 2025
91f66a1
generate and fill in missing kdf data from postman
smk762 Nov 12, 2025
5b9c113
add missing methods & table
smk762 Nov 12, 2025
06a2c86
link missing tables
smk762 Nov 12, 2025
e6f962e
split missing reports into rpc versions and backfill
smk762 Nov 12, 2025
d86f100
add address hints in report error responses
smk762 Nov 12, 2025
25331ae
adds sia activation builder
smk762 Nov 12, 2025
b5cb65e
Merge pull request #598 from KomodoPlatform/componentize-legacy
smk762 Nov 12, 2025
0d0b252
adds UI test build script
smk762 Nov 13, 2025
b021bf3
complete get_raw_transaction migrate
smk762 Nov 13, 2025
086346c
update ui test script
smk762 Nov 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
252 changes: 252 additions & 0 deletions .github/workflows/postman-kdf-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
name: KDF Postman API Tests

on:
push:
branches: ["main", "dev"]
paths:
- 'postman/**'
- 'src/data/responses/**'
- '.github/workflows/postman-kdf-tests.yml'
- 'docker-compose.yml'
pull_request:
branches: ["main", "dev"]
paths:
- 'postman/**'
- 'src/data/responses/**'
- '.github/workflows/postman-kdf-tests.yml'
- 'docker-compose.yml'
workflow_dispatch:
inputs:
test_environment:
description: 'Test environment to run'
required: true
default: 'all'
type: choice
options:
- all
- native_hd
- native_iguana
kdf_branch:
description: 'KDF branch to test'
required: false
default: 'dev'
type: string

jobs:
kdf-postman-tests:
runs-on: ubuntu-22.04

env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
KDF_BRANCH: ${{ github.event.inputs.kdf_branch || 'dev' }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub (if needed for base images)
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
continue-on-error: true

- name: Create test reports directory
run: |
mkdir -p test-reports
chmod 777 test-reports

- name: Display build information
run: |
echo "Building KDF from branch: ${{ env.KDF_BRANCH }}"
echo "Test environment: ${{ github.event.inputs.test_environment || 'all' }}"

- name: Clone and prepare KDF source
run: |
# Clone KDF repository for building
echo "Cloning KDF from branch: ${{ env.KDF_BRANCH }}"
rm -rf tmp/kdf-build || true
git clone https://github.com/KomodoPlatform/komodo-defi-framework.git tmp/kdf-build
cd tmp/kdf-build
git checkout ${{ env.KDF_BRANCH }}
echo "KDF source prepared at $(pwd)"

- name: Build response processor image
run: |
# Build response processor image
docker build -f utils/docker/Dockerfile.processor \
-t response-processor:latest .

- name: Start KDF instances and run tests
run: |
# Start services with docker compose (will build KDF containers from source)
echo "Building and starting KDF containers..."
docker compose up --build -d kdf-native-hd kdf-native-nonhd

# Wait for services to be healthy (extended timeout for build + startup)
echo "Waiting for KDF instances to be ready..."
timeout 600 bash -c 'until docker compose ps | grep -E "(kdf-native-hd|kdf-native-nonhd)" | grep -q "healthy"; do sleep 15; echo "Still waiting..."; done' || {
echo "Services failed to become healthy within timeout"
echo "=== Container status ==="
docker compose ps
echo "=== KDF Native HD logs ==="
docker compose logs kdf-native-hd
echo "=== KDF Native NonHD logs ==="
docker compose logs kdf-native-nonhd
exit 1
}

- name: Run Postman tests for Native HD
if: ${{ github.event.inputs.test_environment == 'all' || github.event.inputs.test_environment == 'native_hd' || github.event.inputs.test_environment == '' }}
run: |
docker compose up --no-deps newman-native-hd
continue-on-error: true

- name: Run Postman tests for Native Iguana
if: ${{ github.event.inputs.test_environment == 'all' || github.event.inputs.test_environment == 'native_iguana' || github.event.inputs.test_environment == '' }}
run: |
docker compose up --no-deps newman-native-nonhd
continue-on-error: true

- name: Process test results
run: |
docker compose up --no-deps response-processor
continue-on-error: true

- name: Collect logs and results
if: always()
run: |
# Create logs directory
mkdir -p logs

# Collect container logs
docker compose logs kdf-native-hd > logs/kdf-native-hd.log 2>&1 || true
docker compose logs kdf-native-nonhd > logs/kdf-native-nonhd.log 2>&1 || true
docker compose logs newman-native-hd > logs/newman-native-hd.log 2>&1 || true
docker compose logs newman-native-nonhd > logs/newman-native-nonhd.log 2>&1 || true
docker compose logs response-processor > logs/response-processor.log 2>&1 || true

# List generated files
echo "=== Generated test reports ==="
find test-reports -type f -ls || echo "No test reports found"

echo "=== Generated response reports ==="
find postman/reports -type f -name "*.json" -ls || echo "No response reports found"

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: kdf-postman-test-results-${{ github.run_number }}
path: |
test-reports/
postman/reports/postman_test_results_*.json
postman/reports/test_summary_*.json
logs/
retention-days: 30

- name: Upload Newman results as GitHub test results
uses: dorny/test-reporter@v1
if: always()
with:
name: KDF API Tests
path: 'test-reports/**/results.xml'
reporter: java-junit
fail-on-error: false

- name: Comment on PR with test results
if: github.event_name == 'pull_request' && always()
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const path = require('path');

// Look for test summary files
const summaryFiles = [];
const reportsDir = 'postman/reports';

if (fs.existsSync(reportsDir)) {
const files = fs.readdirSync(reportsDir);
summaryFiles.push(...files.filter(f => f.startsWith('test_summary_')));
}

let commentBody = '## 🧪 KDF API Test Results\n\n';

if (summaryFiles.length > 0) {
const latestSummary = summaryFiles.sort().pop();
const summaryPath = path.join(reportsDir, latestSummary);

try {
const summary = JSON.parse(fs.readFileSync(summaryPath, 'utf8'));

commentBody += `**Test Run:** ${summary.generated_at}\n`;
commentBody += `**Environments Tested:** ${summary.environments_tested}\n`;
commentBody += `**Total Methods:** ${summary.total_methods}\n\n`;

commentBody += '### Method Test Summary\n\n';
commentBody += '| Method | Success | Errors |\n';
commentBody += '|--------|---------|--------|\n';

for (const [method, stats] of Object.entries(summary.summary_by_method)) {
const successIcon = stats.success_count > 0 ? '✅' : '❌';
const errorIcon = stats.error_count > 0 ? '⚠️' : '✅';
commentBody += `| ${method} | ${successIcon} ${stats.success_count} | ${errorIcon} ${stats.error_count} |\n`;
}

} catch (e) {
commentBody += `Error reading test summary: ${e.message}\n`;
}
} else {
commentBody += '⚠️ No test summary found. Check the workflow logs for details.\n';
}

commentBody += '\n📊 Full test results are available in the workflow artifacts.\n';

// Post or update comment
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const marker = '<!-- KDF_API_TEST_RESULTS -->';
const existing = comments.find(c =>
c.user.login === 'github-actions[bot]' &&
c.body.includes(marker)
);

const finalComment = marker + '\n' + commentBody;

if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body: finalComment
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: finalComment
});
}

- name: Cleanup
if: always()
run: |
docker compose down -v || true
# Clean up build context and images
rm -rf tmp/kdf-build || true
docker image rm response-processor:latest 2>/dev/null || true
docker image prune -f --filter "dangling=true" || true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ links-to-manually-check
.env
MM2.json
utils/docker/kdf-config/coins
tmp/*
utils/py/tmp/coins_config_cache.json
postman/generated/**/*.json
114 changes: 114 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
services:
# Native KDF with HD wallet support
kdf-native-hd:
build:
context: .
dockerfile: utils/docker/Dockerfile.kdf_native
args:
KDF_BRANCH: ${KDF_BRANCH:-dev}
KDF_BUILD_COMMIT: ${KDF_BUILD_COMMIT:-unknown}
container_name: kdf-native-hd
ports:
- "7783:8779" # External:Internal port mapping (8779 is configured in MM2.json)
volumes:
- ./utils/docker/kdf-config-kdf-native-hd/MM2.json:/kdf/MM2.json:ro
- ./utils/docker/kdf-config/coins:/kdf/coins:ro
- ./utils/docker/kdf-db-native-hd:/kdf/db
environment:
- RUST_LOG=info
networks:
- kdf-network
healthcheck:
test: ["CMD-SHELL", "curl --url 'http://127.0.0.1:8779' --data '{\"method\":\"version\"}' || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 180s

# Native KDF with non-HD wallet support
kdf-native-nonhd:
build:
context: .
dockerfile: utils/docker/Dockerfile.kdf_native
args:
KDF_BRANCH: ${KDF_BRANCH:-dev}
KDF_BUILD_COMMIT: ${KDF_BUILD_COMMIT:-unknown}
container_name: kdf-native-nonhd
ports:
- "7784:8778" # External:Internal port mapping (8778 is configured in MM2.json)
volumes:
- ./utils/docker/kdf-config-kdf-native-nonhd/MM2.json:/kdf/MM2.json:ro
- ./utils/docker/kdf-config/coins:/kdf/coins:ro
- ./utils/docker/kdf-db-native-nonhd:/kdf/db
environment:
- RUST_LOG=info
networks:
- kdf-network
healthcheck:
test: ["CMD-SHELL", "curl --url 'http://127.0.0.1:8778' --data '{\"method\":\"version\"}' || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 180s

# Newman test runner for Native HD
newman-native-hd:
image: postman/newman:latest
container_name: newman-native-hd
depends_on:
kdf-native-hd:
condition: service_healthy
volumes:
- ./postman/generated:/postman:ro
- ./test-reports:/var/newman:rw
networks:
- kdf-network
environment:
- KDF_BASE_URL=http://kdf-native-hd:8779
- WALLET_TYPE=hd
- ENVIRONMENT=native_hd
command: [
"run", "/postman/environments/kdf_native_hd_collection.json",
"--reporters", "cli,json,junit",
"--reporter-json-export", "/var/newman/results.json",
"--reporter-junit-export", "/var/newman/results.xml",
"--timeout", "60000",
"--delay-request", "1000",
"--bail", "folder"
]

# Newman test runner for Native Non-HD
newman-native-nonhd:
image: postman/newman:latest
container_name: newman-native-nonhd
depends_on:
kdf-native-nonhd:
condition: service_healthy
volumes:
- ./postman/generated:/postman:ro
- ./test-reports:/var/newman:rw
networks:
- kdf-network
environment:
- KDF_BASE_URL=http://kdf-native-nonhd:8778
- WALLET_TYPE=iguana
- ENVIRONMENT=native_iguana
command: [
"run", "/postman/environments/kdf_native_iguana_collection.json",
"--reporters", "cli,json,junit",
"--reporter-json-export", "/var/newman/results.json",
"--reporter-junit-export", "/var/newman/results.xml",
"--timeout", "60000",
"--delay-request", "1000",
"--bail", "folder"
]


networks:
kdf-network:
driver: bridge

volumes:
kdf-db-native-hd:
kdf-db-native-nonhd:
test-reports:
Loading