TestPicker

Documentation for TestPicker.

TestPicker.INTERFACESConstant
INTERFACES

Global collection of test block interfaces used by TestPicker.

Contains all registered TestBlockInterface implementations that TestPicker uses to recognize and parse different types of test blocks. By default includes StdTestset for standard @testset blocks.

source
TestPicker.LATEST_EVALConstant
LATEST_EVAL

Global reference to the most recently executed test evaluations.

Stores a vector of EvalTest objects representing the last set of tests that were executed. This allows for re-running the same tests without going through the selection interface again.

source
TestPicker.LOADER_FUNCSConstant

The Base/Core entry points through which TestPicker gets the tests evaluated. They sit at the bottom of every backtrace we capture and never say anything about the failure.

source
TestPicker.TESTENV_CACHEConstant
TESTENV_CACHE

Cache for TestEnv temporary environments to avoid triggering recompilation on every test run.

This constant stores a mapping from PackageSpec objects to their corresponding temporary test environment paths. Reusing these environments improves performance by avoiding the overhead of recreating test environments.

source
TestPicker.EvalTestType
EvalTest

Container for executable test code and its associated metadata.

Combines a Julia expression representing test code with metadata about its source and context. Used throughout TestPicker for tracking and executing tests.

content_hash is the CRC32c checksum of the source file's contents when ex was captured, so that a rerun (test> -) can detect that the file changed in the meantime (a content hash catches edits that a modification time can miss, e.g. on filesystems with coarse mtime resolution, or a save that happens to restore the original mtime) and try to relocate the block instead of blindly replaying a stale expression; see refresh_stale_test.

source
TestPicker.StdTestsetType
StdTestset <: TestBlockInterface

Standard implementation of TestBlockInterface for @testset blocks from Julia's Test.jl standard library.

This is the built-in interface for recognizing and processing standard Julia test sets. It handles @testset blocks commonly used in Julia testing and provides the necessary preamble to load the Test.jl package.

source
TestPicker.SyntaxBlockType
SyntaxBlock

A container for a test block and its associated preamble statements.

Contains all the necessary components to execute a test block, including any setup code that needs to run beforehand. Can be easily converted into an evaluatable expression.

source
TestPicker.TestBlockInfoType
TestBlockInfo

Metadata container for a test block, including its location and identification information.

Stores essential information about a test block's location within a file and provides a label for identification and display purposes.

Fields

  • label::String: Human-readable label for the test block (e.g., test set name)
  • file_name::String: Name of the file containing the test block
  • line_start::Int: Starting line number of the test block (1-indexed)
  • line_end::Int: Ending line number of the test block (1-indexed)
source
TestPicker.TestBlockInterfaceType
TestBlockInterface

Abstract interface for defining and recognizing different types of test blocks in Julia code.

The TestBlockInterface allows you to define different types of test blocks that you would like TestPicker to find and evaluate. The interface is relatively simple and flexible.

source
TestPicker.TestInfoType
TestInfo

Container for test execution metadata and location information.

Stores essential information about a test's source location and context, used for tracking test execution and displaying results.

source
TestPicker.TestPickerResultType
TestPickerResult

A single failed or errored test, together with the chain of @testset descriptions (outermost to innermost) it occurred under, not counting TestPicker's own root testset, and the stacktrace captured from the real backtrace when there was one to capture, see captured_trace.

source
TestPicker.TestPickerTestSetType
TestPickerTestSet

Root Test.AbstractTestSet used by TestPicker to run tests instead of Test.DefaultTestSet.

Wraps a real Test.DefaultTestSet and forwards all recording to it, so nested @testsets behave exactly as they would under a plain DefaultTestSet. The only difference shows up when the outermost testset finishes with failures: instead of Test.TestSetException, which flattens every failure into a flat list and discards which @testset it occurred in, finish throws a TestPickerTestSetException that keeps the full @testset nesting path for each failure.

Since Test.@testset reuses the parent testset's type for any nested @testset that doesn't specify one explicitly, wrapping just the outermost call in @testset TestPickerTestSet ... end is enough to make every testset in the run a TestPickerTestSet, all the way down.

source
TestPicker.TestResultEntryType
TestResultEntry

One failed or errored test, as stored in the results file.

list_view, source and preview are what the first picker displays, edits and previews, context records where the test came from, and trace holds the structured stacktrace the stacktrace viewer explores. trace is nothing for failures that have no stacktrace at all, and is built from the real backtrace whenever TestPicker managed to capture one, see trace_error.

source
TestPicker.TraceErrorType
TraceError

An error message together with the TraceFrames of its stacktrace.

frames is empty when no stacktrace could be obtained, which is the case for test failures (as opposed to errors) and for exceptions thrown before any frame was recorded.

source
TestPicker.TraceFrameType
TraceFrame

One frame of a stacktrace, in the intermediate representation shared by every source of errors TestPicker can display.

text is what the picker shows for the frame (it may carry ANSI codes, and usually spans the two lines Julia prints per frame), while the other fields are the structured data the preview and the editor binding need. file is the path as resolved by Base.find_source_file, i.e. an absolute path, or nothing when the frame has no source we can open (REPL[1], none:0, C frames...). line is 0 in that case.

Frames come either from a real backtrace (trace_error on an exception) or from parsing printed stacktrace text (trace_error on a String), and are serialized to JSON in the results file, see TestResultEntry.

source
REPL.LineEdit.complete_lineMethod
complete_line(::TestModeCompletionProvider, s::LineEdit.PromptState; hint::Bool=false)

Provide completions based on available test file names (without paths).

source
TestPicker.add_interface!Method
add_interface!(interface::TestBlockInterface) -> Vector{TestBlockInterface}

Register a new test block interface with TestPicker.

Adds the provided interface to the global INTERFACES collection, enabling TestPicker to recognize and process the corresponding test block types. Duplicates are automatically removed to prevent redundant processing.

source
TestPicker.blocklabelMethod
blocklabel(interface::T, node::SyntaxNode)::String where {T<:TestBlockInterface}

Generate a descriptive label for a test block to be used in filtering and display.

This is a required method that must be implemented by all concrete subtypes of TestBlockInterface. It should produce a (preferably) unique label that helps users identify and select specific test blocks.

source
TestPicker.build_eval_testMethod
build_eval_test(blockinfo::TestBlockInfo, syntax_block::SyntaxBlock, pkg::PackageSpec) -> EvalTest

Build an executable EvalTest from a located test block.

Wraps the block in a TestPickerTestSet, prepends any preamble required by its interface, and records a CRC32c checksum of the source file's current contents (used by refresh_stale_test to detect edits before a rerun).

source
TestPicker.build_info_to_syntaxMethod
build_info_to_syntax(interfaces, root, matched_files) -> (Dict{TestBlockInfo,SyntaxBlock}, Dict{String,TestBlockInfo})

Parse matched files and build mapping structures for test block selection and display.

Extracts all test blocks from the provided files and creates two mappings:

  1. From test block metadata to syntax information
  2. From human-readable display strings (for fzf) to test block metadata
source
TestPicker.captured_traceMethod

Capture the stacktrace of an errored test from the real backtrace, when it is still reachable.

Test stringifies the backtrace as it builds a Test.Error, so record never receives the frames themselves. But for an error thrown outside of a @test, record is called from within Test's own catch block, which means the exception stack of the task is still live and Base.current_exceptions() hands us the real frames. An error raised inside a @test is already out of that catch by the time record runs, and only the printed text remains, see trace_error.

source
TestPicker.clear_testenv_cacheMethod
clear_testenv_cache()

Clear the TestEnv cache to force recreation of test environments on next use.

Empties the TESTENV_CACHE dictionary, which will cause subsequent test evaluations to create fresh test environments. This can be useful when test dependencies have changed or when troubleshooting environment-related issues.

source
TestPicker.create_repl_test_modeMethod
create_repl_test_mode(repl::AbstractREPL, main::LineEdit.Prompt) -> LineEdit.Prompt

Create a new REPL mode specifically for test operations.

Constructs a custom REPL prompt mode that handles test-specific commands and provides an isolated interface for TestPicker operations. The mode includes proper history support, key bindings, and command processing.

source
TestPicker.current_pkgMethod
current_pkg() -> PackageSpec

Get the current package specification from the active Pkg environment.

This is a more flexible version of current_pkg_name from TestEnv that returns the full PackageSpec object rather than just the package name. This provides access to additional package metadata needed by TestPicker.

source
TestPicker.current_pkg_or_nothingMethod
current_pkg_or_nothing() -> Union{Nothing,PackageSpec}

Same as current_pkg but returns nothing instead of throwing when the active environment is not a package, e.g. when inspecting an error from a plain environment.

source
TestPicker.drop_test_framesMethod
drop_test_frames(trace::TraceError) -> TraceError

Remove the frames of the Test standard library, which only ever show the internals of @test and @testset. Frames keep the number Julia gave them, so the gaps show where the machinery was.

source
TestPicker.eval_in_moduleMethod
eval_in_module(eval_test::EvalTest, pkg::PackageSpec) -> Union{Nothing,TestSetException,TestPickerTestSetException}

Execute a test block in an isolated module with the appropriate test environment activated.

This function provides the core test execution functionality for TestPicker. It creates a temporary module, activates the package's test environment, and evaluates the test code in isolation to prevent interference between different test runs.

Returns nothing when all tests pass successfully. Otherwise returns a TestSetException (bare, unwrapped test code) or a TestPickerTestSetException (test code wrapped in a TestPickerTestSet, as done by run_testfile and testblock_list) when test failures are encountered.

source
TestPicker.expr_transformMethod
expr_transform(interface::TestBlockInterface, ex::Expr)::Expr

Transform a test block expression before evaluation.

This optional method allows test block interfaces to modify the test block expression before it is executed. This can be useful for adding wrapper code, modifying test behavior, or adapting different test formats.

Arguments

  • interface::TestBlockInterface: The test block interface implementation
  • ex::Expr: The test block expression to transform
  • info::TestBlockInfo a bunch of metadata about the block that can be used to modify the expression
  • root::AbstractString the root directory of the test folder.

Returns

  • Expr: The transformed expression ready for evaluation

Default Behavior

The default implementation returns the expression unchanged (identity transformation).

Examples

# Add timing information to test blocks:
function expr_transform(::TimedTestInterface, ex::Expr, ::TestBlockInfo, ::AbstractString)
    return quote
        start_time = time()
        result = $ex
        elapsed = time() - start_time
        println("Test completed in $(elapsed)s")
        result
    end
end

# Wrap tests in additional error handling:
function expr_transform(::SafeTestInterface, ex::Expr, ::TestBlockInfo, ::AbstractString)
    return quote
        try
            $ex
        catch e
            @warn "Test failed with error: $e"
            rethrow()
        end
    end
end
source
TestPicker.frame_signatureMethod

The call signature of a frame, as Julia prints it after the frame number, e.g. sqrt(x::Int64). show_spec_linfo is what Base.show_backtrace itself uses; should it ever go away we simply lose the argument types.

source
TestPicker.fzf_inputMethod

The \0-separated, separator()-delimited records the first picker reads on its stdin.

The index of the entry leads the record: the preview field holds newlines, so no later field can be recovered from what fzf prints back.

source
TestPicker.fzf_recordMethod

One separator()-delimited record for the stacktrace picker: the text to display, the source to preview and edit, and the line range the preview should cover.

Frames of the current package are highlighted, in blue for src and yellow for test. Frames without a source we could resolve only get their text, leaving the preview empty.

source
TestPicker.fzf_testblockMethod
fzf_testblock(interfaces, fuzzy_file, fuzzy_testset; interactive::Bool=true) -> Nothing

Test block selection and execution workflow using fzf.

Provides a two-stage fuzzy finding process:

  1. Filter test files based on fuzzy_file query
  2. Select specific test blocks from filtered files based on fuzzy_testset query

If interactive=true (default), uses fzf's interactive mode for selecting test blocks. If interactive=false, uses fzf's filter mode to non-interactively select and run all matching test blocks.

source
TestPicker.fzf_testblock_from_filesMethod
fzf_testblock_from_files(interfaces, matched_files, fuzzy_testset, pkg, root; interactive::Bool=true) -> Nothing

Test block selection and execution from a list of matched files.

If interactive=true (default), presents an fzf interface to select specific test blocks from those files based on fuzzy_testset query.

If interactive=false, uses fzf's filter mode to non-interactively select and run all matching test blocks.

source
TestPicker.fzf_testfileMethod
fzf_testfile(query::AbstractString; interactive::Bool=true) -> Nothing

Test file selection and execution workflow.

If interactive=true (default), uses fzf to interactively select test files based on the query, then runs all selected files in the test environment. If ctrl-b is pressed during file selection, switches to testblock selection mode instead.

If interactive=false, uses fzf's filter mode to non-interactively select and run all matching test files based on the query.

source
TestPicker.get_matching_filesMethod
get_matching_files(file_query::AbstractString, test_files::AbstractVector{<:AbstractString}) -> Vector{String}

Filter test files using fzf's non-interactive filtering based on the given query.

Uses fzf --filter to perform fuzzy matching on the provided list of test files, returning only those that match the query pattern.

Arguments

  • file_query::AbstractString: Fuzzy search pattern to match against file names
  • test_files::AbstractVector{<:AbstractString}: List of test file paths to filter

Returns

  • Vector{String}: List of file paths that match the query

Examples

files = ["test/test_math.jl", "test/test_string.jl", "test/integration.jl"]
get_matching_files("math", files)  # Returns ["test/test_math.jl"]
source
TestPicker.get_syntax_blocksMethod
get_syntax_blocks(interfaces::Vector{<:TestBlockInterface}, file::AbstractString) -> Vector{SyntaxBlock}

Parse a Julia file and extract all test blocks with their associated preamble statements.

For each test block found (including nested ones), collects all preceding preamble statements that should be executed before the test block. Uses the provided interfaces to determine what constitutes a test block.

Arguments

  • interfaces::Vector{<:TestBlockInterface}: Collection of test block interfaces to use for parsing
  • file::AbstractString: Path to the Julia file to parse

Returns

  • Vector{SyntaxBlock}: Collection of parsed test blocks with their preambles
source
TestPicker.get_testfilesFunction
get_testfiles(pkg::PackageSpec=current_pkg()) -> (String, Vector{String})

Discover and return all Julia test files for a package.

Recursively searches the package's test directory to find all .jl files, returning both the test directory path and the collection of relative file paths.

source
TestPicker.group_framesMethod

Group the lines of a printed stacktrace into frames.

A frame starts at a line of the form [i] some_call(...) and holds every line until the next one (usually a single @ Module path:line line, but exception chains (caused by:) or task errors can add more).

source
TestPicker.identify_queryMethod
identify_query(input::AbstractString) -> (QueryType, Tuple)

Parse user input in test mode and identify the type of operation requested.

Analyzes the input string to determine what kind of test operation the user wants to perform and extracts the relevant parameters for that operation.

source
TestPicker.init_test_repl_modeMethod
init_test_repl_mode(repl::AbstractREPL) -> Nothing

Initialize and add test mode to the REPL interface.

Sets up a custom REPL mode for TestPicker that can be accessed by typing '!' at the beginning of a line. The test mode provides specialized commands for running and inspecting tests interactively.

source
TestPicker.inspect_errorMethod
inspect_error(err=last_exception(); pkg=current_pkg_or_nothing(), repl=Base.active_repl)

Explore the stacktrace of any exception with the same interactive viewer used for test results, see visualize_stacktrace.

err can be

  • an exception stack, e.g. the err variable set by the REPL after an error (this is what is used when inspect_error is called without argument),
  • a (; exception, backtrace) entry of such a stack,
  • an exception, optionally followed by its backtrace,
  • the raw text of an error, as printed in the REPL,
  • a TraceError built beforehand.

The first three keep the real backtrace all the way to the viewer; only the text form has to be parsed back, see trace_error.

Examples

julia> sqrt(-1)
ERROR: DomainError with -1.0:
[...]

julia> inspect_error()  # equivalent to `inspect_error(err)`

The same viewer is reachable from test mode with test> @e.

source
TestPicker.ispreambleMethod
ispreamble(node::SyntaxNode) -> Bool

Check if a statement qualifies as a preamble that should be executed before test blocks.

A preamble statement is any statement that sets up the testing environment, such as:

  • Function calls (:call)
  • Import/using statements (:using, :import)
  • Variable assignments (:=)
  • Macro calls (:macrocall)
  • Function definitions (:function)
source
TestPicker.istestblockMethod
istestblock(interface::T, node::SyntaxNode)::Bool where {T<:TestBlockInterface}

Determine whether a syntax node represents a test block according to the given interface.

This is a required method that must be implemented by all concrete subtypes of TestBlockInterface. It examines a syntax node and decides whether it represents a test block that should be recognized by TestPicker.

source
TestPicker.last_exceptionMethod
last_exception() -> Union{Nothing,Base.ExceptionStack}

Exception stack of the last error thrown at the REPL, i.e. the content of the err variable, or nothing if no error was thrown yet.

source
TestPicker.pick_testblockMethod
pick_testblock(tabled_keys, testset_query, root; interactive::Bool=true) -> Vector{String}

Select test blocks to execute based on a fuzzy search query.

If interactive=true (default), launches fzf with a preview window (using bat) that allows users to select one or more test blocks from the filtered list. The preview shows the actual test code with syntax highlighting.

If interactive=false, uses fzf's filter mode to non-interactively return all matching test blocks.

source
TestPicker.preambleMethod
preamble(interface::TestBlockInterface)::Union{Nothing, Expr}

Return additional preamble code specific to the test block interface.

This optional method allows test block interfaces to specify setup code that should be executed before any test blocks of this type. Common uses include importing required packages or setting up test environment variables.

source
TestPicker.prepend_exMethod
prepend_ex(ex, new_line::Expr) -> Expr

Prepend a new expression to an existing expression, handling block structure appropriately.

If the target expression is already a block, the new expression is prepended to the beginning of the block. Otherwise, a new block is created containing both expressions.

source
TestPicker.prepend_preamble_statementsMethod
prepend_preamble_statements(interface::TestBlockInterface, preambles::Vector{Expr}) -> Vector{Expr}

Combine interface-specific preamble with existing preamble statements.

Takes the preamble from the interface (if any) and prepends it to the existing collection of preamble statements, ensuring interface requirements are satisfied before test execution.

source
TestPicker.print_test_docsMethod
print_test_docs() -> Nothing

Print a summary of available features and commands in test mode.

Displays a help message showing all the different ways to interact with TestPicker's test REPL mode.

source
TestPicker.printed_funcMethod

The name of the function a printed frame belongs to, i.e. what sits between the frame number and the argument list. Enough to recognize the top-level scope and macro expansion frames the line repair works on.

source
TestPicker.read_resultsMethod
read_results(pkg::PackageSpec) -> Union{Nothing,Vector{TestResultEntry}}

Read back the entries saved for pkg, or nothing when no results were ever saved.

source
TestPicker.refresh_stale_testMethod
refresh_stale_test(test::EvalTest, pkg::PackageSpec) -> Union{Nothing,EvalTest}

Re-locate a test block's source before rerunning it, if the file changed since capture.

test> - normally replays the exact expression captured when the block was selected. If the source file was edited since then, that expression no longer reflects what's on disk. This compares a CRC32c checksum of the file's current contents against the one recorded on test (a content hash, rather than the modification time, so a real edit is never missed due to coarse mtime resolution or a save that happens to restore the original mtime). If the checksum changed, the whole file is re-parsed from scratch via build_info_to_syntax — the same routine used for the original selection, so every block's preamble is recomputed exactly as it would be for a fresh pick — and the block whose label aligns with test's is looked up in the result.

Whole-file tests (empty label, from test> <file>) are returned unchanged: they include the file, so they already see edits on rerun. If the file can no longer be found, if no block with a matching label exists anymore (renamed or removed), or if the label is now ambiguous (matches more than one block), there is no reliable way to know what to rerun: a warning is emitted and nothing is returned, so the stale test is dropped rather than silently re-running outdated code.

source
TestPicker.replace_interface!Method
replace_interface!(interface::TestBlockInterface) -> Vector{TestBlockInterface}

Similar to add_interface! but empty the interface first before adding the new one so that it becomes the unique interface.

source
TestPicker.run_testfileMethod
run_testfile(file::AbstractString, pkg::PackageSpec) -> Any

Execute a single test file in an isolated testset within the package test environment.

Wraps the test file in a testset named after the package and file, handles test failures gracefully, and updates the global test state for later inspection.

source
TestPicker.run_testfilesMethod
run_testfiles(files::AbstractVector{<:AbstractString}, pkg::PackageSpec) -> Nothing

Execute a collection of test files in the package test environment.

Runs each provided test file in sequence, handling errors gracefully and updating the test evaluation state. Each file is wrapped in a testset and executed in isolation.

source
TestPicker.save_test_resultsMethod
save_test_results(testset::Test.TestSetException, testinfo::TestInfo, pkg::PackageSpec) -> Nothing

Save test failures and errors from a test set to the package's results file.

Processes a test set exception containing failed and errored tests, formats them for display in the results viewer, and appends them to the package's results file. Each test result includes the test description, source location, detailed error information, and context.

source
TestPicker.save_test_resultsMethod
save_test_results(testset::TestPickerTestSetException, testinfo::TestInfo, pkg::PackageSpec) -> Nothing

Like the Test.TestSetException method, but each failure also carries the @testset nesting path it occurred under, shown at the top of the preview text, and the stacktrace captured from the real backtrace when there was one.

source
TestPicker.select_testfilesFunction
select_testfiles(query::AbstractString, pkg::PackageSpec=current_pkg(); interactive::Bool=true) -> (Symbol, String, Vector{String})

Select test files using fzf based on a fuzzy search query.

If interactive=true (default), presents an fzf interface showing all test files for the package, with syntax-highlighted preview using bat. Users can select multiple files and the query pre-filters the results.

If interactive=false, uses fzf's filter mode to non-interactively return all matching files.

Returns a tuple of (mode, root, files) where:

  • mode is either :file or :testblock depending on whether the user pressed Enter or Ctrl+B (interactive mode only, always :file in non-interactive mode)
  • root is the test directory path
  • files are relative paths (not joined with root yet)
source
TestPicker.test_mode_do_cmdMethod
test_mode_do_cmd(repl::AbstractREPL, input::String) -> Nothing

Execute test commands received in the test REPL mode.

Processes user input from the test mode, identifies the requested operation, and dispatches to the appropriate test execution or inspection function.

source
TestPicker.testblock_listMethod
testblock_list(choices, info_to_syntax, display_to_info, pkg) -> Vector{EvalTest}

Convert user-selected test block choices into executable test objects.

Takes the selected display strings from fzf and converts them into EvalTest objects that can be evaluated. Each test is wrapped in a try-catch block to handle test failures gracefully and save results.

source
TestPicker.total_countsMethod

Test.get_test_counts returns a positional tuple on Julia <= 1.11 and a Test.TestCounts struct (with no iterate method) from Julia 1.12 onwards. Handle both instead of destructuring positionally.

We also deliberately never set dts.time_end ourselves: on Julia 1.13+ that field is @atomic, and writing it plainly (as opposed to Test's own @atomicswap) throws. Leaving it unset just means Test.print_test_results omits the duration, which every supported version already handles gracefully (DefaultTestSet's own nested testsets skip printing entirely, so an unset time_end is not a state Test.jl special-cases).

source
TestPicker.trace_errorMethod
trace_error(text::AbstractString) -> TraceError

Parse printed stacktrace text (the output of showerror, or the string Test.Error stores) into a TraceError.

This is the lossy of the two parsers: file and line are recovered with a regular expression, so frames whose location Julia does not print as path.jl:line (REPL[1], none:0) or whose path contains a space come out without a source. Prefer trace_error on the exception itself whenever the backtrace is still available.

source
TestPicker.trace_errorMethod
trace_error(stack::Base.ExceptionStack) -> TraceError
trace_error(exception, backtrace) -> TraceError

Build a TraceError from a real, in-memory backtrace.

Every field comes straight from the StackTraces.StackFrames, so no text has to be parsed back: the source of each frame is exact, even when Julia would print it as a relative or otherwise unparseable path.

For an exception stack, the frames are those of the exception on top of the stack (the one Julia reports first) and the messages of the exceptions it was caused by are appended to the header, mirroring Base.show_exception_stack.

source
TestPicker.truncate_traceMethod
truncate_trace(trace::TraceError) -> TraceError

Drop the machinery frames that TestPicker and Julia's file loader add below the code being tested.

The text equivalent, truncate_backtrace, has to recognize that boundary from what Julia printed; here the frames tell us which module and file they come from, so the cutoff holds wherever TestPicker happens to be installed and whatever signature the include of the day has.

Everything from TestPicker's own topmost frame downwards goes (that is TestPicker itself and whoever called it), and so does the run of loader frames just above it. Loader frames are only stripped from that run, so a test that calls eval or include of its own keeps the frames that surround it.

source
TestPicker.visualize_stacktraceMethod
visualize_stacktrace(trace::TraceError; title, pkg, terminal, editor_cmd) -> Bool
visualize_stacktrace(text::AbstractString; kwargs...) -> Bool

Interactive exploration of a stacktrace using fzf.

Every frame of trace is listed as an entry, with a preview of the corresponding source file around the relevant line, and Ctrl+e opens that source in the editor. Given a String instead, the text is parsed into a TraceError first, see trace_error.

title is prepended to the error message shown in the fzf header, pkg (when given) is used to highlight the frames pointing to the package src (blue) and test (yellow) directories.

Returns false when trace has no frame to show, true otherwise.

source
TestPicker.visualize_test_resultsFunction
visualize_test_results(repl::AbstractREPL=Base.active_repl, pkg::PackageSpec=current_pkg()) -> Nothing

Interactive visualization of test failures and errors using fzf interface.

Creates a loop-based interface for browsing test failures and errors from the most recent test execution. Provides syntax-highlighted previews of stack traces and allows editing of test files directly from the interface.

source
TestPicker.with_testset_pathMethod

Prefix a preview with the @testset nesting path it occurred under, if any.

preview may be nothing (Test.Fail.data is Union{Nothing,String}), matching how preview_content is otherwise handled by join.

source
TestPicker.write_resultsMethod

Append entries to the package's results file.

Results are stored as JSON Lines, one TestResultEntry per line, so that a new run can simply append to what is already there, the way the runs themselves accumulate.

source