Skip to content

Commit 59f66e5

Browse files
committed
fix macos and ubuntu tests
1 parent 64efca0 commit 59f66e5

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
version:
2020
- '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'.
2121
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
22-
os: [ubuntu-latest, windows-latest, macos-latest]
22+
os: [ubuntu-latest, windows-latest, macos-13]
2323
arch: [x64]
2424
include:
2525
- os: ubuntu-latest

src/KomaMRI.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ include("KomaUI.jl")
2727
# Export the UI and the observables
2828
export KomaUI
2929
export sys_ui, seq_ui, obj_ui, raw_ui, img_ui
30+
export @unsafe_blink
3031

3132
end

src/KomaUI.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,20 @@ function update_blink_window_progress!(w::Window, block, Nblocks)
326326
document.getElementById("simul_progress").setAttribute("aria-valuenow", progress))
327327
return nothing
328328
end
329+
330+
macro unsafe_blink() # https://github.com/JuliaGizmos/Blink.jl/issues/325#issuecomment-2252670794
331+
return @eval AtomShell begin
332+
function init(; debug = false)
333+
electron() # Check path exists
334+
p, dp = port(), port()
335+
debug && inspector(dp)
336+
dbg = debug ? "--debug=$dp" : []
337+
proc = (debug ? run_rdr : run)(
338+
`$(electron()) --no-sandbox $dbg $mainjs port $p`; wait=false)
339+
conn = try_connect(ip"127.0.0.1", p)
340+
shell = Electron(proc, conn)
341+
initcbs(shell)
342+
return shell
343+
end
344+
end
345+
end

test/runtests.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ end
3838
@testitem "KomaUI" tags=[:koma] begin
3939

4040
using Blink
41+
# Opens KomaUI
4142

42-
# Opens UI
43-
w = KomaUI(return_window=true)
44-
43+
w = KomaUI(return_window=true)
4544
@testset "Open UI" begin
4645
@test "index" == @js w document.getElementById("content").dataset.content
4746
end

0 commit comments

Comments
 (0)