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

Fix CI tests for macoOS and ubuntu OS. #538

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions KomaMRIPlots/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ version = "0.9.0"

[deps]
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
Kaleido_jll = "f7e6163d-2fa5-5f23-b69c-1db539e41963"
KomaMRIBase = "d0bc0b20-b151-4d03-b2a4-6ca51751cb9c"
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a"
Expand All @@ -20,7 +19,6 @@ KomaPlotsPlutoPlotlyExt = "PlutoPlotly"

[compat]
Interpolations = "0.13, 0.14, 0.15"
Kaleido_jll = "0.1"
KomaMRIBase = "0.9"
MAT = "0.10"
PlotlyJS = "0.18"
Expand Down
1 change: 1 addition & 0 deletions src/KomaMRI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ include("KomaUI.jl")
# Export the UI and the observables
export KomaUI
export sys_ui, seq_ui, obj_ui, raw_ui, img_ui
export @unsafe_blink

end
17 changes: 17 additions & 0 deletions src/KomaUI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,20 @@ function update_blink_window_progress!(w::Window, block, Nblocks)
document.getElementById("simul_progress").setAttribute("aria-valuenow", progress))
return nothing
end

macro unsafe_blink() # https://github.com/JuliaGizmos/Blink.jl/issues/325#issuecomment-2252670794
return @eval AtomShell begin
function init(; debug = false)
electron() # Check path exists
p, dp = port(), port()
debug && inspector(dp)
dbg = debug ? "--debug=$dp" : []
proc = (debug ? run_rdr : run)(
`$(electron()) --no-sandbox $dbg $mainjs port $p`; wait=false)
conn = try_connect(ip"127.0.0.1", p)
shell = Electron(proc, conn)
initcbs(shell)
return shell
end
end
end
6 changes: 3 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ end
@testitem "KomaUI" tags=[:koma] begin

using Blink
# Opens KomaUI

# Opens UI
w = KomaUI(return_window=true)

@unsafe_blink
Copy link
Member

Choose a reason for hiding this comment

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

Yo actually fix the bug (opposed to only fix the tests) the call to the macro needs to be inside the KomaUI function.

w = KomaUI(return_window=true)
@testset "Open UI" begin
@test "index" == @js w document.getElementById("content").dataset.content
end
Expand Down
Loading