Skip to content

Commit

Permalink
Add x86 runners to CI (#529)
Browse files Browse the repository at this point in the history
Excludes mac as x86 mac is tier 3 for Julia.
Whether `Int64` was used or tests adapted to using `Int` was based on smallness of change.
Includes workaround for Issue #530.
  • Loading branch information
Zentrik authored Feb 5, 2024
1 parent 575a732 commit 5411430
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 81 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
- windows-latest
arch:
- x64
- x86
exclude:
- os: macOS-latest
arch: x86
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/TypedSyntaxCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- ubuntu-latest
arch:
- x64
- x86
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
Expand Down
34 changes: 17 additions & 17 deletions TypedSyntax/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ include("test_module.jl")
tsn = TypedSyntaxNode(TSN.summer_iterate, (Vector{Float64},))
@test tsn.typ == Union{Int,Float64}
sig, body = children(tsn)
@test has_name_typ(child(body, 2, 1), :ret, Union{Nothing, Tuple{Float64, Int64}})
@test has_name_typ(child(body, 2, 1), :ret, Union{Nothing, Tuple{Float64, Int}})
@test has_name_typ(child(body, 3, 2, 1, 1, 1), :x, Float64)

# `where`, unnamed arguments, and types-as-arguments
Expand Down Expand Up @@ -552,7 +552,7 @@ include("test_module.jl")
@test TypedSyntax.num_positional_args(tsn) == 2

# Display
tsn = TypedSyntaxNode(TSN.mysin, (Int,))
tsn = TypedSyntaxNode(TSN.mysin, (Int64,))
str = sprint(tsn; context=:color=>false) do io, obj
printstyled(io, obj; hide_type_stable=false)
end
Expand Down Expand Up @@ -602,7 +602,7 @@ include("test_module.jl")
end
@test occursin("[1]\e[36m::Float32\e[39m", str)
@test occursin("[2]\e[36m::Float32\e[39m", str)
tsn = TypedSyntaxNode(TSN.simplef, (Int, Float64))
tsn = TypedSyntaxNode(TSN.simplef, (Int64, Float64))
str = sprint(tsn; context=:color=>false) do io, obj
printstyled(io, obj; hide_type_stable=false)
end
Expand Down Expand Up @@ -695,32 +695,32 @@ using TypedSyntax: InlayHint, Diagnostic, InlayHintKinds

@testset "test_vscode.jl" begin
# VSCode
tsn = TypedSyntaxNode(TSN.fVSCode, (Int64,))
tsn = TypedSyntaxNode(TSN.fVSCode, (Int,))

io = IOContext(devnull, :inlay_hints=>Dict{String, Vector{InlayHint}}(), :diagnostics=>Diagnostic[])
printstyled(io, tsn)
@test getproperty.(first(values(io[:inlay_hints])), :kind) == [InlayHintKinds.Nothing, InlayHintKinds.Type, InlayHintKinds.Nothing] && getproperty.(first(values(io[:inlay_hints])), :label) == ["::Union{Float64, Int64}", "(", ")::Union{Float64, Int64}"]
@test getproperty.(first(values(io[:inlay_hints])), :kind) == [InlayHintKinds.Nothing, InlayHintKinds.Type, InlayHintKinds.Nothing] && getproperty.(first(values(io[:inlay_hints])), :label) == ["::Union{Float64, $Int}", "(", ")::Union{Float64, $Int}"]
@test length(io[:diagnostics]) == 2

io = IOContext(devnull, :inlay_hints=>Dict{String, Vector{InlayHint}}(), :diagnostics=>Diagnostic[])
printstyled(io, tsn; hide_type_stable=false)
@test getproperty.(first(values(io[:inlay_hints])), :kind) == vcat(InlayHintKinds.Type, InlayHintKinds.Nothing, repeat([InlayHintKinds.Type], 15), InlayHintKinds.Nothing) && getproperty.(first(values(io[:inlay_hints])), :label) == ["::Int64"
"::Union{Float64, Int64}"
"::Int64"
@test getproperty.(first(values(io[:inlay_hints])), :kind) == vcat(InlayHintKinds.Type, InlayHintKinds.Nothing, repeat([InlayHintKinds.Type], 15), InlayHintKinds.Nothing) && getproperty.(first(values(io[:inlay_hints])), :label) == ["::$Int"
"::Union{Float64, $Int}"
"::$Int"
"("
"::Int64"
")::Int64"
"::Int64"
"::$Int"
")::$Int"
"::$Int"
"("
"::Int64"
")::Int64"
"::$Int"
")::$Int"
"("
"::Int64"
"::$Int"
"("
"::Int64"
"::$Int"
")::Bool"
"::Int64"
"::$Int"
"::Float64"
")::Union{Float64, Int64}"]
")::Union{Float64, $Int}"]
@test length(io[:diagnostics]) == 2
end
154 changes: 91 additions & 63 deletions test/test_codeview_vscode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ include("test_vscode_example_functions.jl")

fake_terminal() do term, in, out, _
t = @async begin
@test_nowarn descend(fib, (Int64,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode)
@test_nowarn descend(fib, (Int,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode)
end
write(in, 'q')
wait(t)
Expand All @@ -60,18 +60,18 @@ include("test_vscode_example_functions.jl")

if !hide_type_stable && inlay_types_vscode
@test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [
TypedSyntax.InlayHint(1, 14, "::Int64", 1)
TypedSyntax.InlayHint(1, 15, "::Int64", 1)
TypedSyntax.InlayHint(1, 14, "::$Int", 1)
TypedSyntax.InlayHint(1, 15, "::$Int", 1)
TypedSyntax.InlayHint(3, 11, "(", 1)
TypedSyntax.InlayHint(3, 15, "(", 1)
TypedSyntax.InlayHint(3, 16, "::Int64", 1)
TypedSyntax.InlayHint(3, 20, ")::Int64", 1)
TypedSyntax.InlayHint(3, 21, "::Int64", 1)
TypedSyntax.InlayHint(3, 16, "::$Int", 1)
TypedSyntax.InlayHint(3, 20, ")::$Int", 1)
TypedSyntax.InlayHint(3, 21, "::$Int", 1)
TypedSyntax.InlayHint(3, 28, "(", 1)
TypedSyntax.InlayHint(3, 29, "::Int64", 1)
TypedSyntax.InlayHint(3, 33, ")::Int64", 1)
TypedSyntax.InlayHint(3, 34, "::Int64", 1)
TypedSyntax.InlayHint(3, 34, ")::Int64", 1)
TypedSyntax.InlayHint(3, 29, "::$Int", 1)
TypedSyntax.InlayHint(3, 33, ")::$Int", 1)
TypedSyntax.InlayHint(3, 34, "::$Int", 1)
TypedSyntax.InlayHint(3, 34, ")::$Int", 1)
])
elseif hide_type_stable && inlay_types_vscode
@test isempty(VSCodeServer.inlay_hints[1])
Expand All @@ -85,7 +85,7 @@ include("test_vscode_example_functions.jl")

fake_terminal() do term, in, out, _
t = @async begin
@test_nowarn descend(fVSCode, (Int64,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode)
@test_nowarn descend(fVSCode, (Int,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode)
end
write(in, 'q')
wait(t)
Expand Down Expand Up @@ -114,60 +114,60 @@ include("test_vscode_example_functions.jl")
if !hide_type_stable && inlay_types_vscode
if iswarn
@test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [
TypedSyntax.InlayHint(7, 18, "::Int64", 1)
TypedSyntax.InlayHint(7, 19, "::Union{Float64, Int64}", nothing)
TypedSyntax.InlayHint(8, 5, "::Int64", 1)
TypedSyntax.InlayHint(7, 18, "::$Int", 1)
TypedSyntax.InlayHint(7, 19, "::Union{Float64, $Int}", nothing)
TypedSyntax.InlayHint(8, 5, "::$Int", 1)
TypedSyntax.InlayHint(8, 8, "(", 1)
TypedSyntax.InlayHint(8, 9, "::Int64", 1)
TypedSyntax.InlayHint(8, 13, ")::Int64", 1)
TypedSyntax.InlayHint(9, 5, "::Int64", 1)
TypedSyntax.InlayHint(8, 9, "::$Int", 1)
TypedSyntax.InlayHint(8, 13, ")::$Int", 1)
TypedSyntax.InlayHint(9, 5, "::$Int", 1)
TypedSyntax.InlayHint(9, 8, "(", 1)
TypedSyntax.InlayHint(9, 13, "::Int64", 1)
TypedSyntax.InlayHint(9, 13, ")::Int64", 1)
TypedSyntax.InlayHint(9, 13, "::$Int", 1)
TypedSyntax.InlayHint(9, 13, ")::$Int", 1)
TypedSyntax.InlayHint(10, 11, "(", 1)
TypedSyntax.InlayHint(10, 12, "::Int64", 1)
TypedSyntax.InlayHint(10, 12, "::$Int", 1)
TypedSyntax.InlayHint(10, 16, "(", 1)
TypedSyntax.InlayHint(10, 17, "::Int64", 1)
TypedSyntax.InlayHint(10, 17, "::$Int", 1)
TypedSyntax.InlayHint(10, 21, ")::Bool", 1)
TypedSyntax.InlayHint(10, 26, "::Int64", 1)
TypedSyntax.InlayHint(10, 26, "::$Int", 1)
TypedSyntax.InlayHint(10, 32, "::Float64", 1)
TypedSyntax.InlayHint(10, 33, ")::Union{Float64, Int64}", nothing)
TypedSyntax.InlayHint(10, 33, ")::Union{Float64, $Int}", nothing)
])

else
@test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [
TypedSyntax.InlayHint(7, 18, "::Int64", 1)
TypedSyntax.InlayHint(7, 19, "::Union{Float64, Int64}", 1)
TypedSyntax.InlayHint(8, 5, "::Int64", 1)
TypedSyntax.InlayHint(7, 18, "::$Int", 1)
TypedSyntax.InlayHint(7, 19, "::Union{Float64, $Int}", 1)
TypedSyntax.InlayHint(8, 5, "::$Int", 1)
TypedSyntax.InlayHint(8, 8, "(", 1)
TypedSyntax.InlayHint(8, 9, "::Int64", 1)
TypedSyntax.InlayHint(8, 13, ")::Int64", 1)
TypedSyntax.InlayHint(9, 5, "::Int64", 1)
TypedSyntax.InlayHint(8, 9, "::$Int", 1)
TypedSyntax.InlayHint(8, 13, ")::$Int", 1)
TypedSyntax.InlayHint(9, 5, "::$Int", 1)
TypedSyntax.InlayHint(9, 8, "(", 1)
TypedSyntax.InlayHint(9, 13, "::Int64", 1)
TypedSyntax.InlayHint(9, 13, ")::Int64", 1)
TypedSyntax.InlayHint(9, 13, "::$Int", 1)
TypedSyntax.InlayHint(9, 13, ")::$Int", 1)
TypedSyntax.InlayHint(10, 11, "(", 1)
TypedSyntax.InlayHint(10, 12, "::Int64", 1)
TypedSyntax.InlayHint(10, 12, "::$Int", 1)
TypedSyntax.InlayHint(10, 16, "(", 1)
TypedSyntax.InlayHint(10, 17, "::Int64", 1)
TypedSyntax.InlayHint(10, 17, "::$Int", 1)
TypedSyntax.InlayHint(10, 21, ")::Bool", 1)
TypedSyntax.InlayHint(10, 26, "::Int64", 1)
TypedSyntax.InlayHint(10, 26, "::$Int", 1)
TypedSyntax.InlayHint(10, 32, "::Float64", 1)
TypedSyntax.InlayHint(10, 33, ")::Union{Float64, Int64}", 1)
TypedSyntax.InlayHint(10, 33, ")::Union{Float64, $Int}", 1)
])
end
elseif hide_type_stable && inlay_types_vscode
if iswarn
@test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [
TypedSyntax.InlayHint(7, 19, "::Union{Float64, Int64}", nothing)
TypedSyntax.InlayHint(7, 19, "::Union{Float64, $Int}", nothing)
TypedSyntax.InlayHint(10, 11, "(", 1)
TypedSyntax.InlayHint(10, 33, ")::Union{Float64, Int64}", nothing)
TypedSyntax.InlayHint(10, 33, ")::Union{Float64, $Int}", nothing)
])
else
@test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [
TypedSyntax.InlayHint(7, 19, "::Union{Float64, Int64}", 1)
TypedSyntax.InlayHint(7, 19, "::Union{Float64, $Int}", 1)
TypedSyntax.InlayHint(10, 11, "(", 1)
TypedSyntax.InlayHint(10, 33, ")::Union{Float64, Int64}", 1)
TypedSyntax.InlayHint(10, 33, ")::Union{Float64, $Int}", 1)
])
end
end
Expand Down Expand Up @@ -206,25 +206,33 @@ include("test_vscode_example_functions.jl")
if !hide_type_stable && inlay_types_vscode
@test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [
TypedSyntax.InlayHint(14, 18, "::Float64", 1)
TypedSyntax.InlayHint(14, 19, "::Int64", 1)
TypedSyntax.InlayHint(15, 15, "::Float64", 1)
TypedSyntax.InlayHint(15, 16, "::Int64", 1)
TypedSyntax.InlayHint(14, 19, "::$Int", 1)
TypedSyntax.InlayHint(15, 11, "::Type{$Int}", 1)
TypedSyntax.InlayHint(15, 13, "::Float64", 1)
TypedSyntax.InlayHint(15, 14, "::$Int", 1)
TypedSyntax.InlayHint(16, 9, "::Float64", 1)
TypedSyntax.InlayHint(16, 10, "::Int64", 1)
])
TypedSyntax.InlayHint(16, 10, "::$Int", 1)
]) || equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [
TypedSyntax.InlayHint(14, 18, "::Float64", 1)
TypedSyntax.InlayHint(14, 19, "::$Int", 1)
TypedSyntax.InlayHint(15, 13, "::Float64", 1)
TypedSyntax.InlayHint(15, 14, "::$Int", 1)
TypedSyntax.InlayHint(16, 9, "::Float64", 1)
TypedSyntax.InlayHint(16, 10, "::$Int", 1)
]) # Workaround for #530
elseif hide_type_stable && inlay_types_vscode
@test isempty(VSCodeServer.inlay_hints[1])
end
end
end

for inlay_types_vscode in (true, false), diagnostics_vscode in (true, false), iswarn in (true, false), hide_type_stable in (true, false)
@testset "fibcall Int64 inlay_types_vscode=$inlay_types_vscode, diagnostics_vscode=$diagnostics_vscode, iswarn=$iswarn, hide_type_stable=$hide_type_stable" begin
@testset "fibcall Int inlay_types_vscode=$inlay_types_vscode, diagnostics_vscode=$diagnostics_vscode, iswarn=$iswarn, hide_type_stable=$hide_type_stable" begin
VSCodeServer.reset_test_containers()

fake_terminal() do term, in, out, _
t = @async begin
@test_nowarn descend(fibcall, (Int64,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode)
@test_nowarn descend(fibcall, (Int,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode)
end
write(in, 'q')
wait(t)
Expand All @@ -248,30 +256,50 @@ include("test_vscode_example_functions.jl")

if !hide_type_stable && inlay_types_vscode
@test equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [
TypedSyntax.InlayHint(14, 18, "::Int64", 1)
TypedSyntax.InlayHint(14, 19, "::Int64", 1)
TypedSyntax.InlayHint(15, 15, "::Int64", 1)
TypedSyntax.InlayHint(15, 16, "::Int64", 1)
TypedSyntax.InlayHint(16, 9, "::Int64", 1)
TypedSyntax.InlayHint(16, 10, "::Int64", 1)
TypedSyntax.InlayHint(1, 14, "::Int64", 1)
TypedSyntax.InlayHint(1, 15, "::Int64", 1)
TypedSyntax.InlayHint(14, 18, "::$Int", 1)
TypedSyntax.InlayHint(14, 19, "::$Int", 1)
TypedSyntax.InlayHint(15, 11, "::Type{$Int}", 1)
TypedSyntax.InlayHint(15, 13, "::$Int", 1)
TypedSyntax.InlayHint(15, 14, "::$Int", 1)
TypedSyntax.InlayHint(16, 9, "::$Int", 1)
TypedSyntax.InlayHint(16, 10, "::$Int", 1)
TypedSyntax.InlayHint(1, 14, "::$Int", 1)
TypedSyntax.InlayHint(1, 15, "::$Int", 1)
TypedSyntax.InlayHint(3, 11, "(", 1)
TypedSyntax.InlayHint(3, 15, "(", 1)
TypedSyntax.InlayHint(3, 16, "::Int64", 1)
TypedSyntax.InlayHint(3, 20, ")::Int64", 1)
TypedSyntax.InlayHint(3, 21, "::Int64", 1)
TypedSyntax.InlayHint(3, 16, "::$Int", 1)
TypedSyntax.InlayHint(3, 20, ")::$Int", 1)
TypedSyntax.InlayHint(3, 21, "::$Int", 1)
TypedSyntax.InlayHint(3, 28, "(", 1)
TypedSyntax.InlayHint(3, 29, "::Int64", 1)
TypedSyntax.InlayHint(3, 33, ")::Int64", 1)
TypedSyntax.InlayHint(3, 34, "::Int64", 1)
TypedSyntax.InlayHint(3, 34, ")::Int64", 1)
])
TypedSyntax.InlayHint(3, 29, "::$Int", 1)
TypedSyntax.InlayHint(3, 33, ")::$Int", 1)
TypedSyntax.InlayHint(3, 34, "::$Int", 1)
TypedSyntax.InlayHint(3, 34, ")::$Int", 1)
]) || equal_upto_ordering(first(values(VSCodeServer.inlay_hints[1])), [
TypedSyntax.InlayHint(14, 18, "::$Int", 1)
TypedSyntax.InlayHint(14, 19, "::$Int", 1)
TypedSyntax.InlayHint(15, 13, "::$Int", 1)
TypedSyntax.InlayHint(15, 14, "::$Int", 1)
TypedSyntax.InlayHint(16, 9, "::$Int", 1)
TypedSyntax.InlayHint(16, 10, "::$Int", 1)
TypedSyntax.InlayHint(1, 14, "::$Int", 1)
TypedSyntax.InlayHint(1, 15, "::$Int", 1)
TypedSyntax.InlayHint(3, 11, "(", 1)
TypedSyntax.InlayHint(3, 15, "(", 1)
TypedSyntax.InlayHint(3, 16, "::$Int", 1)
TypedSyntax.InlayHint(3, 20, ")::$Int", 1)
TypedSyntax.InlayHint(3, 21, "::$Int", 1)
TypedSyntax.InlayHint(3, 28, "(", 1)
TypedSyntax.InlayHint(3, 29, "::$Int", 1)
TypedSyntax.InlayHint(3, 33, ")::$Int", 1)
TypedSyntax.InlayHint(3, 34, "::$Int", 1)
TypedSyntax.InlayHint(3, 34, ")::$Int", 1)
]) # Workaround for #530
elseif hide_type_stable && inlay_types_vscode
@test isempty(VSCodeServer.inlay_hints[1])
end
end
end
end

end
end
2 changes: 1 addition & 1 deletion test/test_vscode_example_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ end

# exact location in file matters
function fibcall(n)
fib(Int64(n))
fib(Int(n))
fib(n)
end

0 comments on commit 5411430

Please sign in to comment.