Re: [pgadmin4][patch] Use pytest test runner for unit tests
От | Dave Page |
---|---|
Тема | Re: [pgadmin4][patch] Use pytest test runner for unit tests |
Дата | |
Msg-id | CA+OCxowq+5CSjtQNnmy_vf4m3=kd6XGYyFkh=nevQ6qF+5RxPg@mail.gmail.com обсуждение исходный текст |
Ответ на | [pgadmin4][patch] Use pytest test runner for unit tests (Anthony Emengo <aemengo@pivotal.io>) |
Ответы |
Re: [pgadmin4][patch] Use pytest test runner for unit tests
(Joao De Almeida Pereira <jdealmeidapereira@pivotal.io>)
|
Список | pgadmin-hackers |
Hello Hackers,
We have good news, we just finished porting all the tests to pytest/grappa. Please see the attached diff with the multiple commits for this. Bare with us in this HUGE patch. We split it as follow:0001 - Convert all the Unit Tests to pytest/grappa(Patch previously sent, with some tests that were not running previously
0002 - Change of README, makefile and package.json to use the new syntax
0003 - Convert all the Feature Tests to pytest/grappaFrom now on, we can launch 1 test at a time if we want to by using pytest. (In this gist https://gist.github.com/
kwmiebach/3fd49612ef7a52b5ce3a there are some examples on how to use it) Because we are using the pytest CLI all the options are made available to use, the community also as a ton of plugins if we ever need something else. We updated all README’s with the following information as well.
As we discussed previously in order to use the pytest binary directly you need to point the
PYTHONPATH
to$PGADMIN_SRC/web
If you do not want to do that then you can use it like thisweb $ python -m pytest -q -s pgadmin
We also changed the feature test, they now are under
regression/feature_tests
as they do no longer need to be in the application path in order to run.
To address the password issue we added to the makefilepython -m pytest --tb=short -q --json=regression/test_result.
json --log-file-level=DEBUG --log-file=regression/ regression.log pgadmin the
--tb=short
options is the one responsible for removing a chunk of the traceback, making it smaller and hiding the variable printingKnown issues:
- Python 2.7, the library we are using for assertions (Grappa) is failing while trying to assert on strings. We created a PR to the library: https://github.com/grappa-py/
grappa/pull/43 as soon as this gets in all the tests should pass
- We found out that the tests in
pgadmin/browser/tests
where not running because they needed SERVER_MODE to be True. We ported these tests but 2 tests are still failingTestResetPassword.test_success
andTestChangePassword.test_
. They are currently failing for 2 different reasons, but when we went back tosuccess master
branch they were also failing. So we kept them with the markxfail
, this mark allow us to run the tests and do not report the failure. You can read more one the topic at (https://docs.pytest.org/en/3.6.0/skipping.html). Unfortunately we were not able to correct the issues, if someone could look into these test it would be great.
- Jenkins server need a change. Because we now run tests for a single database at a time the Jenkins flow need to change. Our proposal for this is to isolate each database in its own task something similar to the pipeline that we currently use internally:
The boxes that we are pointing with the teal arrow represent 1 Python Version Against 1 Database. This can be accomplished using Jenkins as well. In order to accomplish that we are going to generate e Jenkinsfile(https://jenkins.
io/doc/book/pipeline/ jenkinsfile/) to do this in a more DSL manner, making it easier for us to deploy the pipeline in a more consistent way. The LTS version of jenkins is 2.107.3 the version that we have in CI should be ok, but is always good to be in a LTS version of Jenkins or newer because the community is pretty active.
The idea would be to replace the 5 tasks that we have there and start using a pipeline that will spawn docker containers to isolate the testing between version/database. That is what we do with concourse as we depicted in the previous image.
Does anyone have any thoughts about this?
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Вложения
В списке pgadmin-hackers по дате отправления:
Следующее
От: Aditya ToshniwalДата:
Сообщение: Re: [pgAdmin4][RM#3289] Can't query SQL_ASCII database.