refactor: remove deploy.cmd and update Dockerfile for health checks
ci/woodpecker/push/01-test Pipeline failed
ci/woodpecker/push/02-build-push unknown status

- Deleted the deploy.cmd script as it was no longer needed.
- Updated Dockerfile to include curl for health checks and added a non-root user for improved security.
- Modified health check command to use curl for better reliability.
- Adjusted docker-compose.test.yml to reflect changes in health check configuration.
- Cleaned up appsettings.json and removed unused configuration properties.
- Removed Resource entity and related requests from the codebase as part of the architectural shift.
- Updated documentation to reflect the removal of hardware binding and related endpoints.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-13 08:47:21 +03:00
parent 43fe38e67d
commit c7b297de83
76 changed files with 4034 additions and 832 deletions
+42 -19
View File
@@ -3,41 +3,64 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
RESULTS_DIR="$PROJECT_ROOT/e2e/test-results"
COMPOSE_FILE="$PROJECT_ROOT/docker-compose.test.yml"
SCENARIOS_FILE="$SCRIPT_DIR/perf-scenarios.js"
BASE_URL="${BASE_URL:-http://localhost:8080}"
PERF_USER_COUNT="${PERF_USER_COUNT:-500}"
if ! command -v k6 >/dev/null 2>&1; then
echo "ERROR: k6 not found on PATH. Install with: brew install k6"
exit 1
fi
mkdir -p "$RESULTS_DIR"
cleanup() {
echo "Cleaning up..."
docker compose -f "$PROJECT_ROOT/docker-compose.test.yml" down -v --remove-orphans 2>/dev/null || true
echo "=== Tearing down ==="
docker compose -f "$COMPOSE_FILE" down -v --remove-orphans || true
}
trap cleanup EXIT
echo "=== Starting system under test ==="
docker compose -f "$PROJECT_ROOT/docker-compose.test.yml" up -d system-under-test test-db
docker compose -f "$COMPOSE_FILE" up -d system-under-test test-db
echo "=== Waiting for system to be ready ==="
MAX_WAIT=30
MAX_WAIT=60
WAIT=0
until curl -sf http://localhost:8080/swagger/index.html > /dev/null 2>&1 || [ $WAIT -ge $MAX_WAIT ]; do
until curl -sf "$BASE_URL/swagger/index.html" > /dev/null 2>&1 || [ $WAIT -ge $MAX_WAIT ]; do
sleep 1
WAIT=$((WAIT + 1))
done
if [ $WAIT -ge $MAX_WAIT ]; then
echo "ERROR: System did not become ready within ${MAX_WAIT}s"
docker compose -f "$COMPOSE_FILE" logs --tail=80 system-under-test || true
exit 1
fi
echo "=== Running performance tests ==="
echo "Performance test runner not yet configured."
echo "Install k6, locust, or artillery and add load scenarios from:"
echo " _docs/02_document/tests/performance-tests.md"
echo ""
echo "Example with k6:"
echo " k6 run scripts/perf-scenarios.js"
echo ""
echo "Thresholds from test spec:"
echo " NFT-PERF-01: Login p95 < 500ms"
echo " NFT-PERF-02: Small file download p95 < 1000ms"
echo " NFT-PERF-03: Large file download p95 < 30000ms"
echo " NFT-PERF-04: User list p95 < 1000ms"
echo "=== Seeding $PERF_USER_COUNT perf users ==="
# Reuse the admin password hash so the rows satisfy NOT NULL on password_hash.
# These users are only used as listing volume, never for login.
docker compose -f "$COMPOSE_FILE" exec -T test-db psql -U postgres -d azaion -v ON_ERROR_STOP=1 <<SQL
INSERT INTO public.users (id, email, password_hash, role)
SELECT
gen_random_uuid(),
'perf-user-' || lpad(g::text, 5, '0') || '@perf.azaion.com',
'282wqVHZU0liTxphiGkKIaJtUA1W6rILdvfEOx8Ez350x0XLbgNtrSUYCK1r/ajq',
'ApiAdmin'
FROM generate_series(1, $PERF_USER_COUNT) AS g
ON CONFLICT (email) DO NOTHING;
SELECT count(*) AS users_total FROM public.users;
SQL
echo "=== Performance test scaffolding complete ==="
echo "=== Running k6 performance scenarios ==="
# handleSummary() in perf-scenarios.js writes the JSON summary to RESULTS_DIR.
set +e
BASE_URL="$BASE_URL" k6 run "$SCENARIOS_FILE"
K6_EXIT=$?
set -e
echo "=== Performance test run complete (k6 exit=$K6_EXIT) ==="
exit $K6_EXIT