Skip to content

Commit b4dee46

Browse files
use JuliaInterpreter for even faster tests (#500)
Co-authored-by: Lyndon White <oxinabox@ucc.asn.au>
1 parent 773039a commit b4dee46

File tree

5 files changed

+43
-48
lines changed

5 files changed

+43
-48
lines changed

.github/workflows/CI.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,26 @@ jobs:
4141
${{ runner.os }}-
4242
- uses: julia-actions/julia-buildpkg@v1
4343
- uses: julia-actions/julia-runtest@v1
44-
- uses: julia-actions/julia-processcoverage@v1
45-
- uses: codecov/codecov-action@v1
46-
with:
47-
file: lcov.info
48-
- uses: coverallsapp/github-action@master
49-
with:
50-
github-token: ${{ secrets.GITHUB_TOKEN }}
51-
flag-name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
52-
parallel: true
53-
path-to-lcov: lcov.info
54-
55-
finish:
56-
name: Coveralls Finished
57-
needs: test
58-
runs-on: ubuntu-latest
59-
steps:
60-
- uses: coverallsapp/github-action@master
61-
with:
62-
github-token: ${{ secrets.GITHUB_TOKEN }}
63-
parallel-finished: true
44+
# - uses: julia-actions/julia-processcoverage@v1
45+
# - uses: codecov/codecov-action@v1
46+
# with:
47+
# file: lcov.info
48+
# - uses: coverallsapp/github-action@master
49+
# with:
50+
# github-token: ${{ secrets.GITHUB_TOKEN }}
51+
# flag-name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
52+
# parallel: true
53+
# path-to-lcov: lcov.info
54+
#
55+
# finish:
56+
# name: Coveralls Finished
57+
# needs: test
58+
# runs-on: ubuntu-latest
59+
# steps:
60+
# - uses: coverallsapp/github-action@master
61+
# with:
62+
# github-token: ${{ secrets.GITHUB_TOKEN }}
63+
# parallel-finished: true
6464

6565
slack:
6666
name: Notify Slack Failure

Project.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1212
[compat]
1313
ChainRulesCore = "1.1"
1414
ChainRulesTestUtils = "1"
15-
Compat = "3.31"
15+
Compat = "3.33"
1616
FiniteDifferences = "0.12.8"
17+
JuliaInterpreter = "0.8"
1718
StaticArrays = "1.2"
1819
julia = "1"
1920

2021
[extras]
2122
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
2223
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
24+
JuliaInterpreter = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
2325
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
2426
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2527
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2628

2729
[targets]
28-
test = ["ChainRulesTestUtils", "FiniteDifferences", "Random", "StaticArrays", "Test"]
30+
test = ["ChainRulesTestUtils", "FiniteDifferences", "JuliaInterpreter", "Random", "StaticArrays", "Test"]

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
[![CI](https://github.com/JuliaDiff/ChainRules.jl/workflows/CI/badge.svg?branch=master)](https://github.com/JuliaDiff/ChainRules.jl/actions?query=workflow%3ACI)
66
[![Travis](https://travis-ci.org/JuliaDiff/ChainRules.jl.svg?branch=master)](https://travis-ci.org/JuliaDiff/ChainRules.jl)
7-
[![Codecov](https://codecov.io/gh/JuliaDiff/ChainRules.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaDiff/ChainRules.jl)
8-
[![Coveralls](https://coveralls.io/repos/github/JuliaDiff/ChainRules.jl/badge.svg?branch=master)](https://coveralls.io/github/JuliaDiff/ChainRules.jl?branch=master)
97
[![PkgEval](https://juliaci.github.io/NanosoldierReports/pkgeval_badges/C/ChainRules.svg)](https://juliaci.github.io/NanosoldierReports/pkgeval_badges/report.html)
108
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
119
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)

test/rulesets/Base/fastmath_able.jl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,13 @@ const FASTABLE_AST = quote
253253
end
254254

255255
# Now we generate tests for fast and nonfast versions
256-
@eval @testset "fastmath_able Base functions" begin
257-
$FASTABLE_AST
258-
end
259-
260-
261-
@eval @testset "fastmath_able FastMath functions" begin
262-
$(Base.FastMath.make_fastmath(FASTABLE_AST))
263-
end
256+
@eval @interpret (function()
257+
@testset "fastmath_able Base functions" begin
258+
$FASTABLE_AST
259+
end
260+
261+
262+
@testset "fastmath_able FastMath functions" begin
263+
$(Base.FastMath.make_fastmath(FASTABLE_AST))
264+
end
265+
end)()

test/runtests.jl

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,12 @@ using Test, ChainRulesCore, ChainRulesTestUtils
22

33
@nospecialize
44

5-
# don't interpret this, since this breaks some inference tests
6-
@time include("test_helpers.jl")
7-
println()
8-
9-
module Tests
10-
11-
using ..Main: Multiplier, NoRules
125
using Base.Broadcast: broadcastable
136
using ChainRules
147
using ChainRulesCore
158
using ChainRulesTestUtils
169
using ChainRulesTestUtils: rand_tangent, _fdm
17-
using Compat: hasproperty, only, cispi, eachcol
10+
using Compat: Compat, hasproperty, only, cispi, eachcol
1811
using FiniteDifferences
1912
using LinearAlgebra
2013
using LinearAlgebra.BLAS
@@ -23,22 +16,24 @@ using Random
2316
using StaticArrays
2417
using Statistics
2518
using Test
19+
using JuliaInterpreter
2620

27-
@nospecialize
28-
29-
if isdefined(Base, :Experimental) && isdefined(Base.Experimental, Symbol("@compiler_options"))
30-
@eval Base.Experimental.@compiler_options compile=min optimize=0 infer=no
31-
end
21+
union!(JuliaInterpreter.compiled_modules, Any[Base, Base.Broadcast, Compat, LinearAlgebra, Random, StaticArrays, Statistics])
3222

3323
Random.seed!(1) # Set seed that all testsets should reset to.
3424

3525
function include_test(path::String)
3626
println("Testing $path:") # print so TravisCI doesn't timeout due to no output
37-
@time include(path) # show basic timing, (this will print a newline at end)
27+
@time Base.include(@__MODULE__(), path) do ex
28+
Meta.isexpr(ex, :macrocall) && ex.args[1] == Symbol("@testset") || return ex
29+
return :(@interpret (() -> $ex)()) # interpret testsets using JuliaInterpreter
30+
end
3831
end
3932

4033
println("Testing ChainRules.jl")
4134
@testset "ChainRules" begin
35+
include_test("test_helpers.jl")
36+
println()
4237
@testset "rulesets" begin
4338
@testset "Core" begin
4439
include_test("rulesets/Core/core.jl")
@@ -79,5 +74,3 @@ println("Testing ChainRules.jl")
7974
println()
8075
end
8176
end
82-
83-
end

0 commit comments

Comments
 (0)