Skip to content

Commit

Permalink
chore(speed): don't run all tests in PoE and EE runs (#17223)
Browse files Browse the repository at this point in the history
chore (speed): don't run all tests in PoE and EE runs
  • Loading branch information
pauldambra authored Aug 29, 2023
1 parent 59d4398 commit 1fd03b0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 35 deletions.
45 changes: 20 additions & 25 deletions .github/actions/run-backend-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,29 @@ runs:
PERSON_ON_EVENTS_V2_ENABLED: ${{ inputs.person-on-events }}
GROUPS_ON_EVENTS_ENABLED: ${{ inputs.person-on-events }}
shell: bash
run: | # async_migrations are covered in ci-async-migrations.yml
pytest hogvm posthog -m "not async_migrations" \
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'
|| 'hogvm posthog'
}} -m "not async_migrations" \
--splits ${{ inputs.concurrency }} --group ${{ inputs.group }} \
--durations=100 --durations-min=1.0 --store-durations \
--durations=100 --durations-min=1.0 \
$PYTEST_ARGS
- name: 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" \
--splits ${{ inputs.concurrency }} --group ${{ inputs.group }} \
--durations=100 --durations-min=1.0 \
$PYTEST_ARGS
- name: Run Decide read replica tests
- name: Run /decide read replica tests
if: ${{ inputs.segment == 'FOSS' && inputs.group == 1 && inputs.person-on-events != 'true' }}
env:
POSTHOG_DB_NAME: posthog
Expand All @@ -116,24 +132,3 @@ runs:
pytest posthog/api/test/test_decide.py::TestDecideUsesReadReplica \
--durations=100 --durations-min=1.0 \
$PYTEST_ARGS
- name: 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 are covered in ci-async-migrations.yml
pytest ee -m "not async_migrations" \
--splits ${{ inputs.concurrency }} --group ${{ inputs.group }} \
--durations=100 --durations-min=1.0 --store-durations \
$PYTEST_ARGS
# Post-tests

- name: Upload updated timing data as artifacts
uses: actions/upload-artifact@v2
if: ${{ inputs.segment == 'EE' && inputs.person-on-events != 'true'}}
with:
name: timing_data-${{ inputs.group }}
path: .test_durations
6 changes: 0 additions & 6 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,6 @@ jobs:
fetch-depth: 1
path: 'current/'

- name: Stop/Start stack with Docker Compose
run: |
cd current
docker compose -f docker-compose.dev.yml down
docker compose -f docker-compose.dev.yml up -d
- name: Set up Python
id: python
uses: buildjet/setup-python@v4
Expand Down
5 changes: 2 additions & 3 deletions ee/clickhouse/test/test_system_status.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from posthog.clickhouse.system_status import system_status


def test_system_status(db):
from posthog.clickhouse.system_status import system_status

results = list(system_status())
assert [row["key"] for row in results] == [
"clickhouse_alive",
Expand Down
3 changes: 2 additions & 1 deletion posthog/queries/time_to_see_data/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from rest_framework import serializers

from posthog.api.shared import UserBasicSerializer
from posthog.models.user import User


Expand Down Expand Up @@ -35,6 +34,8 @@ class SessionResponseSerializer(serializers.Serializer):
user = serializers.SerializerMethodField()

def get_user(self, session):
from posthog.api.shared import UserBasicSerializer

user = self.context.get("user_lookup", UserLookup([session])).get(session["user_id"])
return UserBasicSerializer(user).data

Expand Down

0 comments on commit 1fd03b0

Please sign in to comment.