Merge lp:~fgimenez/snappy/integration-tests-verbosity-flag into lp:~snappy-dev/snappy/snappy-moved-to-github
| Status: | Needs review |
|---|---|
| Proposed branch: | lp:~fgimenez/snappy/integration-tests-verbosity-flag |
| Merge into: | lp:~snappy-dev/snappy/snappy-moved-to-github |
| Diff against target: |
766 lines (+345/-35) 16 files modified
_integration-tests/main.go (+8/-1) _integration-tests/tests/base_test.go (+16/-0) _integration-tests/testutils/autopkgtest/autopkgtest.go (+2/-2) _integration-tests/testutils/autopkgtest/autopkgtest_test.go (+26/-1) _integration-tests/testutils/autopkgtest/ssh.go (+14/-2) _integration-tests/testutils/build/build.go (+4/-4) _integration-tests/testutils/build/build_test.go (+0/-1) _integration-tests/testutils/cli/cli.go (+4/-3) _integration-tests/testutils/common/common.go (+8/-7) _integration-tests/testutils/config/config.go (+7/-5) _integration-tests/testutils/config/config_test.go (+5/-3) _integration-tests/testutils/image/image.go (+2/-2) _integration-tests/testutils/partition/partition.go (+0/-2) _integration-tests/testutils/testutils.go (+3/-2) _integration-tests/testutils/tlog/tlog.go (+101/-0) _integration-tests/testutils/tlog/tlog_test.go (+145/-0) |
| To merge this branch: | bzr merge lp:~fgimenez/snappy/integration-tests-verbosity-flag |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Leo Arias | 2015-10-07 | Needs Information on 2015-10-08 | |
|
Review via email:
|
|||
Commit Message
Integration tests verbosity flag
Description of the Change
Integration tests verbosity flag.
There are currently only two levels implemented, DebugLevel (the default) and InfoLevel. The level can be set with:
tlog.
There are functions for logging at each level, tlog.Debugf and tlog.Infof. Currently all the previous fmt.Print have been changed into tlog.Debugf, which makes that, being DebugLevel the default, without flags the test run logs the same output as before. To get a less verbose output:
$ go run _integration-
There are currently no messages sent with tlog.Infof, the previous command only logs gocheck and adt-run related output.
| Michael Vogt (mvo) wrote : | # |
Thanks for this branch! Its a bit unfortunate IMO that the native go logger is so limited, no support for log levels is really limiting and means that everyone has to reimplement a logger:/
We have a logger in snappy/logger already, I wonder if we could reuse that here instead of having a additional one? The one we have is a little more limited right now, i.e. you can suppress log messages right now, but it looks like it would be worthwhile to add there instead of having two versions. What do you think? Or is there something in the tests that makes sharing the logger unsuitable?
| Federico Gimenez (fgimenez) wrote : | # |
@Michael I totally agree, it would be nice if we could use a single logger.
I had a look at the logger package before beginning with this and it seemed to me that it was oriented to a cli tool, with two "channels" to output messages but without giving the user the option to decide which kind of messages to show. In the case of the test logger there should be just one way of output (it shouldn't use syslog), but with different levels, and the level to be used should be selectable at invocation time. If we can make both things work at once it would be great :)
When we'll execute the tests on CI, for instance, we would like always the more verbose output on stdout, while perhaps a developer executing the suite locally would prefer to have a less verbose output, and enable the verbose one if there's an error.
Leo, what do you think?
Unmerged revisions
- 746. By Federico Gimenez on 2015-10-07
-
boot log also affected by the flag
- 745. By Federico Gimenez on 2015-10-07
-
set level in testbed moved to base_test's init
- 744. By Federico Gimenez on 2015-10-07
-
loglevel flag; passing the loglevel to the testbedd in config
- 743. By Federico Gimenez on 2015-10-07
-
removed calls to fmt.Print; added new line
- 742. By Federico Gimenez on 2015-10-07
-
tlog package


Thanks for working on this.
I'm wondering if we should use log.Print instead of fmt.Fprint. I've never done logging in go before, so I think it would be nice to get a review from mvo, sergio or chipaca. Can you please ask one of them tomorrow to take a quick look?