Skip to content

Commit 9926813

Browse files
committed
disable additional tests when tracing
1 parent 04340b1 commit 9926813

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

test/integration/optimisers.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ end
2424
gs = Reactant.to_rarray((a=rand(4), b=rand(2), c=rand(4)))
2525

2626
hlo = @code_hlo Optimisers.update(st_opt, ps, gs)
27-
@test length(findall("stablehlo.broadcast_in_dim", repr(hlo))) == 2
27+
if !Reactant.TRACE_CALLS[]
28+
@test length(findall("stablehlo.broadcast_in_dim", repr(hlo))) == 2
29+
end
2830
end

test/ops.jl

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,15 +1154,17 @@ end
11541154
hlo_ir = repr(mod)
11551155
csts = collect(x for x in eachsplit(hlo_ir, "\n") if occursin("stablehlo.constant", x))
11561156
# calls to similar give rise to dense<0> constants (that are not deduplicated):
1157-
csts = filter(x -> !occursin("dense<0>", x), csts)
1158-
1159-
@test length(csts) == 2
1160-
idx = findfirst(x -> occursin("1, 2, 3, 4", x), csts)
1161-
@test idx !== nothing
1162-
if idx == 1
1163-
@test occursin("6, 2, 3, 4", csts[2])
1164-
else
1165-
@test occursin("6, 2, 3, 4", csts[1])
1157+
if !Reactant.TRACE_CALLS[]
1158+
csts = filter(x -> !occursin("dense<0>", x), csts)
1159+
1160+
@test length(csts) == 2
1161+
idx = findfirst(x -> occursin("1, 2, 3, 4", x), csts)
1162+
@test idx !== nothing
1163+
if idx == 1
1164+
@test occursin("6, 2, 3, 4", csts[2])
1165+
else
1166+
@test occursin("6, 2, 3, 4", csts[1])
1167+
end
11661168
end
11671169
end
11681170

0 commit comments

Comments
 (0)