-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add instructions for running integration tests against local DDB, mak…
…e sure to delete test tables after running integration, version bump to 2.2.2
- Loading branch information
1 parent
7a1952f
commit e3d6c70
Showing
8 changed files
with
85 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,3 @@ | ||
# This file is responsible for configuring your application | ||
# and its dependencies with the aid of the Mix.Config module. | ||
use Mix.Config | ||
|
||
config :ex_aws, :dynamodb, | ||
scheme: "http://", | ||
host: "localhost", | ||
port: 8000, | ||
region: "us-east-1" | ||
|
||
case Mix.env do | ||
:test_options -> import_config "test_options.exs" | ||
_ -> nil | ||
end | ||
|
||
# This configuration is loaded before any dependency and is restricted | ||
# to this project. If another project depends on this project, this | ||
# file won't be loaded nor affect the parent project. For this reason, | ||
# if you want to provide default values for your application for | ||
# 3rd-party users, it should be done in your "mix.exs" file. | ||
|
||
# You can configure your application as: | ||
# | ||
# config :ex_aws_dynamo, key: :value | ||
# | ||
# and access this configuration in your application as: | ||
# | ||
# Application.get_env(:ex_aws_dynamo, :key) | ||
# | ||
# You can also configure a 3rd-party app: | ||
# | ||
# config :logger, level: :info | ||
# | ||
|
||
# It is also possible to import configuration files, relative to this | ||
# directory. For example, you can emulate configuration per environment | ||
# by uncommenting the line below and defining dev.exs, test.exs and such. | ||
# Configuration from the imported file will override the ones defined | ||
# here (which is why it is important to import them last). | ||
# | ||
# import_config "#{Mix.env}.exs" | ||
import_config "#{Mix.env}.exs" |
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,7 @@ | ||
use Mix.Config | ||
|
||
config :ex_aws, :dynamodb, | ||
scheme: "http://", | ||
host: "localhost", | ||
port: 8000, | ||
region: "us-east-1" |
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 |
---|---|---|
|
@@ -3,3 +3,5 @@ require Logger | |
|
||
config :ex_aws, :dynamodb, | ||
decode_sets: true | ||
|
||
import_config "test.exs" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
defmodule DDBLocal do | ||
@moduledoc """ | ||
Helper methods for working with local DynamoDB during testing. | ||
""" | ||
|
||
alias ExAws.Dynamo | ||
|
||
@doc """ | ||
Delete tables created while running tests. | ||
""" | ||
def delete_test_tables(tables) do | ||
tables | ||
|> Enum.each(fn table -> Dynamo.delete_table(table) |> ExAws.request() end) | ||
:ok | ||
end | ||
end |