Skip to content

Setup framework to do integration testing #50

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

Merged
merged 7 commits into from
Sep 6, 2021

Conversation

Azrenbeth
Copy link
Contributor

@Azrenbeth Azrenbeth commented Jul 22, 2021

BUILDS ON azren/stats_tests (PR #49)

Setup ability to do integration tests.

This done by starting a postgres docker image and running the tests using that.

NOTE: not currently run by github actions

@Azrenbeth Azrenbeth force-pushed the azren/integration_tests branch from 7731817 to d987aa6 Compare August 16, 2021 15:23
@Azrenbeth Azrenbeth marked this pull request as ready for review August 16, 2021 15:24
@Azrenbeth Azrenbeth requested a review from erikjohnston August 16, 2021 15:26
@Azrenbeth Azrenbeth changed the title Azren/integration tests Setup framework to do integration testing Aug 16, 2021
also added readme to tests/tmp/ so that the directory is present
when cloning repo (otherwise tests fail)
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

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

Can you add a README in the new integration test dir please, with info as to what and why we're doing this?

"INSERT INTO state_groups (id, room_id, event_id) VALUES ({},{},{});\n",
sg,
PGEscape(room_id),
PGEscape("left_blank")
Copy link
Member

Choose a reason for hiding this comment

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

Instead of using the slightly awful PGEscape here, can't we just do a bunch of client.execute(..) instead? It may be a touch slower but I think its much clearer.

Copy link
Contributor Author

@Azrenbeth Azrenbeth Aug 18, 2021

Choose a reason for hiding this comment

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

I used PGEscape because this is the same code used when the compressor generates the SQL in lib.rs (where we should have PGEscape or at least some sort of safe escaping) - and so if the reader can understand one they can understand both

@Azrenbeth
Copy link
Contributor Author

Can you add a README in the new integration test dir please, with info as to what and why we're doing this?

I added information in the next PR to the workspace README on how to run the tests allong with info on all the other running options

@Azrenbeth Azrenbeth requested a review from erikjohnston August 19, 2021 15:41
@Azrenbeth Azrenbeth merged commit 0f7f2c2 into matrix-org:main Sep 6, 2021
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