Mailinglist Archive: yast-devel (101 mails)

< Previous Next >
[yast-devel] Webyast - proposal of test&commit rules
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Thu, 14 Jan 2010 12:25:31 +0100
  • Message-id: <201001141225.31368.jreidinger@xxxxxxx>
Hi,
due to low test coverage and low quality of test case and code I think it is
needed to set some basic rules which ensure some level of code and tests (
maybe you can be surprised how writing test improve code quality, because write
tests to method which is more then one page long is extremely annoying, also
properly test each XY parameters of method is really annoying, and testing
model is much simpler then testing controllers or views).

So proposal:
- keep prerelease rule - no fix without failing test ( you must at first show
test which demonstrate bug and then fix it in separate commit (but I suggest do
it in one push to not break hudson)) - it has exception for fixes of spec file
and lighttp configuration and UI redesign.
- develop new functionality in branch and before merge check test (and only
tests not code or run webyast) that functionality is implemented as expected
- all plugins must have test case
- commit often (so it is easier to review and test this small part). I think
that you should commit at least once per day.

FAQ:
Q: It is hard to test THIS fix ( it is in controller, view, long method, corner
case etc.)!
A: Then code is not have enough quality. For corner case it is more important
to write test for them to prevent regression. First bug can happen, regression
is problem of tests, this cannot happen.

Q: It is hard to write tests for webclient!
A: I agree for previous release. Now it is quite easy and simple howto mail
follow this one.

Q: I don't know how to create branch in git!
A: Ask on IRC! (for this case it is quite easy to do it)

Q: I have another problem
A: Ask on IRC or on mail if it is long story.


I welcome any suggestions or comments. After discuss it will be placed on wiki.
What you suggest if commit don't follow rules - immediately revert?

Schubi - maybe we could add rule that working XML response for each model in
webclient be as file fixture with same name as path on backend to be easy load
by sinatra?

Josef

--
Josef Reidinger
YaST team
maintainer of perl-Bootloader, YaST2-Repair, webyast
(language,time,basesystem,ntp)
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >