mirror of
https://github.com/PostHog/posthog.git
synced 2024-12-01 04:12:23 +01:00
a71e899605
* remove django query tests * remove funnel and caching check * remove ee available var * remove is_clickhouse_enabled * remove abstract tests * change primary db * missing func * unnecessary test * try new e2e ci * func arg * remove param * ci * remove plugins in docker * background * change ur; * add kafka url * add step * update docker * primary docker file * mount volumes correctly * one more * remove postgres tests * remove foss * remove all is_clickhouse_neabled * remove irrelelvant test * remove extra arg * remove var * arg * add foss comment * add foss comment * plugin server config * Update posthog/utils.py Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com> * migrate commands * comment * add clickhouse to pg tests * change script * change ordering * deepsource * restore foss tests * test remove KAFKA_ENABLED from CI * always wait * up proper resources * use one conftest * restore * remove unnecessary tests * remove more pg * log event tests * fix more tests * more tests * type * fix more tests * last test * typing * account for shared class setup * temp test cloud * restore cloud master checkout * adjust contexts * backwards Co-authored-by: Karl-Aksel Puulmann <macobo@users.noreply.github.com> Co-authored-by: yakkomajuri <yakko.majuri@gmail.com>
38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
from django.core.management.base import BaseCommand
|
|
|
|
|
|
class Command(BaseCommand):
|
|
help = "Set up databases for non-Python tests that depend on the Django server"
|
|
|
|
def handle(self, *args, **options):
|
|
from django.test.runner import DiscoverRunner as TestRunner
|
|
|
|
test_runner = TestRunner(interactive=False)
|
|
test_runner.setup_databases()
|
|
test_runner.setup_test_environment()
|
|
|
|
from infi.clickhouse_orm import Database
|
|
|
|
from posthog.settings import (
|
|
CLICKHOUSE_DATABASE,
|
|
CLICKHOUSE_HTTP_URL,
|
|
CLICKHOUSE_PASSWORD,
|
|
CLICKHOUSE_REPLICATION,
|
|
CLICKHOUSE_USER,
|
|
CLICKHOUSE_VERIFY,
|
|
)
|
|
|
|
database = Database(
|
|
CLICKHOUSE_DATABASE,
|
|
db_url=CLICKHOUSE_HTTP_URL,
|
|
username=CLICKHOUSE_USER,
|
|
password=CLICKHOUSE_PASSWORD,
|
|
verify_ssl_cert=CLICKHOUSE_VERIFY,
|
|
)
|
|
|
|
try:
|
|
database.create_database()
|
|
except:
|
|
pass
|
|
database.migrate("ee.clickhouse.migrations", replicated=CLICKHOUSE_REPLICATION)
|