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

Refactor integration test fixtures and implement direct_message integration test #238

Merged
merged 2 commits into from
Jul 20, 2022

Conversation

unode
Copy link
Collaborator

@unode unode commented Jun 23, 2021

Trying to address @jneeven 's request in #233 about integration tests.

Before that I need more control over when fixtures are initialized so removing autouse=True, making them scoped to module instead of session and also making both starting the bot and the driver as explicit fixture dependencies.

@unode
Copy link
Collaborator Author

unode commented Jun 23, 2021

On my system test_webhook_example.py::TestWebHookExample::test_webhook_listener failed both before and after the changes introduced. Can't tell if this is something specific to my setup.

@unode
Copy link
Collaborator Author

unode commented Jun 23, 2021

Oops I pushed the direct message commits again before rebasing. Fixing that.

@unode unode changed the title Refactor integration test fixtures Refactor integration test fixtures and implement direct_message integration test Jun 23, 2021
@unode unode force-pushed the direct_message branch 2 times, most recently from 093677c to 55484ea Compare June 23, 2021 20:36
@unode
Copy link
Collaborator Author

unode commented Jun 23, 2021

The tests specific to this PR are fixed but now another failed. Flaky test?

@unode
Copy link
Collaborator Author

unode commented Jun 29, 2021

Don't understand... This test passes reliably locally 😭

@attzonko attzonko marked this pull request as draft June 18, 2022 18:39
@unode unode force-pushed the direct_message branch 2 times, most recently from 0f20271 to 97da7a9 Compare July 15, 2022 18:40
@unode
Copy link
Collaborator Author

unode commented Jul 15, 2022

Reviving this PR.

After further testing it turns out the problem is launching the bot through fixtures. Previously scope="module" was used but this doesn't seem to behave as intended.

To workaround I added DirectPlugin to utils.py so that the main bot instance launched also includes the direct reply code to be tested.

@unode unode marked this pull request as ready for review July 15, 2022 18:51
@codeclimate
Copy link

codeclimate bot commented Jul 15, 2022

Code Climate has analyzed commit 855fb38 and detected 0 issues on this pull request.

View more on Code Climate.

@attzonko attzonko merged commit cba7513 into attzonko:main Jul 20, 2022
unode added a commit to unode/mmpy_bot that referenced this pull request Feb 9, 2023
…ration test (attzonko#238)

* Fix docs monospace styling

* Test replies via direct messages
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