Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/lib/uc20-create-partitions/main.go: setup a logger for messages #11219

Conversation

anonymouse64
Copy link
Member

This is helpful in debugging problems from install.Run() which currently are
totally absent since the default logger is the null logger.

This is helpful in debugging problems from install.Run() which currently are
totally absent since the default logger is the null logger.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
@anonymouse64 anonymouse64 added Simple 😃 A small PR which can be reviewed quickly Test Robustness labels Jan 7, 2022
Copy link
Contributor

@stolowski stolowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -59,9 +62,12 @@ func (c uc20Constraints) Classic() bool { return false }
func (c uc20Constraints) Grade() asserts.ModelGrade { return asserts.ModelSigned }

func main() {
if err := logger.SimpleSetup(); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW maybe also add os.Setenv("SNAPD_DEBUG", "1") so that we see the logs, unless the test in question is expecting some specific output?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well 2 of the task.yaml's have that already defined in the environment section so I think it's fine to not include this here IMHO

though I realize now checking there is a third task.yaml which does not have that defined but I think it should

This is for more debug info from the logger when we call
uc20-create-partitions.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
@codecov-commenter
Copy link

Codecov Report

Merging #11219 (53e0c66) into master (1c39a66) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #11219   +/-   ##
=======================================
  Coverage   78.36%   78.36%           
=======================================
  Files         922      923    +1     
  Lines      105131   105192   +61     
=======================================
+ Hits        82387    82435   +48     
- Misses      17612    17621    +9     
- Partials     5132     5136    +4     
Flag Coverage Δ
unittests 78.36% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
osutil/synctree.go 76.41% <0.00%> (-2.84%) ⬇️
overlord/hookstate/hookmgr.go 74.67% <0.00%> (-0.65%) ⬇️
daemon/api_connections.go 93.04% <0.00%> (-0.54%) ⬇️
cmd/snap/cmd_debug_state.go 70.18% <0.00%> (-0.46%) ⬇️
overlord/ifacestate/handlers.go 64.87% <0.00%> (-0.15%) ⬇️
interfaces/builtin/polkit.go 90.16% <0.00%> (ø)
store/cache.go 71.15% <0.00%> (+1.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c39a66...53e0c66. Read the comment docs.

@mvo5 mvo5 merged commit 2d349c9 into snapcore:master Jan 11, 2022
@anonymouse64 anonymouse64 deleted the feature/more-logging-in-uc20-create-partitions branch January 11, 2022 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Simple 😃 A small PR which can be reviewed quickly Test Robustness
Projects
None yet
5 participants