Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 34 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
outputs:
cloud_agent: ${{ steps.filter.outputs.cloud_agent }}
webhook_agent: ${{ steps.filter.outputs.webhook_agent }}
app_builder: ${{ steps.filter.outputs.app_builder }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -30,6 +31,8 @@ jobs:
- 'cloud-agent/**'
webhook_agent:
- 'cloudflare-webhook-agent-ingest/**'
app_builder:
- 'cloudflare-app-builder/**'

test:
runs-on: ubuntu-24.04-8core
Expand Down Expand Up @@ -250,6 +253,37 @@ jobs:
- name: Run webhook-agent-ingest tests
run: pnpm --filter cloudflare-webhook-agent-ingest test

app-builder:
needs: changes
if: needs.changes.outputs.app_builder == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
ref: ${{ github.head_ref }}

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
run_install: false

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Typecheck (app-builder)
run: pnpm --filter app-builder typecheck

- name: Run app-builder tests
run: pnpm --filter app-builder test

cloudflare:
strategy:
fail-fast: false
Expand All @@ -259,8 +293,6 @@ jobs:
filter: kilo-deploy-builder
- name: deploy-dispatcher
filter: deploy-dispatcher
- name: app-builder
filter: app-builder
- name: code-review
filter: kilo-code-review-worker
name: cloudflare-${{ matrix.name }}
Expand Down
1 change: 1 addition & 0 deletions cloudflare-app-builder/.pnpm-rebuild.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
better-sqlite3
9 changes: 7 additions & 2 deletions cloudflare-app-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"deploy": "wrangler deploy",
"cf-typegen": "wrangler types --env-interface CloudflareEnv worker-configuration.d.ts",
"typecheck": "tsc --noEmit",
"test:git": "tsx src/_integration_tests/test-git-integration.ts"
"test": "vitest run",
"test:watch": "vitest",
"test:git:all": "./src/_integration_tests/run-all-tests.sh"
},
"dependencies": {
"@ashishkumar472/cf-git": "1.0.5",
Expand All @@ -18,13 +20,16 @@
"zod": "^4.1.12"
},
"devDependencies": {
"@types/jsonwebtoken": "^9.0.9",
"@cloudflare/containers": "^0.0.30",
"@cloudflare/sandbox": "0.6.7",
"@cloudflare/workers-types": "^4.20251014.0",
"@types/better-sqlite3": "^7.6.13",
"@types/jsonwebtoken": "^9.0.9",
"@types/node": "^22.10.1",
"better-sqlite3": "^12.6.0",
"tsx": "^4.7.0",
"typescript": "^5.9.3",
"vitest": "^2.1.9",
"wrangler": "4.45.3"
}
}
78 changes: 78 additions & 0 deletions cloudflare-app-builder/src/_integration_tests/run-all-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/bash

# Run all App Builder integration tests
# Usage: ./run-all-tests.sh
#
# Prerequisites:
# - App builder running at http://localhost:8790
# - AUTH_TOKEN environment variable set (or uses default)

set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR/../.."

# Default values
export APP_BUILDER_URL="${APP_BUILDER_URL:-http://localhost:8790}"
export AUTH_TOKEN="${AUTH_TOKEN:-dev-token-change-this-in-production}"

echo "========================================"
echo "App Builder Integration Tests"
echo "========================================"
echo "URL: $APP_BUILDER_URL"
echo "Running from: $(pwd)"
echo "========================================"
echo ""

TOTAL_PASSED=0
TOTAL_FAILED=0
FAILED_TESTS=()

run_test() {
local test_name="$1"
local test_file="$2"

echo ""
echo "========================================"
echo "Running: $test_name"
echo "========================================"
echo ""

if pnpm exec tsx "$test_file"; then
TOTAL_PASSED=$((TOTAL_PASSED + 1))
else
TOTAL_FAILED=$((TOTAL_FAILED + 1))
FAILED_TESTS+=("$test_name")
fi
}

# Run all test suites
run_test "Basic Git Integration" "src/_integration_tests/test-git-integration.ts"
run_test "Authentication Edge Cases" "src/_integration_tests/test-auth-edge-cases.ts"
run_test "Init Edge Cases" "src/_integration_tests/test-init-edge-cases.ts"
run_test "Files API" "src/_integration_tests/test-files-api.ts"
run_test "Delete Endpoint" "src/_integration_tests/test-delete.ts"
run_test "Advanced Git Operations" "src/_integration_tests/test-git-advanced.ts"

# Final summary
echo ""
echo "========================================"
echo "FINAL SUMMARY"
echo "========================================"
echo "Test suites passed: $TOTAL_PASSED"
echo "Test suites failed: $TOTAL_FAILED"

if [ $TOTAL_FAILED -gt 0 ]; then
echo ""
echo "Failed test suites:"
for test in "${FAILED_TESTS[@]}"; do
echo " - $test"
done
echo ""
echo "❌ SOME TEST SUITES FAILED"
exit 1
else
echo ""
echo "🎉 ALL TEST SUITES PASSED!"
exit 0
fi
Loading
Loading