Skip to content
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

ci: Add dags folder to tests #28753

Merged
merged 4 commits into from
Feb 17, 2025
Merged

ci: Add dags folder to tests #28753

merged 4 commits into from
Feb 17, 2025

Conversation

tkaemming
Copy link
Contributor

@tkaemming tkaemming commented Feb 14, 2025

Problem

These tests aren't being run as part of CI

Changes

Run these tests as part of CI and ensure the tests use a clean database to avoid state leaks between test runs, as we're often running jobs that do DDL or DML operations on full tables

Does this work well for both Cloud and self-hosted?

N/A

How did you test this code?

They are tests

@tkaemming tkaemming marked this pull request as ready for review February 15, 2025 01:05
@tkaemming tkaemming requested a review from a team February 15, 2025 01:05
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR integrates the 'dags' folder into the CI test suite, focusing on ensuring test isolation and proper database cleanup for ClickHouse operations.

  • Added reset_clickhouse_database() function in posthog/test/base.py to handle database cleanup, improving code reuse and test isolation
  • Modified conftest.py to wrap cluster fixture with cleanup calls before and after each test
  • Updated .github/actions/run-backend-tests/action.yml to include 'dags' in test paths when person-on-events is false
  • Removed manual table truncation from test_deletes.py, relying on framework-level cleanup
  • Improved test structure in test_materialized_columns.py by standardizing query execution methods

5 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 161 to 165
pytest ${{
inputs.person-on-events == 'true'
&& './posthog/clickhouse/ ./posthog/queries/ ./posthog/api/test/test_insight* ./posthog/api/test/dashboards/test_dashboard.py'
|| 'posthog'
|| 'posthog dags'
}} ${{ inputs.person-on-events == 'true' && 'ee/clickhouse/' || 'ee/' }} -m "not async_migrations" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: The test path 'posthog dags' should be quoted as a single string to avoid shell interpretation issues, e.g. 'posthog dags'. Consider using './posthog ./dags' for more explicit path handling.

@tkaemming tkaemming merged commit da60e84 into master Feb 17, 2025
98 checks passed
@tkaemming tkaemming deleted the dag-test branch February 17, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants