Changes between Version 22 and Version 23 of Obsolete/Development/Code/TestingComponents
- Timestamp:
- Dec 12, 2015, 12:54:05 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Obsolete/Development/Code/TestingComponents
v22 v23 240 240 === Getting the component output displayed === 241 241 242 By default, all the component output produced by `$self->info()`, `$self->error()`, `$self->debug()`, `$self->verbose()` are not displayed when running the tests. 243 To get it display, you can add the following line to your `~/.proverc`: 244 242 By default, all the component output produced by `$self->info()`, `$self->error()`, `$self->debug()`, `$self->verbose()` *are not displayed* when running the tests. To get it displayed, use one of the following two methodds: 243 244 * Pass this option from the command line when executing the test: 245 {{{ 246 mvn -Dprove.args=-v 247 }}} 248 249 * Set it as your default configuration when executing the tests, adding the following line to your `~/.proverc`: 245 250 {{{ 246 251 -v 247 252 }}} 248 Or pass this option from the command line with: 249 {{{ 250 mvn -Dprove.args=-v 251 }}} 253 254 When doing the one of the actions described above, the component is run in `verbose`mode. 255 256 === Setting debug level in the component === 257 258 If you'd like to get debug message displayed to help troubleshooting a component, in addition to enabling the display of componennt output, you need to define the environment variable `QUATTOR_TEST_LOG_DEBUGLEVEL` to the appropriate debug level (1 to 5). 252 259 253 260 == Conclusion == 254 261 255 I hope this will reduce the effort required to test Quattor code. New components should have a detailed test suite. And older components should receive one. 256 257 With time, we should see less regressions and less fear to change the code in maintainable ways. 262 Unit tests are critical to prevent regressions in new versions and validate new features. 263 264 New components *MUST HAVE* a detailed test suite. And older components should receive one. 265