Skip to content

Commit a2477d9

Browse files
authored
cleanup for buildkite/jet/downstream tests (#172)
1 parent 88dec46 commit a2477d9

File tree

7 files changed

+98
-53
lines changed

7 files changed

+98
-53
lines changed

.buildkite/pipeline.yml

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,69 @@
11
env:
2-
CODECOV_TOKEN: c078b8d5-ad2b-4c0d-a5c7-ac8266f699bc
3-
JULIA_NUM_THREADS: auto
4-
2+
CODECOV_TOKEN: 6dfc8e6b-e2fe-4715-be78-a8d1c61bfb17
3+
JULIA_NUM_THREADS: auto,auto
4+
PYTHON: ""
5+
PYCALL_DEBUG_BUILD: yes
6+
57
steps:
6-
- label: "CI Buildkite"
8+
- label: "Tests - {{matrix.LABEL}}"
79
plugins:
810
- JuliaCI/julia#v1:
911
version: "1"
10-
- QuantumSavory/julia-xvfb#v1:
11-
- JuliaCI/julia-test#v1: ~
12+
compiled_size_limit: 10737418240 # 10GiB
13+
- JuliaCI/julia-test#v1:
1214
- JuliaCI/julia-coverage#v1:
1315
codecov: true
14-
command: |
15-
julia -e '
16-
using Pkg
17-
Pkg.add("QuantumSavory")
18-
Pkg.build("QuantumSavory")
19-
Pkg.test("QuantumSavory")'
16+
dirs: './src,./ext'
17+
commands:
18+
- echo "Julia depot path $${JULIA_DEPOT_PATH}"
19+
- echo "TERM=$${TERM} | PYTHON=$${PYTHON} | PYCALL_DEBUG_BUILD=$${PYCALL_DEBUG_BUILD}"
20+
env:
21+
JET_TEST: "{{matrix.JET_TEST}}"
22+
agents:
23+
queue: "{{matrix.QUEUE}}"
24+
matrix:
25+
setup:
26+
LABEL: ["base tests"]
27+
QUEUE: ["default"]
28+
JET_TEST: ["false"]
29+
adjustments:
30+
- with:
31+
LABEL: "JET"
32+
QUEUE: default
33+
JET_TEST: true
34+
35+
- label: "Downstream Tests - {{matrix.PACKAGE}}"
36+
plugins:
37+
- JuliaCI/julia#v1:
38+
version: "1"
39+
compiled_size_limit: 10737418240 # 10GiB
40+
command:
41+
- echo "Julia depot path $${JULIA_DEPOT_PATH}"
42+
- echo "TERM=$${TERM} | PYTHON=$${PYTHON} | PYCALL_DEBUG_BUILD=$${PYCALL_DEBUG_BUILD}"
43+
- julia --project=$(mktemp -d) -e '
44+
using Pkg;
45+
pkg"dev .";
46+
Pkg.add("{{matrix.PACKAGE}}");
47+
Pkg.build("{{matrix.PACKAGE}}");
48+
Pkg.test("{{matrix.PACKAGE}}");'
49+
matrix:
50+
setup:
51+
PACKAGE: ["QuantumSavory"]
52+
53+
- label: "Downstream Dev Tests - {{matrix.PACKAGE}}"
54+
plugins:
55+
- JuliaCI/julia#v1:
56+
version: "1"
57+
compiled_size_limit: 10737418240 # 10GiB
58+
command:
59+
- echo "Julia depot path $${JULIA_DEPOT_PATH}"
60+
- echo "TERM=$${TERM} | PYTHON=$${PYTHON} | PYCALL_DEBUG_BUILD=$${PYCALL_DEBUG_BUILD}"
61+
- julia --project=$(mktemp -d) -e '
62+
using Pkg;
63+
pkg"dev .";
64+
Pkg.develop("{{matrix.PACKAGE}}");
65+
Pkg.build("{{matrix.PACKAGE}}");
66+
Pkg.test("{{matrix.PACKAGE}}");'
67+
matrix:
68+
setup:
69+
PACKAGE: ["QuantumSavory"]

Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ uuid = "efa7fd63-0460-4890-beb7-be1bbdfbaeae"
33
authors = ["QuantumSymbolics.jl contributors"]
44
version = "0.4.12-dev"
55

6+
[workspace]
7+
projects = ["benchmark", "docs"]
8+
69
[deps]
710
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
811
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

benchmark/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[deps]
22
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
3+
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
34
QuantumClifford = "0525e862-1e90-11e9-3e4d-1b39d7109de1"
45
QuantumOpticsBase = "4f57444f-1401-5e15-980d-4471b28d5678"
56
QuantumSymbolics = "efa7fd63-0460-4890-beb7-be1bbdfbaeae"

benchmark/benchmarks.jl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,6 @@ using BenchmarkTools
77
const SUITE = BenchmarkGroup()
88
@ket k1; @ket k2; @bra b1; @bra b2; @op A; @op B; @op C;
99

10-
# Time to import and first usage of simple operations
11-
SUITE["latency"] = BenchmarkGroup(["slow"])
12-
load_command = `julia --quiet --project=./ --eval="using QuantumSymbolics"`
13-
ttfx_command = `
14-
julia --quiet --project=./ --eval="""
15-
using QuantumSymbolics;
16-
@ket k1; @op A;
17-
A * commutator(A,X) * k1
18-
"""`
19-
SUITE["latency"]["using"] = @benchmarkable run(load_command) samples=3 seconds=15
20-
SUITE["latency"]["ttf_operation"] = @benchmarkable run(ttfx_command) samples=3 seconds=15
21-
SUITE["latency"]["ttf_simplify"] = @benchmarkable qsimplify(X*Y) samples=1 evals=1
22-
23-
2410
# Symbolic object creation
2511
SUITE["creation"] = BenchmarkGroup(["symbolic"])
2612
SUITE["creation"]["ket"] = @benchmarkable @ket _k

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
44
Gabs = "0eb812ee-a11f-4f5e-b8d4-bb8a44f06f50"
55
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
66
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
7-
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
87
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
98
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
109
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
10+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1111
QuantumClifford = "0525e862-1e90-11e9-3e4d-1b39d7109de1"
1212
QuantumInterface = "5717a53b-5d69-4fa3-b976-0bf2f97ca1e5"
1313
QuantumOptics = "6e0679c1-51ea-5a7c-ac74-d61b76210b0c"

test/runtests.jl

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
1-
using TestItemRunner
21
using QuantumSymbolics
2+
using TestItemRunner
3+
4+
JET_flag = false
5+
6+
if get(ENV, "JET_TEST", "") != "true"
7+
@info "Skipping JET tests -- must be explicitly enabled."
8+
@info "Environment must set JET_TEST=true."
9+
else
10+
JET_flag = true
11+
end
12+
13+
using Pkg
14+
JET_flag && Pkg.add("JET")
315

416
# filter for the test
517
testfilter = ti -> begin
6-
exclude = Symbol[:jet]
7-
if !(VERSION >= v"1.10")
8-
push!(exclude, :doctests)
9-
push!(exclude, :aqua)
10-
end
18+
exclude = Symbol[]
19+
if !JET_flag
20+
push!(exclude, :jet)
21+
end
22+
if !(VERSION >= v"1.10")
23+
push!(exclude, :doctests)
24+
push!(exclude, :aqua)
25+
end
1126

12-
return all(!in(exclude), ti.tags)
27+
return all(!in(exclude), ti.tags)
1328
end
1429

1530
println("Starting tests with $(Threads.nthreads()) threads out of `Sys.CPU_THREADS = $(Sys.CPU_THREADS)`...")
1631

17-
@run_package_tests filter=testfilter
18-
19-
if get(ENV,"JET_TEST","")=="true"
20-
@run_package_tests filter=(ti -> :jet in ti.tags)
21-
end
32+
@run_package_tests filter=testfilter

test/test_jet.jl

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
@testitem "JET checks" tags=[:jet] begin
2-
using JET
3-
using QuantumOptics, QuantumClifford # to load the extensions
2+
using JET
3+
using QuantumOptics, QuantumClifford # to load the extensions
4+
using Test
5+
using QuantumSymbolics
46

5-
using InteractiveUtils, Latexify, SymbolicUtils
6-
7-
rep = report_package("QuantumSymbolics";
8-
ignored_modules=(
9-
AnyFrameModule(InteractiveUtils),
10-
AnyFrameModule(Latexify),
11-
AnyFrameModule(SymbolicUtils)
12-
)
13-
)
14-
@show rep
15-
@test_broken length(JET.get_reports(rep)) == 0
16-
@test length(JET.get_reports(rep)) <= 6
7+
rep = JET.report_package(QuantumSymbolics, target_modules=[QuantumSymbolics])
8+
@show rep
9+
@test_broken length(JET.get_reports(rep)) == 0
10+
@test length(JET.get_reports(rep)) <= 6
1711
end

0 commit comments

Comments
 (0)