Skip to content

Commit 57752e4

Browse files
committed
tests: Test show_logs method
1 parent 768eb16 commit 57752e4

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

test/logging.jl

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -168,24 +168,32 @@ import Colors, GraphViz, DataFrames, Plots, JSON3
168168
end
169169
end
170170

171-
if VERSION >= v"1.9-"
172-
@testset "show_plan/render_plan built-in" begin
173-
Dagger.enable_logging!(;all_task_deps=true)
171+
@testset "show_plan/render_plan built-in" begin
172+
Dagger.enable_logging!(;all_task_deps=true)
174173

175-
A = distribute(rand(4, 4), Blocks(8, 8))
176-
sum(A)
177-
logs = Dagger.fetch_logs!()
174+
A = distribute(rand(4, 4), Blocks(8, 8))
175+
sum(A)
176+
logs = Dagger.fetch_logs!()
178177

179-
# GraphVizExt
180-
@test Dagger.render_logs(logs, :graphviz) !== nothing
178+
# Core
179+
str = Dagger.show_logs(logs, :graphviz)
180+
@test str isa String && !isempty(str)
181181

182-
# PlotsExt
183-
@test Dagger.render_logs(logs, :plots_gantt) !== nothing
182+
io = IOBuffer()
183+
Dagger.show_logs(io, logs, :graphviz)
184+
seek(io, 0)
185+
str = take!(io)
186+
@test !isempty(str)
184187

185-
# JSON3Ext
186-
@test Dagger.render_logs(logs, :chrome_trace) !== nothing
188+
# GraphVizExt
189+
@test Dagger.render_logs(logs, :graphviz) !== nothing
187190

188-
Dagger.disable_logging!()
189-
end
191+
# PlotsExt
192+
@test Dagger.render_logs(logs, :plots_gantt) !== nothing
193+
194+
# JSON3Ext
195+
@test Dagger.show_logs(logs, :chrome_trace) !== nothing
196+
197+
Dagger.disable_logging!()
190198
end
191199
end

0 commit comments

Comments
 (0)