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

feat(ci): split out temporal, make tests faster #21636

Merged
merged 44 commits into from
Apr 18, 2024
Merged

feat(ci): split out temporal, make tests faster #21636

merged 44 commits into from
Apr 18, 2024

Conversation

neilkakkar
Copy link
Contributor

@neilkakkar neilkakkar commented Apr 18, 2024

Problem

Following up from #21613 , this makes tests twice as fast faster, with max time down to ~10 mins from ~20 mins, and extracts out temporal tests into its own thing, because there seems to be some strong dependence there causing tests to time out if not run together (? - didn't investigate this deeply).

It combines foss and ee, because ee were running much more quickly, and doesn't seem like there's any reason to keep them separate now.

But the other advantage of going this route is we don't need to wait for temporal in regular tests, making them faster.

Should be more robust, and the tests do seem to be more evenly distributed. Will consider making the durations update more seamless, to make this easy to update and keep in sync

One thing to be cautious of is whether this makes flopping snapshots more prevalent. If yes, I'd argue that is a problem with tests we should fix (since they depend on order they run in), and try to keep this optimisation in. I've fixed some of these but not sure if new ones will prop up.

Lastly there's this one damn test https://github.com/PostHog/posthog/blob/master/posthog/test/test_decorators.py#L29 which I have no idea why its failing. I will skip this test 🙈 - unless you have any ideas what might be going wrong here?

Changes

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

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

How did you test this code?

@neilkakkar neilkakkar marked this pull request as ready for review April 18, 2024 12:04
@neilkakkar neilkakkar requested a review from tomasfarias April 18, 2024 12:09
Copy link
Collaborator

@mariusandra mariusandra left a comment

Choose a reason for hiding this comment

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

LGTM, assuming tests pass 🤣

response = self.client.get(f"/api/dummy").json()

print(response) # noqa: T201
Copy link
Collaborator

Choose a reason for hiding this comment

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

:O

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is me trying to debug a CI only failure 😓 - still doesn't work

@@ -144,7 +145,7 @@ runs:
run: echo "PYTEST_ARGS=--snapshot-update" >> $GITHUB_ENV # We can only update snapshots within the PostHog org

# Tests
- name: Run FOSS tests
- name: Run FOSS & EE tests
Copy link
Member

Choose a reason for hiding this comment

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

really we should keep them separate so that someone using the FOSS repo can run the tests

in practice you already can't run the FOSS tests without the EE folder present

so 🙈

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh darn it, I'll create a separate route for the foss repo, good point thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh wait, that second line.... uhmm uhmm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe a future-(Neil|Paul) problem to solve 🙈

Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

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

😍

@neilkakkar
Copy link
Contributor Author

only failure now is the test failing on master

Copy link
Contributor

@tomasfarias tomasfarias left a comment

Choose a reason for hiding this comment

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

Assuming tests are passing, works for me 👍 Tag me if any of the batch exports are failing and I could take a look.

@neilkakkar neilkakkar merged commit 9f43a3f into master Apr 18, 2024
98 checks passed
@neilkakkar neilkakkar deleted the ci-update branch April 18, 2024 15:25
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.

5 participants