-
Notifications
You must be signed in to change notification settings - Fork 134
initial e2e tests #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
88eea78
initial e2e tests
gkorland 561f167
fix typo
gkorland bd7d7aa
Merge branch 'main' into e2e
gkorland dac8b10
update setup-python
gkorland f1fde0b
remove trailing spcaes
gkorland 8f53825
fix coderabbit comments
gkorland d20f88e
fix make tests
gkorland 6f07b18
fix postgres tests
gkorland 71057dc
fix unit tests
gkorland dee3132
fix unit tests
gkorland b529581
fix some tests
gkorland 86e8201
fix tests
gkorland 73ef0a5
fix test CI
gkorland f71c20e
Potential fix for code scanning alert no. 61: Uncontrolled data used …
gkorland 3e1eaf6
fix unit test
gkorland 50a9909
fix unit test
gkorland a74ba46
fix unit test
gkorland cf88817
fix codeql error
gkorland 42e6a13
fix lint issues
gkorland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,3 +32,6 @@ CVSS | |
| falkordb | ||
| pipenv | ||
| Pipenv | ||
| README | ||
| md | ||
| UI | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| name: E2E Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| e2e-tests: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| services: | ||
| falkordb: | ||
| image: falkordb/falkordb:latest | ||
| ports: | ||
| - 6379:6379 | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install pipenv | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install pipenv | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| pipenv sync --dev | ||
|
|
||
| - name: Install Playwright browsers | ||
| run: | | ||
| pipenv run playwright install chromium | ||
| pipenv run playwright install-deps | ||
|
|
||
| - name: Create test environment file | ||
| run: | | ||
| cp .env.example .env | ||
| echo "FALKORDB_HOST=localhost" >> .env | ||
| echo "FALKORDB_PORT=6379" >> .env | ||
| echo "FLASK_SECRET_KEY=test-secret-key-for-ci" >> .env | ||
| echo "FLASK_DEBUG=False" >> .env | ||
|
|
||
| - name: Wait for FalkorDB | ||
| run: | | ||
| until docker exec "$(docker ps -q --filter ancestor=falkordb/falkordb:latest)" redis-cli ping; do | ||
| echo "Waiting for FalkorDB..." | ||
| sleep 2 | ||
| done | ||
|
|
||
| - name: Run E2E tests | ||
| run: | | ||
| pipenv run pytest tests/e2e/ --browser chromium --video=on --screenshot=on | ||
| env: | ||
| CI: true | ||
|
|
||
| - name: Upload test artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| if: failure() | ||
| with: | ||
| name: playwright-report | ||
| path: | | ||
| test-results/ | ||
| playwright-report/ | ||
| retention-days: 30 | ||
|
|
||
| - name: Upload screenshots | ||
| uses: actions/upload-artifact@v4 | ||
| if: failure() | ||
| with: | ||
| name: screenshots | ||
| path: tests/e2e/screenshots/ | ||
| retention-days: 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| unit-tests: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| services: | ||
| falkordb: | ||
| image: falkordb/falkordb:latest | ||
| ports: | ||
| - 6379:6379 | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install pipenv | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install pipenv | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| pipenv sync --dev | ||
|
|
||
| - name: Create test environment file | ||
| run: | | ||
| cp .env.example .env | ||
| echo "FLASK_SECRET_KEY=test-secret-key" >> .env | ||
| echo "FLASK_DEBUG=False" >> .env | ||
|
|
||
| - name: Run unit tests | ||
| run: | | ||
| pipenv run pytest tests/ -k "not e2e" --verbose | ||
|
|
||
| - name: Run pylint | ||
| run: | | ||
| pipenv run pylint "$(git ls-files '*.py')" || true | ||
|
|
||
| e2e-tests: | ||
| runs-on: ubuntu-latest | ||
| needs: unit-tests | ||
|
|
||
| services: | ||
| falkordb: | ||
| image: falkordb/falkordb:latest | ||
| ports: | ||
| - 6379:6379 | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install pipenv | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install pipenv | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| pipenv sync --dev | ||
|
|
||
| - name: Install Playwright browsers | ||
| run: | | ||
| pipenv run playwright install chromium | ||
| pipenv run playwright install-deps | ||
|
|
||
| - name: Create test environment file | ||
| run: | | ||
| cp .env.example .env | ||
| echo "FALKORDB_HOST=localhost" >> .env | ||
| echo "FALKORDB_PORT=6379" >> .env | ||
| echo "FLASK_SECRET_KEY=test-secret-key-for-ci" >> .env | ||
| echo "FLASK_DEBUG=False" >> .env | ||
|
|
||
| - name: Wait for FalkorDB | ||
| run: | | ||
| timeout 60 bash -c 'until docker exec "$(docker ps -q --filter ancestor=falkordb/falkordb:latest)" redis-cli ping; do sleep 2; done' | ||
|
|
||
| - name: Run E2E tests | ||
| run: | | ||
| pipenv run pytest tests/e2e/ --browser chromium | ||
| env: | ||
| CI: true | ||
|
|
||
| - name: Upload test artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| if: failure() | ||
| with: | ||
| name: playwright-report | ||
| path: | | ||
| test-results/ | ||
| playwright-report/ | ||
| retention-days: 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| .PHONY: help install test test-unit test-e2e test-e2e-headed lint format clean setup-dev | ||
|
|
||
| help: ## Show this help message | ||
| @echo 'Usage: make [target]' | ||
| @echo '' | ||
| @echo 'Targets:' | ||
| @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST) | ||
|
|
||
| install: ## Install dependencies | ||
| pipenv sync --dev | ||
|
|
||
| setup-dev: install ## Set up development environment | ||
| pipenv run playwright install chromium | ||
| pipenv run playwright install-deps | ||
| @echo "Development environment setup complete!" | ||
| @echo "Don't forget to copy .env.example to .env and configure your settings" | ||
|
|
||
| test: test-unit test-e2e ## Run all tests | ||
|
|
||
| test-unit: ## Run unit tests only | ||
| pipenv run pytest tests/ -k "not e2e" --verbose | ||
|
|
||
| test-e2e: ## Run E2E tests headless | ||
| pipenv run pytest tests/e2e/ --browser chromium | ||
|
|
||
| test-e2e-headed: ## Run E2E tests with browser visible | ||
| pipenv run pytest tests/e2e/ --browser chromium --headed | ||
|
|
||
| test-e2e-debug: ## Run E2E tests with debugging enabled | ||
| pipenv run pytest tests/e2e/ --browser chromium --slowmo=1000 | ||
|
|
||
| lint: ## Run linting | ||
| pipenv run pylint $(shell git ls-files '*.py') | ||
|
|
||
| format: ## Format code (placeholder - add black/autopep8 if needed) | ||
| @echo "Add code formatting tool like black here" | ||
|
|
||
| clean: ## Clean up test artifacts | ||
| rm -rf test-results/ | ||
| rm -rf playwright-report/ | ||
| rm -rf tests/e2e/screenshots/ | ||
| rm -rf __pycache__/ | ||
| find . -name "*.pyc" -delete | ||
| find . -name "*.pyo" -delete | ||
|
|
||
| run-dev: ## Run development server | ||
| pipenv run flask --app api.index run --debug | ||
|
|
||
| run-prod: ## Run production server | ||
| pipenv run flask --app api.index run | ||
|
|
||
| docker-falkordb: ## Start FalkorDB in Docker for testing | ||
| docker run -d --name falkordb-test -p 6379:6379 falkordb/falkordb:latest | ||
|
|
||
| docker-stop: ## Stop test containers | ||
| docker stop falkordb-test || true | ||
| docker rm falkordb-test || true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Declare a default
alltarget and keep the.PHONYlist in syncGNU Make expects an
alltarget in most projects; several tools assume it’s the canonical entry-point.Additionally, the
.PHONYdeclaration is missing the targets that appear later in the file (run-dev,run-prod,docker-falkordb,docker-stop) so they can be shadowed by files or directories of the same name.🧰 Tools
🪛 checkmake (0.2.2)
[warning] 1-1: Missing required phony target "all"
(minphony)
🤖 Prompt for AI Agents