public inbox for [email protected]  
help / color / mirror / Atom feed
From: Dave Page <[email protected]>
To: Anthony Emengo <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: [pgadmin4][patch] Use pytest test runner for unit tests
Date: Thu, 24 May 2018 15:05:16 +0100
Message-ID: <CA+OCxoyhMprhxCMss5oESTMcVVnVcyBOP_AuntNyZsRyeZu5rg@mail.gmail.com> (raw)
In-Reply-To: <CAG8BBZM0gapFd0ZvMq7euCYamxKEBNqewC4YX4bYddyc_6AatA@mail.gmail.com>
References: <CAG8BBZM0gapFd0ZvMq7euCYamxKEBNqewC4YX4bYddyc_6AatA@mail.gmail.com>

Hi

On Wed, May 23, 2018 at 10:48 PM, Anthony Emengo <[email protected]> wrote:

> Hey all,
>
> Attached is a rather large patch that attempts to introduce the Pytest
> test runner and Grappah test matcher into our code base. The patch replaces
> all of the previous python unit tests from the previous design. This is a
> follow-up from our previous proof of concept and discussion around the
> idiosyncrasies of our existing test suite.
>
> We are motivated to submit this change for the following reasons:
>
> 1. Having a highly customized test suite increases the learning curve
> towards contributing to the code base. Pytest is a mature stable python
> test framework that outside developers are more likely to be familiar with.
> 2. Pytest supports a lot of the features that we've built for our
> use-cases - out of the box, and with extensive documentation on the matter.
> 3. The lack of ability to run tests individually has become a pain point.
> Especially when it comes to debugging long running feature tests.
>
> Test can be ran with the following command:
>
> yarn test:unit
>
> ​
> Please let us know what you think and if there are any issues!
>

(pgadmin4) piranha:web dpage$ yarn test:unit

yarn run v1.3.2

$ yarn run linter && pytest -q pgadmin

$ yarn eslint --no-eslintrc -c .eslintrc.js --ext .js --ext .jsx .

$ /Users/dpage/git/pgadmin4/web/node_modules/.bin/eslint --no-eslintrc -c
.eslintrc.js --ext .js --ext .jsx .

Traceback (most recent call last):

  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/_pytest/config.py",
line 371, in _importconftest

    mod = conftestpath.pyimport()

  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/py/_path/local.py",
line 668, in pyimport

    __import__(modname)

  File "/Users/dpage/git/pgadmin4/web/pgadmin/__init__.py", line 29, in
<module>

    from pgadmin.model import db, Role, Server, ServerGroup, \

ImportError: No module named pgadmin.model

ERROR: could not load /Users/dpage/git/pgadmin4/web/pgadmin/conftest.py


error Command failed with exit code 4.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this
command.




>
> *Note: *The feature tests are not yet completed. We expect our CI to fail
> as a result of this patch. We will complete this step soon in a follow-up
> patch!
>
> https://docs.pytest.org/en/latest/
> https://github.com/grappa-py/grappa
>

 Please don't forget to update the README and top level Makefile as well!
I'll probably have to tweak my Windows CI jobs, but the Linux/Mac ones all
use the Makefile (which is also hard-coded into my fingers)!

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


view thread (17+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: [pgadmin4][patch] Use pytest test runner for unit tests
  In-Reply-To: <CA+OCxoyhMprhxCMss5oESTMcVVnVcyBOP_AuntNyZsRyeZu5rg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox