Skip to content

Commit

Permalink
fix macos and ubuntu tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Stockless committed Jan 27, 2025
1 parent 64efca0 commit 59f66e5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
version:
- '1.10' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13]
arch: [x64]
include:
- os: ubuntu-latest
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
5 changes: 2 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ end
@testitem "KomaUI" tags=[:koma] begin

using Blink
# Opens KomaUI

# Opens UI
w = KomaUI(return_window=true)

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

0 comments on commit 59f66e5

Please sign in to comment.