Advise on unit testing framework enhancement

From: Sid <itissid(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org, pgsql-advocacy(at)postgresql(dot)org
Subject: Advise on unit testing framework enhancement
Date: 2015-02-18 12:09:19
Message-ID: CA+M3ju=QFkdJsVCew0jnuyXPYXzgPKUbJk+_Wx=YuKLiU3hWFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-general

There are many postgres unit testing libraries like pgtap
<http://pgtap.org/>, PGUnit <http://en.dklab.ru/lib/dklab_pgunit/> and Epic
<http://www.epictest.org/>.

But I think there might be some important things that are missing that
makes using these tools easier, so I wrote pypgTAP
<https://github.com/itissid/pypgTAP> project to make it easier at least for
me to use these tools.

*Here are the current issues that it solves for me:*
1. Creates a throwaway postgres server that loads up pgTAP library ready
for writing tests against and then spins it down.
2. Shares the python virtualenv of the client with the plpythonu stored
procedures on the throwaway. This allows easier python code reuse.
3. Allows a user to discover a resources within his test directory for
example for loading data for tests.
4. Multiple tests can be written
<https://github.com/itissid/pypgTAP#how-to-use-in-your-projectexample> in
pure SQL with pgtap and transparently executed very easily.

*How might I make it more useful for you?*
1. What missing features prevents people from testing your SQL/psql in
production that this tool might be enhanced with?
2. How do you maintain production code typically for postgres? For example,
does the DataDefinition exist in projects in some VCS like git/svn/hg or
does it exist as something managed by tools like Alembic; The latter can be
a deal breaker for you using this tool, as it assumes DataDefinition along
with DML code and its tests exist as physical files in a project directory.
3. Perhaps you want to plug in your own SQL libraries instead of pgTAP to
write tests against?

-Regards
Sid

Browse pgsql-advocacy by date

  From Date Subject
Next Message Andreas 'ads' Scherbaum 2015-02-18 23:49:01 Re: GSoC 2015 - mentors, students and admins.
Previous Message damien clochard 2015-02-18 11:55:54 Re: Reformatting the FDW wiki page

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2015-02-18 12:19:43 Re: postgresql93-9.3.5: deadlock when updating parent table expected?
Previous Message Bill Moran 2015-02-18 12:05:55 Re: postgresql93-9.3.5: deadlock when updating parent table expected?