Skip to content

Commit

Permalink
Merge branch 'master' into dn-chore/one-timestamp-format
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin committed Apr 18, 2024
2 parents daea9e8 + 9f43a3f commit 9dbe8e0
Show file tree
Hide file tree
Showing 39 changed files with 6,826 additions and 453 deletions.
41 changes: 20 additions & 21 deletions .github/actions/run-backend-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
description: ClickHouse server image tag, e.g. clickhouse/clickhouse-server:latest
segment:
required: true
description: Either 'FOSS' or 'EE' segment
description: Either 'Core' or 'Temporal' segment
concurrency:
required: true
description: Count of concurrency groups
Expand Down Expand Up @@ -132,6 +132,7 @@ runs:
run: bin/check_kafka_clickhouse_up

- name: Wait for Temporal
if: ${{ inputs.segment == 'Temporal' }}
shell: bash
run: |
bin/check_temporal_up
Expand All @@ -144,39 +145,27 @@ runs:
run: echo "PYTEST_ARGS=--snapshot-update" >> $GITHUB_ENV # We can only update snapshots within the PostHog org

# Tests
- name: Run FOSS tests
id: run-foss-tests
if: ${{ inputs.segment == 'FOSS' }}
- name: Run Core tests
id: run-core-tests
if: ${{ inputs.segment == 'Core' }}
env:
PERSON_ON_EVENTS_V2_ENABLED: ${{ inputs.person-on-events }}
GROUPS_ON_EVENTS_ENABLED: ${{ inputs.person-on-events }}
shell: bash
run: | # async_migrations covered in ci-async-migrations.yml
pytest ${{
inputs.person-on-events == 'true'
&& './posthog/clickhouse/ ./posthog/hogql/ ./posthog/queries/ ./posthog/api/test/test_insight* ./posthog/api/test/dashboards/test_dashboard.py'
&& './posthog/clickhouse/ ./posthog/queries/ ./posthog/api/test/test_insight* ./posthog/api/test/dashboards/test_dashboard.py'
|| 'hogvm posthog'
}} -m "not async_migrations" \
--splits ${{ inputs.concurrency }} --group ${{ inputs.group }} \
--durations=100 --durations-min=1.0 --store-durations \
$PYTEST_ARGS
- name: Run EE tests
id: run-ee-tests
if: ${{ inputs.segment == 'EE' }}
env:
PERSON_ON_EVENTS_V2_ENABLED: ${{ inputs.person-on-events }}
GROUPS_ON_EVENTS_ENABLED: ${{ inputs.person-on-events }}
shell: bash
run: | # async_migrations covered in ci-async-migrations.yml
pytest ${{ inputs.person-on-events == 'true' && 'ee/clickhouse/' || 'ee/' }} -m "not async_migrations" \
}} ${{ inputs.person-on-events == 'true' && 'ee/clickhouse/' || 'ee/' }} -m "not async_migrations" \
--ignore=posthog/temporal \
--splits ${{ inputs.concurrency }} --group ${{ inputs.group }} \
--durations=100 --durations-min=1.0 --store-durations \
$PYTEST_ARGS
- name: Run /decide read replica tests
id: run-decide-read-replica-tests
if: ${{ inputs.segment == 'FOSS' && inputs.group == 1 && inputs.person-on-events != 'true' }}
if: ${{ inputs.segment == 'Core' && inputs.group == 1 && inputs.person-on-events != 'true' }}
env:
POSTHOG_DB_NAME: posthog
READ_REPLICA_OPT_IN: 'decide,PersonalAPIKey, local_evaluation'
Expand All @@ -189,9 +178,19 @@ runs:
--durations=100 --durations-min=1.0 \
$PYTEST_ARGS
- name: Run Temporal tests
id: run-temporal-tests
if: ${{ inputs.segment == 'Temporal' }}
shell: bash
run: |
pytest posthog/temporal -m "not async_migrations" \
--splits ${{ inputs.concurrency }} --group ${{ inputs.group }} \
--durations=100 --durations-min=1.0 --store-durations \
$PYTEST_ARGS
# Post tests
- name: Show docker compose logs on failure
if: failure() && (steps.run-foss-tests.outcome != 'failure' && steps.run-ee-tests.outcome != 'failure' && steps.run-decide-read-replica-tests.outcome != 'failure')
if: failure() && (steps.run-core-tests.outcome != 'failure' && steps.run-decide-read-replica-tests.outcome != 'failure' && steps.run-temporal-tests.outcome != 'failure')
shell: bash
run: docker compose -f docker-compose.dev.yml logs

Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,18 @@ jobs:
python-version: ['3.10.10']
clickhouse-server-image:
['clickhouse/clickhouse-server:23.11.2.11-alpine', 'clickhouse/clickhouse-server:23.12.5.81-alpine']
segment: ['FOSS', 'EE']
segment: ['Core']
person-on-events: [false, true]
# :NOTE: Keep concurrency and groups in sync
concurrency: [5]
group: [1, 2, 3, 4, 5]
concurrency: [10]
group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
include:
- segment: 'Temporal'
person-on-events: false
clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.5.81-alpine'
python-version: '3.10.10'
concurrency: 1
group: 1

steps:
# The first step is the only one that should run if `needs.changes.outputs.backend == 'false'`.
Expand Down Expand Up @@ -304,7 +311,7 @@ jobs:
- name: Archive email renders
uses: actions/upload-artifact@v3
if: needs.changes.outputs.backend == 'true' && matrix.segment == 'FOSS' && matrix.person-on-events == false
if: needs.changes.outputs.backend == 'true' && matrix.segment == 'Core' && matrix.person-on-events == false
with:
name: email_renders
path: posthog/tasks/test/__emails__
Expand Down
Loading

0 comments on commit 9dbe8e0

Please sign in to comment.