-
Notifications
You must be signed in to change notification settings - Fork 55
feat(flags): Implement local evaluation for flag dependencies #288
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
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
075f05c
feat(flags): Implement support for flag dependencies
haacked 6dabe6e
Source the .env file if it exists
haacked 442eaaa
security: Remove hardcoded API keys from integration tests
haacked 6bcf113
docs: Fix incorrect module path in integration test usage
haacked 687bb7d
test: Fix value format consistency for exact operator
haacked 025907c
feat: Add groups context to dependency evaluation
haacked 714411b
docs: Add examples to match_flag_dependency docstring
haacked d9e7b00
ruff format .
haacked 2b01c9b
Update bin/fmt to match CI
haacked dd16231
Add mypy to bin/fmt
haacked cafc003
fix: Raise InconclusiveMatchError for missing group type mapping
haacked 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
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,65 @@ | ||
| #!/usr/bin/env bash | ||
| #/ Usage: bin/run_integration_tests [--debug] | ||
| #/ Description: Runs integration tests for PostHog Python SDK | ||
| #/ Options: | ||
| #/ --debug Enable debug mode for verbose output | ||
| source bin/helpers/_utils.sh | ||
| set_source_and_root_dir | ||
|
|
||
| ensure_virtual_env | ||
|
|
||
| # Parse arguments | ||
| DEBUG_MODE=false | ||
| while [[ $# -gt 0 ]]; do | ||
| case $1 in | ||
| --debug) | ||
| DEBUG_MODE=true | ||
| shift | ||
| ;; | ||
| --help|-h) | ||
| grep '^#/' "$0" | cut -c4- | ||
| exit 0 | ||
| ;; | ||
| *) | ||
| error "Unknown option: $1" | ||
| echo "Use --help for usage information" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| echo "🚀 PostHog Python SDK Integration Tests" | ||
| echo "=" | head -c 40 | tr '\n' '=' | ||
| echo | ||
|
|
||
| # Load .env file if it exists | ||
| if [ -f ".env" ]; then | ||
| echo "📝 Loading environment variables from .env file..." | ||
| set -a # automatically export all variables | ||
| source .env | ||
| set +a # disable auto-export | ||
| fi | ||
|
|
||
| # Check if the integration test file exists | ||
| INTEGRATION_TEST_FILE="posthog/test/manual_integration/test_flag_dependencies.py" | ||
| if [ ! -f "$INTEGRATION_TEST_FILE" ]; then | ||
| fatal "❌ Integration test file not found: $INTEGRATION_TEST_FILE" | ||
| fi | ||
|
|
||
| echo "📋 Running flag dependencies integration test..." | ||
| if [ "$DEBUG_MODE" = true ]; then | ||
| echo "🔍 Debug mode enabled" | ||
| export POSTHOG_DEBUG=true | ||
| fi | ||
| echo | ||
|
|
||
| # Run the integration test | ||
| if python "$INTEGRATION_TEST_FILE"; then | ||
| echo | ||
| echo "🎉 All integration tests passed!" | ||
| exit 0 | ||
| else | ||
| echo | ||
| error "💥 Integration tests failed!" | ||
| exit 1 | ||
| fi |
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.
Uh oh!
There was an error while loading. Please reload this page.