Skip to content

tests: Test show_logs method #601

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

Merged
merged 1 commit into from
Jun 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions test/logging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,24 +168,32 @@ import Colors, GraphViz, DataFrames, Plots, JSON3
end
end

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

A = distribute(rand(4, 4), Blocks(8, 8))
sum(A)
logs = Dagger.fetch_logs!()
A = distribute(rand(4, 4), Blocks(8, 8))
sum(A)
logs = Dagger.fetch_logs!()

# GraphVizExt
@test Dagger.render_logs(logs, :graphviz) !== nothing
# Core
str = Dagger.show_logs(logs, :graphviz)
@test str isa String && !isempty(str)

# PlotsExt
@test Dagger.render_logs(logs, :plots_gantt) !== nothing
io = IOBuffer()
Dagger.show_logs(io, logs, :graphviz)
seek(io, 0)
str = take!(io)
@test !isempty(str)

# JSON3Ext
@test Dagger.render_logs(logs, :chrome_trace) !== nothing
# GraphVizExt
@test Dagger.render_logs(logs, :graphviz) !== nothing

Dagger.disable_logging!()
end
# PlotsExt
@test Dagger.render_logs(logs, :plots_gantt) !== nothing

# JSON3Ext
@test Dagger.show_logs(logs, :chrome_trace) !== nothing

Dagger.disable_logging!()
end
end