-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
test(e2e): Actually run Celery tasks async in e2e-test-runner
#23973
test(e2e): Actually run Celery tasks async in e2e-test-runner
#23973
Conversation
Size Change: 0 B Total Size: 1.07 MB ℹ️ View Unchanged
|
dc2c84e
to
be64bf2
Compare
@Twixes, I tried to run the command
|
This was pretty bad - local E2E behavior was much different from actual app behavior.
ad76b60
to
41d6bbf
Compare
@@ -103,4 +102,6 @@ $SKIP_SETUP_DEV || setupDev | |||
# Only start webpack if not already running | |||
nc -vz 127.0.0.1 8234 2> /dev/null || ./bin/start-frontend & | |||
pnpm dlx cypress open --config-file cypress.e2e.config.ts & | |||
uv pip install -r requirements.txt -r requirements-dev.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to install uv
locally, maybe we should add this to requirements-dev.txt
so that all the guides like 'Developing locally` work out of the box?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the point of uv
is to be global, like pnpm/npm or other package managers, so that's why we don't include it in the dependency list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
@Twixes works well now. One question: should we pre-populate the test DB with test data? Previously, we did have data: With these changes, there is no default data, so it's somewhat hard to test cases like breakdowns where we need at least a few data points: |
That's really weird @skoob13, there should still be data (via the |
Tried locally and everything worked, so I believe that might have been a fluke Georgiy. #BiasForImpact |
6fe1570
into
revert-23977-revert-23808-fix/insight-single-load-cached
Problem
Adding accurate E2E tests for behavior relying on Celery tasks hasn't been possible, as
bin/e2e-test-runner
was actually running PostHog in TEST and DEBUG mode, resulting in non-production-like behavior, e.g. Celery tasks being always executed sync (CELERY_ALWAYS_EAGER
setting) or Django cache being in-memory rather than over Redis.With async insight execution being critical now (e.g. see #23808), we need to be able to test it.
Changes
This makes a few changes to the setup of
bin/e2e-test-runner
so that PostHog behavior mirrors production. This has allowed adding a test for async insight execution, that actually verifies execution being kicked off, and polled results becoming soon available.It doesn't look like significant changes to the CI workflow are necessary, as it doesn't set
TEST=1
orDEBUG=1
and already startsbin/docker-worker
.