Skip to content

Commit bb2063c

Browse files
authored
Merge pull request #282 from FalkorDB/staging
Staging
2 parents 550003e + 48ff79c commit bb2063c

File tree

166 files changed

+26694
-10813
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+26694
-10813
lines changed

.github/wordlist.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ npm
4646
deps
4747
backend
4848
Backend
49+
Vite
4950
dropdown
5051
cryptographically
5152
SHA
@@ -89,3 +90,8 @@ socio
8990
sexualized
9091
www
9192
faq
93+
sanitization
94+
Sanitization
95+
JOINs
96+
subqueries
97+
subquery

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
name: 'Dependency review'
1111
on:
1212
pull_request:
13-
branches: [ "main" ]
13+
branches: [ "main", "staging" ]
1414

1515
# If using a dependency submission action in this workflow this permission will need to be set to:
1616
#

.github/workflows/e2e-tests.yml

Lines changed: 0 additions & 90 deletions
This file was deleted.

.github/workflows/playwright.yml

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
name: Playwright Tests
2+
on:
3+
push:
4+
branches: [ main, staging ]
5+
pull_request:
6+
branches: [ main, staging ]
7+
8+
permissions:
9+
contents: read
10+
11+
env:
12+
PYTHON_VERSION: '3.12'
13+
NODE_VERSION: 'lts/*'
14+
15+
16+
jobs:
17+
test:
18+
timeout-minutes: 60
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
# Setup Python
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ env.PYTHON_VERSION }}
29+
30+
# Setup Node.js
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: ${{ env.NODE_VERSION }}
34+
35+
# Install pipenv
36+
- name: Install pipenv
37+
run: pip install pipenv
38+
39+
# Install Python dependencies
40+
- name: Install Python dependencies
41+
run: pipenv sync --dev
42+
43+
# Install Node dependencies (root - for Playwright)
44+
- name: Install root dependencies
45+
run: npm ci
46+
47+
# Install Node dependencies (frontend)
48+
- name: Install frontend dependencies
49+
run: npm ci
50+
working-directory: ./app
51+
52+
# Build frontend
53+
- name: Build frontend
54+
run: npm run build
55+
working-directory: ./app
56+
57+
# Start Docker Compose services (test databases)
58+
- name: Start test databases
59+
run: |
60+
docker compose -f e2e/docker-compose.test.yml up -d
61+
# Wait for databases to be healthy
62+
echo "Waiting for databases to be ready..."
63+
sleep 20
64+
docker ps -a
65+
# Verify all containers are running
66+
docker compose -f e2e/docker-compose.test.yml ps
67+
68+
# Start FalkorDB (Redis graph database)
69+
- name: Start FalkorDB
70+
run: |
71+
docker run -d --name falkordb-test -p 6379:6379 falkordb/falkordb:latest
72+
echo "Waiting for FalkorDB to be ready..."
73+
# Wait for FalkorDB to accept connections and be fully initialized
74+
for i in {1..30}; do
75+
if docker exec falkordb-test redis-cli PING > /dev/null 2>&1; then
76+
# Test that FalkorDB graph commands work
77+
if docker exec falkordb-test redis-cli GRAPH.LIST > /dev/null 2>&1; then
78+
echo "FalkorDB graph module loaded, testing vector index creation..."
79+
# Test creating a graph with vector index (the actual operation that fails)
80+
if docker exec falkordb-test redis-cli GRAPH.QUERY test_graph "CREATE VECTOR INDEX FOR (n:Test) ON (n.embedding)" > /dev/null 2>&1; then
81+
# Clean up test graph
82+
docker exec falkordb-test redis-cli GRAPH.DELETE test_graph > /dev/null 2>&1 || true
83+
echo "FalkorDB is fully ready with vector index support!"
84+
# Extra wait to ensure complete initialization
85+
sleep 5
86+
break
87+
fi
88+
fi
89+
fi
90+
echo "Waiting for FalkorDB initialization... attempt $i/30"
91+
sleep 1
92+
done
93+
# Verify FalkorDB is accessible from host
94+
echo "Testing FalkorDB connectivity from host..."
95+
docker ps -a
96+
97+
# Start the FastAPI application
98+
- name: Start FastAPI application
99+
run: |
100+
# Start server in background directly with pipenv
101+
pipenv run uvicorn api.index:app --host localhost --port 5000 > /tmp/uvicorn.log 2>&1 &
102+
UVICORN_PID=$!
103+
echo "Started server with PID: $UVICORN_PID"
104+
# Wait for app to start
105+
echo "Waiting for application to start..."
106+
for i in {1..30}; do
107+
if curl -f http://localhost:5000/ 2>/dev/null; then
108+
echo "Application started successfully!"
109+
break
110+
fi
111+
echo "Waiting... attempt $i/30"
112+
sleep 1
113+
if [ $i -eq 30 ]; then
114+
echo "Failed to start application after 30 seconds"
115+
echo "=== Server logs ==="
116+
cat /tmp/uvicorn.log
117+
exit 1
118+
fi
119+
done
120+
env:
121+
PYTHONUNBUFFERED: 1
122+
FASTAPI_SECRET_KEY: test-secret-key-for-ci
123+
APP_ENV: development
124+
FASTAPI_DEBUG: False
125+
FALKORDB_URL: redis://localhost:6379
126+
DISABLE_MCP: true
127+
# Azure OpenAI API keys - required for database schema analysis
128+
AZURE_API_KEY: ${{ secrets.AZURE_API_KEY }}
129+
AZURE_API_BASE: ${{ secrets.AZURE_API_BASE }}
130+
AZURE_API_VERSION: ${{ secrets.AZURE_API_VERSION }}
131+
132+
# Install Playwright browsers
133+
- name: Install Playwright Browsers
134+
run: npx playwright install --with-deps chromium firefox
135+
136+
# Create auth directory for storage state
137+
- name: Create auth directory
138+
run: mkdir -p e2e/.auth
139+
140+
# Run Playwright tests
141+
- name: Run Playwright tests
142+
run: npx playwright test --reporter=list
143+
env:
144+
CI: true
145+
146+
# Upload test results on failure
147+
- uses: actions/upload-artifact@v4
148+
if: failure()
149+
with:
150+
name: playwright-report
151+
path: playwright-report/
152+
retention-days: 30
153+
154+
# Upload test screenshots on failure
155+
- uses: actions/upload-artifact@v4
156+
if: failure()
157+
with:
158+
name: test-results
159+
path: test-results/
160+
retention-days: 30
161+
162+
# Cleanup - Stop all containers
163+
- name: Cleanup Docker containers
164+
if: always()
165+
run: |
166+
docker compose -f e2e/docker-compose.test.yml down -v || true
167+
docker stop falkordb-test || true
168+
docker rm falkordb-test || true

.github/workflows/spellcheck.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ permissions:
33
contents: read
44
on:
55
push:
6-
branches: [main]
6+
branches: [main, staging]
77
pull_request:
8-
branches: [main]
8+
branches: [main, staging]
99
jobs:
1010
spellcheck:
1111
runs-on: ubuntu-latest

.github/workflows/tests.yml

Lines changed: 4 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ jobs:
4747
npm --version || true
4848
(cd app && npm ci)
4949
50+
- name: Build frontend
51+
run: |
52+
cd app && npm run build
53+
5054
- name: Create test environment file
5155
run: |
5256
cp .env.example .env
@@ -60,67 +64,3 @@ jobs:
6064
- name: Run lint
6165
run: |
6266
make lint
63-
64-
e2e-tests:
65-
runs-on: ubuntu-latest
66-
67-
services:
68-
falkordb:
69-
image: falkordb/falkordb:latest
70-
ports:
71-
- 6379:6379
72-
options: >-
73-
--health-cmd "redis-cli ping"
74-
--health-interval 10s
75-
--health-timeout 5s
76-
--health-retries 5
77-
78-
steps:
79-
- uses: actions/checkout@v4
80-
81-
- name: Set up Python
82-
uses: actions/setup-python@v5
83-
with:
84-
python-version: '3.12'
85-
86-
- name: Install pipenv
87-
run: |
88-
python -m pip install --upgrade pip
89-
pip install pipenv
90-
91-
- name: Install dependencies
92-
run: |
93-
pipenv sync --dev
94-
95-
- name: Install Playwright browsers
96-
run: |
97-
pipenv run playwright install chromium
98-
pipenv run playwright install-deps
99-
100-
- name: Create test environment file
101-
run: |
102-
cp .env.example .env
103-
echo "FALKORDB_HOST=localhost" >> .env
104-
echo "FALKORDB_PORT=6379" >> .env
105-
echo "FASTAPI_SECRET_KEY=test-secret-key-for-ci" >> .env
106-
echo "FASTAPI_DEBUG=False" >> .env
107-
108-
- name: Wait for FalkorDB
109-
run: |
110-
timeout 60 bash -c 'until docker exec "$(docker ps -q --filter ancestor=falkordb/falkordb:latest)" redis-cli ping; do sleep 2; done'
111-
112-
- name: Run E2E tests
113-
run: |
114-
pipenv run pytest tests/e2e/ --browser chromium
115-
env:
116-
CI: true
117-
118-
- name: Upload test artifacts
119-
uses: actions/upload-artifact@v4
120-
if: failure()
121-
with:
122-
name: playwright-report
123-
path: |
124-
test-results/
125-
playwright-report/
126-
retention-days: 30

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ tests/e2e/screenshots/*.png
1717
tmp_*
1818
*.d.ts
1919
node_modules/
20+
21+
# Frontend build outputs
2022
/app/public/js/*
23+
/app/dist/
24+
2125
.jinja_cache/
2226
demo_tokens.py
27+
.DS_Store
28+
29+
# Playwright
30+
/playwright-report/
31+
/blob-report/
32+
/playwright/.cache/
33+
/playwright/.auth/
34+
e2e/.auth/

0 commit comments

Comments
 (0)