Skip to content

Commit

Permalink
Merge pull request #287 from JuliaDiff/ox/no_scrub_bt
Browse files Browse the repository at this point in the history
Monkey patch Test.scrub_backtrace
  • Loading branch information
oxinabox authored Oct 2, 2023
2 parents c421f7c + ebfe4c1 commit 49a0324
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
name = "ChainRulesTestUtils"
uuid = "cdddcdb0-9152-4a09-a978-84456f9df70a"
version = "1.11.0"
version = "1.12.0"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
ChainRulesCore = "1.11.2"
Compat = "3, 4"
FiniteDifferences = "0.12.12"
MetaTesting = "0.1"
Suppressor = "0.2.6"
julia = "1"

[extras]
Expand Down
18 changes: 17 additions & 1 deletion src/ChainRulesTestUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,29 @@ using FiniteDifferences: to_vec
using LinearAlgebra
using Random
using Test
using Suppressor

export TestIterator
export test_approx, test_scalar, test_frule, test_rrule, generate_well_conditioned_matrix
export , rand_tangent
export @maybe_inferred
export test_method_tables

__init__() = init_test_inferred_setting!()
function __init__()
init_test_inferred_setting!()

# Try to disable backtrace scrubbing so that full failures are shown
try
isdefined(Test, :scrub_backtrace) || error("Test.scrub_backtrace not defined")
@suppress begin # mute warning about monkey-patching
# depending on julia version or one or the other of these will be hit
@eval Test scrub_backtrace(bt,) = bt # make it do nothing
@eval Test scrub_backtrace(bt, file_ts, file_t) = bt # make it do nothing
end
catch err
@warn "Failed to monkey-patch scrub_backtrace. Code is functional but stacktraces may be less useful" exception=(err, catch_backtrace())
end
end

include("global_config.jl")

Expand All @@ -36,3 +51,4 @@ include("testers.jl")
include("deprecated.jl")
include("global_checks.jl")
end # module

2 comments on commit 49a0324

@oxinabox
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/92585

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.12.0 -m "<description of version>" 49a032424458005eeb8ac36024327385452d0d38
git push origin v1.12.0

Please sign in to comment.