@@ -19,6 +19,10 @@ using KernelFunctions: SimpleKernel, metric, kappa, ColVecs, RowVecs, TestUtils
19
19
20
20
using KernelFunctions. TestUtils: test_interface
21
21
22
+ # The GROUP is used to run different sets of tests in parallel on the GitHub Actions CI.
23
+ # If you want to introduce a new group, ensure you also add it to .github/workflows/ci.yml
24
+ const GROUP = get (ENV , " GROUP" , " " )
25
+
22
26
# Writing tests:
23
27
# 1. The file structure of the test should match precisely the file structure of src.
24
28
# Amongst other things, this means that there should be exactly 1 test file per src file.
@@ -54,123 +58,133 @@ using KernelFunctions.TestUtils: test_interface
54
58
include (" test_utils.jl" )
55
59
56
60
@testset " KernelFunctions" begin
57
- include (" utils.jl" )
58
-
59
- @testset " distances" begin
60
- include (joinpath (" distances" , " pairwise.jl" ))
61
- include (joinpath (" distances" , " dotproduct.jl" ))
62
- include (joinpath (" distances" , " delta.jl" ))
63
- include (joinpath (" distances" , " sinus.jl" ))
61
+ if GROUP == " " || GROUP == " Transform"
62
+ @testset " transform" begin
63
+ include (joinpath (" transform" , " transform.jl" ))
64
+ print (" " )
65
+ include (joinpath (" transform" , " scaletransform.jl" ))
66
+ print (" " )
67
+ include (joinpath (" transform" , " ardtransform.jl" ))
68
+ print (" " )
69
+ include (joinpath (" transform" , " lineartransform.jl" ))
70
+ print (" " )
71
+ include (joinpath (" transform" , " functiontransform.jl" ))
72
+ print (" " )
73
+ include (joinpath (" transform" , " selecttransform.jl" ))
74
+ print (" " )
75
+ include (joinpath (" transform" , " chaintransform.jl" ))
76
+ print (" " )
77
+ include (joinpath (" transform" , " periodic_transform.jl" ))
78
+ print (" " )
79
+ end
80
+ @info " Ran tests on Transform"
64
81
end
65
- @info " Ran tests on Distances"
66
82
67
- @testset " transform" begin
68
- include (joinpath (" transform" , " transform.jl" ))
69
- print (" " )
70
- include (joinpath (" transform" , " scaletransform.jl" ))
71
- print (" " )
72
- include (joinpath (" transform" , " ardtransform.jl" ))
73
- print (" " )
74
- include (joinpath (" transform" , " lineartransform.jl" ))
75
- print (" " )
76
- include (joinpath (" transform" , " functiontransform.jl" ))
77
- print (" " )
78
- include (joinpath (" transform" , " selecttransform.jl" ))
79
- print (" " )
80
- include (joinpath (" transform" , " chaintransform.jl" ))
81
- print (" " )
82
- include (joinpath (" transform" , " periodic_transform.jl" ))
83
- print (" " )
83
+ if GROUP == " " || GROUP == " BaseKernels"
84
+ @testset " basekernels" begin
85
+ include (joinpath (" basekernels" , " constant.jl" ))
86
+ print (" " )
87
+ include (joinpath (" basekernels" , " cosine.jl" ))
88
+ print (" " )
89
+ include (joinpath (" basekernels" , " exponential.jl" ))
90
+ print (" " )
91
+ include (joinpath (" basekernels" , " exponentiated.jl" ))
92
+ print (" " )
93
+ include (joinpath (" basekernels" , " fbm.jl" ))
94
+ print (" " )
95
+ include (joinpath (" basekernels" , " gabor.jl" ))
96
+ print (" " )
97
+ include (joinpath (" basekernels" , " matern.jl" ))
98
+ print (" " )
99
+ include (joinpath (" basekernels" , " nn.jl" ))
100
+ print (" " )
101
+ include (joinpath (" basekernels" , " periodic.jl" ))
102
+ print (" " )
103
+ include (joinpath (" basekernels" , " piecewisepolynomial.jl" ))
104
+ print (" " )
105
+ include (joinpath (" basekernels" , " polynomial.jl" ))
106
+ print (" " )
107
+ include (joinpath (" basekernels" , " rational.jl" ))
108
+ print (" " )
109
+ include (joinpath (" basekernels" , " sm.jl" ))
110
+ print (" " )
111
+ include (joinpath (" basekernels" , " wiener.jl" ))
112
+ print (" " )
113
+ end
114
+ @info " Ran tests on BaseKernel"
84
115
end
85
- @info " Ran tests on Transform"
86
116
87
- @testset " basekernels" begin
88
- include (joinpath (" basekernels" , " constant.jl" ))
89
- print (" " )
90
- include (joinpath (" basekernels" , " cosine.jl" ))
91
- print (" " )
92
- include (joinpath (" basekernels" , " exponential.jl" ))
93
- print (" " )
94
- include (joinpath (" basekernels" , " exponentiated.jl" ))
95
- print (" " )
96
- include (joinpath (" basekernels" , " fbm.jl" ))
97
- print (" " )
98
- include (joinpath (" basekernels" , " gabor.jl" ))
99
- print (" " )
100
- include (joinpath (" basekernels" , " matern.jl" ))
101
- print (" " )
102
- include (joinpath (" basekernels" , " nn.jl" ))
103
- print (" " )
104
- include (joinpath (" basekernels" , " periodic.jl" ))
105
- print (" " )
106
- include (joinpath (" basekernels" , " piecewisepolynomial.jl" ))
107
- print (" " )
108
- include (joinpath (" basekernels" , " polynomial.jl" ))
109
- print (" " )
110
- include (joinpath (" basekernels" , " rational.jl" ))
111
- print (" " )
112
- include (joinpath (" basekernels" , " sm.jl" ))
113
- print (" " )
114
- include (joinpath (" basekernels" , " wiener.jl" ))
115
- print (" " )
117
+ if GROUP == " " || GROUP == " Kernels"
118
+ @testset " kernels" begin
119
+ include (joinpath (" kernels" , " kernelproduct.jl" ))
120
+ include (joinpath (" kernels" , " kernelsum.jl" ))
121
+ include (joinpath (" kernels" , " kerneltensorproduct.jl" ))
122
+ include (joinpath (" kernels" , " overloads.jl" ))
123
+ include (joinpath (" kernels" , " scaledkernel.jl" ))
124
+ include (joinpath (" kernels" , " transformedkernel.jl" ))
125
+ include (joinpath (" kernels" , " normalizedkernel.jl" ))
126
+ include (joinpath (" kernels" , " neuralkernelnetwork.jl" ))
127
+ end
128
+ @info " Ran tests on Kernel"
116
129
end
117
- @info " Ran tests on BaseKernel"
118
130
119
- @testset " kernels " begin
120
- include ( joinpath ( " kernels " , " kernelproduct.jl " ))
121
- include (joinpath (" kernels " , " kernelsum .jl" ))
122
- include (joinpath (" kernels " , " kerneltensorproduct .jl" ))
123
- include (joinpath (" kernels " , " overloads .jl" ))
124
- include (joinpath (" kernels " , " scaledkernel .jl" ))
125
- include (joinpath (" kernels " , " transformedkernel .jl" ))
126
- include ( joinpath ( " kernels " , " normalizedkernel.jl " ))
127
- include ( joinpath ( " kernels " , " neuralkernelnetwork.jl " ))
131
+ if GROUP == " " || GROUP == " MultiOutput "
132
+ @testset " multi_output " begin
133
+ include (joinpath (" mokernels " , " moinput .jl" ))
134
+ include (joinpath (" mokernels " , " independent .jl" ))
135
+ include (joinpath (" mokernels " , " slfm .jl" ))
136
+ include (joinpath (" mokernels " , " intrinsiccoregion .jl" ))
137
+ include (joinpath (" mokernels " , " lmm .jl" ))
138
+ end
139
+ @info " Ran tests on Multi-Output Kernels "
128
140
end
129
- @info " Ran tests on Kernel"
130
141
131
- @testset " matrix" begin
132
- include (joinpath (" matrix" , " kernelmatrix.jl" ))
133
- include (joinpath (" matrix" , " kernelkroneckermat.jl" ))
134
- include (joinpath (" matrix" , " kernelpdmat.jl" ))
135
- end
136
- @info " Ran tests on matrix"
142
+ if GROUP == " " || GROUP == " Others"
143
+ include (" utils.jl" )
137
144
138
- @testset " multi_output" begin
139
- include (joinpath (" mokernels" , " moinput.jl" ))
140
- include (joinpath (" mokernels" , " independent.jl" ))
141
- include (joinpath (" mokernels" , " slfm.jl" ))
142
- include (joinpath (" mokernels" , " intrinsiccoregion.jl" ))
143
- include (joinpath (" mokernels" , " lmm.jl" ))
144
- end
145
- @info " Ran tests on Multi-Output Kernels"
145
+ @testset " distances" begin
146
+ include (joinpath (" distances" , " pairwise.jl" ))
147
+ include (joinpath (" distances" , " dotproduct.jl" ))
148
+ include (joinpath (" distances" , " delta.jl" ))
149
+ include (joinpath (" distances" , " sinus.jl" ))
150
+ end
151
+ @info " Ran tests on Distances"
146
152
147
- @testset " approximations" begin
148
- include (joinpath (" approximations" , " nystrom.jl" ))
149
- end
153
+ @testset " matrix" begin
154
+ include (joinpath (" matrix" , " kernelmatrix.jl" ))
155
+ include (joinpath (" matrix" , " kernelkroneckermat.jl" ))
156
+ include (joinpath (" matrix" , " kernelpdmat.jl" ))
157
+ end
158
+ @info " Ran tests on matrix"
159
+
160
+ @testset " approximations" begin
161
+ include (joinpath (" approximations" , " nystrom.jl" ))
162
+ end
150
163
151
- include (" generic.jl" )
152
- include (" chainrules.jl" )
153
- include (" zygoterules.jl" )
164
+ include (" generic.jl" )
165
+ include (" chainrules.jl" )
166
+ include (" zygoterules.jl" )
154
167
155
- @testset " doctests" begin
156
- DocMeta. setdocmeta! (
157
- KernelFunctions,
158
- :DocTestSetup ,
159
- quote
160
- using KernelFunctions
161
- using LinearAlgebra
162
- using Random
163
- using PDMats: PDMats
164
- end ;
165
- recursive= true ,
166
- )
167
- doctest (
168
- KernelFunctions;
169
- doctestfilters= [
170
- r" {([a-zA-Z0-9]+,\s ?)+[a-zA-Z0-9]+}" ,
171
- r" (Array{[a-zA-Z0-9]+,\s ?1}|Vector{[a-zA-Z0-9]+})" ,
172
- r" (Array{[a-zA-Z0-9]+,\s ?2}|Matrix{[a-zA-Z0-9]+})" ,
173
- ],
174
- )
168
+ @testset " doctests" begin
169
+ DocMeta. setdocmeta! (
170
+ KernelFunctions,
171
+ :DocTestSetup ,
172
+ quote
173
+ using KernelFunctions
174
+ using LinearAlgebra
175
+ using Random
176
+ using PDMats: PDMats
177
+ end ;
178
+ recursive= true ,
179
+ )
180
+ doctest (
181
+ KernelFunctions;
182
+ doctestfilters= [
183
+ r" {([a-zA-Z0-9]+,\s ?)+[a-zA-Z0-9]+}" ,
184
+ r" (Array{[a-zA-Z0-9]+,\s ?1}|Vector{[a-zA-Z0-9]+})" ,
185
+ r" (Array{[a-zA-Z0-9]+,\s ?2}|Matrix{[a-zA-Z0-9]+})" ,
186
+ ],
187
+ )
188
+ end
175
189
end
176
190
end
0 commit comments