Thread: PGWEB Testing Suite Development
Hello Everyone, I will be working on the project for developing the testing suite for pgweb repository this year as part of GSoC 2021.
Initially, to start off with the basic unit tests I propose to use the pytest module.
I have written a basic test just to take feedback on whether to go forward with this approach and file structure or not.
The branch is 'testing-suite' and the patch is attached.
Attachment
Hi Chirag, On 6/11/21 9:57 AM, Chirag Kasat wrote: > Hello Everyone, I will be working on the project for developing the > testing suite for pgweb repository this year as part of GSoC 2021. > Initially, to start off with the basic unit tests I propose to use the > pytest module. > I have written a basic test just to take feedback on whether to go > forward with this approach and file structure or not. > The branch is 'testing-suite' and the patch is attached. Thanks for getting this started. I haven't had time to test this out yet, but looking through the code this seems to be an overall correct approach. I have a few questions: 1. Instead of setting a range on the requirements limits for pytest + pytest-django, we should fix it to a specific version. If we need to upgrade, we can always increase the version number 2. Adding onto that, the commit message should address why we are using those specific versions. 3. In the pytest.ini, is there a reason we are searching for for all of those types of test files? Is that part of the pytest setup recommendations? 4. We should provide some documentation for how to run the tests. Probably a good place to start is in a file called "docs/testing.rst" Thanks again! Jonathan
Attachment
On Sun, Jun 13, 2021 at 5:29 PM Jonathan S. Katz <jkatz@postgresql.org> wrote: > > Hi Chirag, > > On 6/11/21 9:57 AM, Chirag Kasat wrote: > > Hello Everyone, I will be working on the project for developing the > > testing suite for pgweb repository this year as part of GSoC 2021. > > Initially, to start off with the basic unit tests I propose to use the > > pytest module. > > I have written a basic test just to take feedback on whether to go > > forward with this approach and file structure or not. > > The branch is 'testing-suite' and the patch is attached. > > Thanks for getting this started. > > I haven't had time to test this out yet, but looking through the code > this seems to be an overall correct approach. > > I have a few questions: > > 1. Instead of setting a range on the requirements limits for pytest + > pytest-django, we should fix it to a specific version. If we need to > upgrade, we can always increase the version number +1. I'd also note that as long as this will never introduce a requirement on "normal runtime", we're very flexible on which version it is. That is, if we only need it to run tests locally for example. But if it spills over with imports to code that need to be run on the prod webserver, then any modules outside of those that are packaged in Debian stable will introduce a significant maintenance overhead. And in the case of pytest, that would be version 3.10... But again, as long as it doesn't affect the main server mode, this is not an issue. > 2. Adding onto that, the commit message should address why we are using > those specific versions. > > 3. In the pytest.ini, is there a reason we are searching for for all of > those types of test files? Is that part of the pytest setup recommendations? > > 4. We should provide some documentation for how to run the tests. > Probably a good place to start is in a file called "docs/testing.rst" Yup, that seems like a good idea. -- Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/