-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
87 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
defmodule Mix.Tasks.Cachex do | ||
use Mix.Task | ||
|
||
@moduledoc false | ||
# A neat Mix Task to automate the wrapping of tasks in a Cachex context. A context | ||
# will start any Cachex required test nodes so that they're available for testing | ||
# replication and remote features. | ||
# | ||
# The first argument to this task must be the name of the task you wish to run. | ||
# Any arguments thereafter will be passed directly to that task. This allows | ||
# you to easily start a test run by doing something like this: | ||
# | ||
# mix cachex test --trace | ||
# | ||
# This task exists to make it flexible to run Cachex test-based tools, whereas | ||
# previously we defined a task per those we recognised, which naturally didn't | ||
# scale particularly well. | ||
|
||
# import context tools | ||
import Mix.Cachex | ||
|
||
@doc """ | ||
Provides access to tasks inside a Cachex context. | ||
This is required as there are several nodes to stop/start for things such as | ||
test runs. Running via this Task will start the context, run the provided task, | ||
and then close the context. | ||
The first argument must always be a task to execute, and any other arguments | ||
as passed directly through to the Mix Task itself. | ||
As an example: | ||
Mix.Tasks.Cachex.run([ "test", "--trace" ]) | ||
will execute the `test` task, with the argument `--trace`. | ||
""" | ||
@spec run(OptionParser.argv) :: no_return | ||
def run([task]) do | ||
run_in_context(task) | ||
end | ||
def run([task | args]) do | ||
run_in_context(task, args) | ||
end | ||
def run([]) do | ||
Mix.raise("A task name must be provided as first argument") | ||
end | ||
|
||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters