misli / fedora-software

Web interface to Fedora Software database
BSD 3-Clause "New" or "Revised" License
12 stars 3 forks source link

Switch FunctionalTests from "TestCase" to "LiveServerTestCase" and add new tests #18

Closed pigjuliux closed 8 years ago

pigjuliux commented 8 years ago

1) Add new test for the 'carousel-featured' element of the home page This is a brand new FunctionalTest. It fails when the carousel displays Firefox, Gnome-Weather and Ardour. I'll fix the issue as soon as I identify the cause. Please note that this is not a bug of fedora-software, but an issue related only to the testing suite.

2) Add unit test related to Component's get_absolute_url This is simply a new unit test.

3) Adjust some spelling and add debugging for 'test_if_carousel_displays_a_valid_image' This adjusts some spelling and adds some information in order to track the issue related to the carousel.

4) Switch to LiveServerTestCase in order to make use of fixtures a) This deletes the need of a running webserver for the testing suite. b) The functional tests now use the fixtures prepared with the script in "bin/fedora-software-fixtures.py".

5) Merge remote-tracking branch 'upstream/master' due to the updating of translations from zanata With this, I've merged Jozef's latest commit.

pigjuliux commented 8 years ago

I've done some cleanups and added new unit tests related to the HomeView

jmlich commented 8 years ago

Thanks for contribution. I am not able to decide if is your patch have same direction as our development should have. I would like to ask @misli for quick review. It seems that is related to tests only (no new features), so deployment of this version to production is not necessary.

pigjuliux commented 8 years ago

Lots of modern approaches (such as TDD and BDD) teach that the entire development cycle might be driven by tests.

Since some parts of 'fedora-software' are already made, it's a bit late for TDD. But, in my opinion, a sort of automated testing might only increase the overall quality of the product. In future, it might discover regressions introduced by new commits. I'm not saying that the work I've done is complete, there is a lot to do in order to code a comprehensive suite, but this is a starting place.

Anyway, these are just opinions, feel free to decide :). But, if you don't want a test suite at all (or if you don't like the way I structured it), you should probably revert my previous commits or override the first changes I've made. Otherwise, you might end up with a really partial feature.

By the way, the failure of the test related to the 'carousel-featured' element (if that is the issue which is bothering you) was caused by a missing table on the fixture and has been solved by a new commit attached on this pull-request.

jmlich commented 8 years ago

I agree and thank you. We appreciate any contribution. The main problem is that its development is currently stalled. I have few time even to download your patches and to try it. Personally, I have few skills with python/django in combination with test driven development so it may take some time.