Liking cljdoc? Tell your friends :D

test-filter.graph

Graph operations for dependency analysis and test selection.

Graph operations for dependency analysis and test selection.
raw docstring

build-dependency-graphclj

(build-dependency-graph {:keys [nodes edges]})

Builds a directed graph from symbol nodes and usage edges.

The graph represents 'uses' relationships: A -> B means 'A uses B'

We'll traverse backwards from tests to find dependencies.

Builds a directed graph from symbol nodes and usage edges.

The graph represents 'uses' relationships:
  A -> B means 'A uses B'

We'll traverse backwards from tests to find dependencies.
sourceraw docstring

find-affected-testsclj

(find-affected-tests graph test-symbols changed-symbols symbol-graph)

Given a set of changed symbols and a dependency graph, returns the set of test symbols that transitively depend on any changed symbol.

Handles integration tests specially:

  • If a test has :test-targets metadata, only run if those targets changed
  • If a test is marked :integration? but has no targets, run conservatively (always)
  • Otherwise, use transitive dependency analysis

Args: graph - loom directed graph of symbol dependencies test-symbols - collection of test symbols or [symbol node-data] pairs changed-symbols - set of symbols that have changed symbol-graph - original symbol graph with node metadata

Returns: Set of test symbols that need to run

Given a set of changed symbols and a dependency graph,
returns the set of test symbols that transitively depend on any changed symbol.

Handles integration tests specially:
- If a test has :test-targets metadata, only run if those targets changed
- If a test is marked :integration? but has no targets, run conservatively (always)
- Otherwise, use transitive dependency analysis

Args:
  graph - loom directed graph of symbol dependencies
  test-symbols - collection of test symbols or [symbol node-data] pairs
  changed-symbols - set of symbols that have changed
  symbol-graph - original symbol graph with node metadata

Returns:
  Set of test symbols that need to run
sourceraw docstring

graph-statsclj

(graph-stats graph)

Returns statistics about the dependency graph.

Returns statistics about the dependency graph.
sourceraw docstring

symbols-with-dependentsclj

(symbols-with-dependents graph)

Returns a map of symbol -> #{symbols-that-depend-on-it}.

This is useful for finding which tests are affected by a change.

Returns a map of symbol -> #{symbols-that-depend-on-it}.

This is useful for finding which tests are affected by a change.
sourceraw docstring

transitive-dependenciesclj

(transitive-dependencies graph symbol)

Returns all transitive dependencies of a symbol.

Given a symbol, walks the graph backwards (in the direction of 'uses') to find all symbols it transitively depends on.

Example: If test-foo uses handler, and handler uses db-query, returns #{handler db-query}

Returns all transitive dependencies of a symbol.

Given a symbol, walks the graph backwards (in the direction of 'uses')
to find all symbols it transitively depends on.

Example: If test-foo uses handler, and handler uses db-query,
         returns #{handler db-query}
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close