ExExample.Executor (ExExample v0.1.2)
View SourceI contain functionality to execute examples.
I contain logic to determine if a cachd result should be used, computation should be done again, or if an example should be skipped.
Summary
Functions
I attempt to run an example.
Given an example, I return a hash of all its dependencies. This hash can be used to determine of an example was run with an older version of a dependency.
Given an example, I return a map of all its dependencies that failed, succeeded, were skipped, or have not run yet.
Given an example, I return a hash of all its dependencies. This hash can be used to determine of an example was run with an older version of a dependency.
I return the last known result of an example invocation. If the example has not been run yet I return an error.
I run all the examples in the given module. I use the cache for each invocation.
I run an example directly. I do not consult the cache for a previous result. I return a result of this execution and put it in the cache.
I run an example with the cached results. If there is cached result, I return that. If there is no result in the cache I run the example.
Functions
@spec attempt_example( {atom(), atom()}, [any()] ) :: ExExample.Run.t()
I attempt to run an example.
I return a struct that holds the result, the key, and a list of all the dependencies and their previous result.
@spec dependency_hash({atom(), atom()}) :: non_neg_integer()
Given an example, I return a hash of all its dependencies. This hash can be used to determine of an example was run with an older version of a dependency.
@spec dependency_results({atom(), atom()}) :: %{ success: [ExExample.dependency()], skipped: [ExExample.dependency()], failed: [ExExample.dependency()], no_cache: [ExExample.dependency()] }
Given an example, I return a map of all its dependencies that failed, succeeded, were skipped, or have not run yet.
@spec deps_hash([ExExample.dependency()]) :: non_neg_integer()
Given an example, I return a hash of all its dependencies. This hash can be used to determine of an example was run with an older version of a dependency.
@spec last_result(ExExample.dependency()) :: :success | :skipped | :failed | :no_cache
I return the last known result of an example invocation. If the example has not been run yet I return an error.
@spec pretty_run(atom()) :: :ok
@spec print_dependencies(ExExample.Run.t()) :: binary()
@spec print_run(ExExample.Run.t()) :: :ok
@spec run_all_examples(atom()) :: [ExExample.Run.t()]
I run all the examples in the given module. I use the cache for each invocation.
@spec run_example( {atom(), atom()}, [any()] ) :: ExExample.Cache.Result.t()
I run an example directly. I do not consult the cache for a previous result. I return a result of this execution and put it in the cache.
@spec run_example_with_cache( {atom(), atom()}, [any()] ) :: ExExample.Cache.Result.t()
I run an example with the cached results. If there is cached result, I return that. If there is no result in the cache I run the example.