many: use dot graph functionality in tests and "snap debug"#16675
many: use dot graph functionality in tests and "snap debug"#16675andrewphelpsj wants to merge 9 commits intocanonical:masterfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #16675 +/- ##
========================================
Coverage 77.58% 77.59%
========================================
Files 1345 1350 +5
Lines 186890 187241 +351
Branches 2446 2446
========================================
+ Hits 145002 145286 +284
- Misses 33126 33171 +45
- Partials 8762 8784 +22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Sat Feb 28 00:20:41 UTC 2026 Failures:Preparing:
Executing:
Restoring:
Skipped tests from snapd-testing-skip
|
pedronis
left a comment
There was a problem hiding this comment.
did a pass, some terminology/labeling questions
I also wonder if we should use " []" for consistency for the graphs ?
| } | ||
|
|
||
| // AllTasksForTests returns all tasks currently known to the state, | ||
| // including tasks not linked to any change. |
There was a problem hiding this comment.
is linked the right word? do we use task linked to change in other places? belonging to perhaps?
There was a problem hiding this comment.
We use this language in various State methods. For example, the State.Task doc comment:
// Task returns the task for the given ID if the task has been linked to a change.
overlord/dot/dot.go
Outdated
| if err := t.Get("hook-setup", &hooksup); err != nil { | ||
| return "", err | ||
| } | ||
| return fmt.Sprintf("[%s] %s:run-hook[%s]", t.ID(), hooksup.Snap, hooksup.Hook), nil |
There was a problem hiding this comment.
did I have this way in the original code? should the ID perhaps go at the ends of labels?
overlord/dot/dottest/dottest.go
Outdated
| return | ||
| } | ||
|
|
||
| chg := st.NewChange("unlinked-tasks", c.TestName()) |
Co-authored-by: Samuele Pedroni <pedronis@lucediurna.net> Co-authored-by: Ernest Lotter <ernest.lotter@canonical.com>
Co-authored-by: Samuele Pedroni <pedronis@lucediurna.net> Co-authored-by: Ernest Lotter <ernest.lotter@canonical.com>
652b8db to
753f9f2
Compare
|
Addressed these comments. Sorry, I also rebased against master, so just the last 3 commits are new. |
pedronis
left a comment
There was a problem hiding this comment.
thanks for the changes, wondering/nitpick
overlord/dot/dottest/dottest.go
Outdated
|
|
||
| chg := st.NewChange("unlinked-tasks", c.TestName()) | ||
| for _, t := range unlinked { | ||
| chg := st.NewChange("tasks-without-change", c.TestName()) |
There was a problem hiding this comment.
do we check the form of that string? otherwise I was really planning to make it not look like a real kind, "tasks w/o change"
There was a problem hiding this comment.
Having the / in there makes it a bit annoying, since we turn that into a path ultimately. But let me know if this is a blocker for you and I'll figure something out.
There was a problem hiding this comment.
I would change the way we compute the filename to something vaguely like:
tags := []string{"my-refresh [1]", "MyTest"}
var frags []string
for _, t := range tags {
f := strings.Map(func(r rune) rune {
if unicode.IsLetter(r) || unicode.IsDigit(r) || r == '-' {
return r
}
return ' '
}, t)
f = strings.Join(strings.Fields(f), "_")
frags = append(frags, f)
}
fn := strings.Join(frags, "-")
we could be less strict about what we pass through
This change enables us to integrate dot graph creation into test suites that do not link their tasks to changes.
Additionally, swap out the "snap debug" impl for the implementation from
dot.I know
dottestprobably isn't the best package name, open to alternatives. I didn't just put that stuff indot, since it seems strange to importcheckthere. But maybe that is fine?