#2345 Refactor some pagure.lib unit tests and move them to tests/lib
Closed by cverna. Opened by cverna.
cverna/pagure more_unittest_cleaning  into  master

Download 2345.patch

This is quite a big change, I have continued refactoring the unit test for pagure.lib methods. I have moved the related tests under the tests/lib folder.

I did not managed to run the full unit test suite in environment, so it would be good to test this change locally. I am also interested to see if it speed up a little the unit test runtime.

Looks like this conflicts with the recent merges I made, sorry about that :-s

rebased

Rebased :)

Your branch

Ran 607 tests in 2059.960s
FAILED (SKIP=1, errors=2, failures=9)

Master:

Ran 600 tests in 1869.250s
OK (SKIP=1)

Thanks quite interesting results. I guess it is slower because I am creating more classes .

I ll spend time to try to run the full suite in my environment.

rebased

6 new commits added

  • Fix the failling test in test_pagure_lib
  • Refactor the test_pagure_lib.py so that it does not use the methods
  • Move the unit tests related to pagure.lib search issues methods
  • Move the unit tests related to new, edit, add
  • Move the unit test related to pagure.lib search_user methods
  • Move the unit test related to pagure.lib search_projects methods

The tests are now passing but it is much slower :( about 45 min. So let's keep this PR open. I ll work on making the worker and broker non default.

rebased

This is what I have now:

$ git lol -1 
* 1731575 (HEAD -> more_unittest_cleaning) Move test_pagure_lib.py to the tests/lib subfolder
$ ./runtests.sh
....
Ran 607 tests in 2195.376s
FAILED (SKIP=1, errors=2, failures=9)
./runtests.sh  1700.55s user 110.84s system 82% cpu 36:37.24 total

rebased

Pull-Request has been closed by cverna

Going to use a different approach to this :smile:

Metadata