Page MenuHomePhabricator

Create a wmfdata-python test script
Closed, ResolvedPublic

Description

We should write a script that uses wmfdata-python as an analyst would (for example, writing data to MariaDB and Hive and querying it back) and checks that the results were correct and no errors were raised. Once checked into the repo, it can be used by folks working on the package as a smoke test before pushing changes. It will also be helpful for Data Engineering, to test that key functionality still works after infrastructure changes.

Event Timeline

kzimmerman triaged this task as Medium priority.Mar 10 2020, 5:31 PM

I don't know that we can have automated testing for anything that requires querying a database.

I don't know that we can have automated testing for anything that requires querying a database.

Well, we can write a script that uses wmfdata as an analyst would (for example, writing data to MariaDB and Hive and querying it back) and checks that the results were correct and no errors were raised. If we check that into the repo, we can use it an easy-to-run, comprehensive (albeit manual) smoke test before we push changes.

We couldn't do it server-side, because as you say it would require database access. I was thinking about client-side automation using a Git pre-commit hook, but that's probably too heavyweight and in any case a quick read of the docs suggests it might not work the way I thought.

So, I guess I'm talking about making a test suite we can run manually rather than automated testing!

nshahquinn-wmf renamed this task from Add automated tests to wmfdata to Add a test script to wmfdata.Apr 19 2020, 5:08 PM
nshahquinn-wmf updated the task description. (Show Details)
nshahquinn-wmf lowered the priority of this task from Medium to Low.Dec 21 2020, 5:55 PM
nshahquinn-wmf raised the priority of this task from Low to Medium.

I've got a pull request up! Will check in with potential reviewers next week.

nshahquinn-wmf renamed this task from Add a test script to wmfdata to Add a test script to wmfdata-python.Nov 30 2021, 11:24 PM
nshahquinn-wmf renamed this task from Add a test script to wmfdata-python to Create a wmfdata-python test script.
nshahquinn-wmf updated the task description. (Show Details)
nshahquinn-wmf added a subscriber: BTullis.

Okay, I've reworked the pull request and solved the outstanding issues (particularly the database permissions issue).

I'd like a review before I merge it; @nettrom_WMF, @BTullis, @Ottomata, @Milimetric: would any of you like to volunteer?

@Milimetric in case you missed it, I made some changes to the PR in response to your comment. Let me know what you think!

I had, thanks, the regex looks good. I'm not able to test for merging this week, so I hope someone else can get to it. If not, I'll merge next week.

I had, thanks, the regex looks good. I'm not able to test for merging this week, so I hope someone else can get to it. If not, I'll merge next week.

Sounds good! I'm fine waiting until next week.

Okay, @Milimetric tested and approved, so I've gone ahead and merged it. This is done!