diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index 22f02fd..9eded14 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -19,21 +19,16 @@ jobs: build: name: Build and test runs-on: ubuntu-20.04 - strategy: fail-fast: false matrix: pair: + - elixir: 1.17 + otp: 26.2 - elixir: 1.16 otp: 26.2 - elixir: 1.15 otp: 26.2 - - elixir: 1.14 - otp: 25.3 - - elixir: 1.13 - otp: 25.3 - - elixir: 1.13 - otp: 24.2 steps: - uses: actions/checkout@v3 diff --git a/.tool-versions b/.tool-versions index bd6bc28..e33ee97 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -erlang 25.3.2.13 -elixir 1.17-otp-25 \ No newline at end of file +erlang 26.2 +elixir 1.17-otp-26 diff --git a/README.md b/README.md index 4d4453e..7f7fb94 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,12 @@ Before you begin, ensure you have met the following requirements: - You have a Docker runtime installed - You are familiar with Elixir and Docker basics +## Tested compability + +- 1.17 25 - 26 (27 is not supported by rabbit_common, so if you dont use that you can still use 27) +- 1.16 24 - 26 +- 1.15 24 - 26 + ## Installation To add Testcontainers to your project, follow these steps: diff --git a/examples/phoenix_project/lib/hello/application.ex b/examples/phoenix_project/lib/hello/application.ex index 1f39a34..eee4f4a 100644 --- a/examples/phoenix_project/lib/hello/application.ex +++ b/examples/phoenix_project/lib/hello/application.ex @@ -7,17 +7,6 @@ defmodule Hello.Application do @impl true def start(_type, _args) do - if Application.get_env(:testcontainers, :enabled, false) do - {:ok, _container} = Testcontainers.Ecto.postgres_container(app: :hello) - - # to use mysql, change - # `adapter: Ecto.Adapters.Postgres` - # in lib/hello/repo.ex, to - # `adapter: Ecto.Adapters.MyXQL` - - # {:ok, _container} = Testcontainers.Ecto.mysql_container(app: :hello) - end - children = [ HelloWeb.Telemetry, Hello.Repo, diff --git a/examples/phoenix_project/mix.exs b/examples/phoenix_project/mix.exs index 8ea4e5e..ec7b632 100644 --- a/examples/phoenix_project/mix.exs +++ b/examples/phoenix_project/mix.exs @@ -66,13 +66,13 @@ defmodule Hello.MixProject do [ setup: [ "deps.get", - #"ecto.setup", + "ecto.setup", "assets.setup", "assets.build" ], - #"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], - #"ecto.reset": ["ecto.drop", "ecto.setup"], - # test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"], + "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], + "ecto.reset": ["ecto.drop", "ecto.setup"], + test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"], "assets.setup": ["tailwind.install --if-missing", "esbuild.install --if-missing"], "assets.build": ["tailwind default", "esbuild default"], "assets.deploy": ["tailwind default --minify", "esbuild default --minify", "phx.digest"] diff --git a/lib/ecto.ex b/lib/ecto.ex deleted file mode 100644 index 649ea21..0000000 --- a/lib/ecto.ex +++ /dev/null @@ -1,328 +0,0 @@ -defmodule Testcontainers.Ecto do - @deprecated "This feature is deprecated and will be removed in a future release. Please call `mix testcontainers.test` instead." - - @moduledoc """ - Facilitates the creation of a Postgres or MySql container for testing with Ecto. - - This module simplifies the process of launching a real Postgres or MySql database instance within a Docker container for testing purposes. It leverages the `Testcontainers` library to instantiate a Postgres or MySql container with the desired configuration, providing an isolated database environment for each test session. - """ - - require Logger - - alias Testcontainers.PostgresContainer - alias Testcontainers.MySqlContainer - - @doc """ - Initiates a new Postgres instance, executes migrations, and prepares a suitable database environment, specifically tailored for testing scenarios. - - ## Parameters - - - `options`: Configurations for the Postgres container, provided as a keyword list. The only required option is `:app`. Other options include: - - `:app` - The current application's atom, necessary for building paths and other application-specific logic. This is a required parameter. - - `:repo` (optional) - The Ecto repository module for database interaction. If not provided, it is inferred from the `:app` option using the default naming convention (e.g., `MyApp.Repo`). - - `:image` (optional) - Specifies the Docker image for the Postgres container. This must be a legitimate Postgres image, with the image name beginning with "postgres". If omitted, the default is "postgres:15". - - `:user` (optional) - Sets the username for the Postgres instance (defaults to "postgres"). - - `:password` (optional) - Determines the password for the Postgres user (defaults to "postgres"). - - `:database` (optional) - Specifies the name of the database to be created within the Postgres instance. If not provided, the default behavior is to create a database with the name derived from the application's atom, appended with "_test". - - `:migrations_path` (optional) - Indicates the path to the migrations folder (defaults to "priv/repo/migrations"). - - `:persistent_volume_name` (optional, EXPERIMENTAL) - Sets a named volume for the data in the database. This is an experimental option, and changes in database container image or other things that could invalidate the data, would make the container not start properly. - - `:check_image` (optional) - Defines a custom regular expression that is used to validate the Docker image. - - ## Database Lifecycle in Testing - - It's important to note that the Postgres database initiated by this function will remain operational for the duration of the test process and is not explicitly shut down by the test. The database and its corresponding data are ephemeral, lasting only for the scope of the test session. - - After the tests conclude, Testcontainers will clean up by removing the database container, ensuring no residual data persists. This approach helps maintain a clean testing environment and prevents any unintended side effects on subsequent tests due to data leftovers. - - Users should not rely on any manual teardown or cleanup for the database, as Testcontainers handles this aspect automatically, providing isolated, repeatable test runs. - - ## Examples - - # In your application.ex file in your Phoenix project: - - import Testcontainers.Ecto - - @impl true - def start(_type, _args) do - postgres_container( - app: :my_app, - user: "postgres", - password: "postgres" - ) - - # .. other setup code - end - - # In mix.exs, modify the aliases to remove default Ecto setup tasks from the test alias, - # as they might interfere with the container-based database setup: - - def aliases do - [ - # ... other aliases - - # Ensure the following line is NOT present, as it would conflict with the container setup: - # test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"], - ] - end - - # in your config/test.exs, if you want to keep appending the MIX_TEST_PARTITION env variable to the database name, - # you must set the database option in postgres_container function to the same value - - config :my_app, MyApp.Repo, - username: "postgres", - password: "postgres", - hostname: "localhost", - database: "my_app_test\#{System.get_env("MIX_TEST_PARTITION")}", # set this also in postgres_container function database option, or remove the appending - pool: Ecto.Adapters.SQL.Sandbox, - pool_size: 10 - - # for example, to set the database name to the one above, in application.ex: - - @impl true - def start(_type, _args) do - postgres_container( - app: :my_app, - user: "postgres", - password: "postgres", - database: "my_app_test\#{System.get_env("MIX_TEST_PARTITION")}" - ) - - # .. other setup code - end - - ## Returns - - - `:ok` if the container is initiated successfully. - - `{:error, reason}` if there is a failure in initiating the container, with `reason` explaining the cause of the failure. - - ## Errors - - - Raises `ArgumentError` if the application is missing, not an atom, or not loaded. - - Raises `ArgumentError` if the repo is defined and not an atom - - Raises `ArgumentError` if the specified Docker image is not a valid Postgres image. - - ## Note - - This utility is intended for testing environments requiring a genuine database instance. It is not suitable for production use. It mandates a valid Postgres Docker image to maintain consistent and reliable testing conditions. - """ - def postgres_container(options \\ []) do - database_container(:postgres, options) - end - - @doc """ - Initiates a new Mysql instance, executes migrations, and prepares a suitable database environment, specifically tailored for testing scenarios. - - ## Parameters - - - `options`: Configurations for the Mysql container, provided as a keyword list. The only required option is `:app`. Other options include: - - `:app` - The current application's atom, necessary for building paths and other application-specific logic. This is a required parameter. - - `:repo` (optional) - The Ecto repository module for database interaction. If not provided, it is inferred from the `:app` option using the default naming convention (e.g., `MyApp.Repo`). - - `:image` (optional) - Specifies the Docker image for the Mysql container. This must be a legitimate Mysql image, with the image name beginning with "mysql". If omitted, the default is "mysql:8". - - `:user` (optional) - Sets the username for the Mysql instance (defaults to "test"). - - `:password` (optional) - Determines the password for the Mysql user (defaults to "test"). - - `:database` (optional) - Specifies the name of the database to be created within the Mysql instance. If not provided, the default behavior is to create a database with the name derived from the application's atom, appended with "_test". - - `:migrations_path` (optional) - Indicates the path to the migrations folder (defaults to "priv/repo/migrations"). - - `:persistent_volume_name` (optional, EXPERIMENTAL) - Sets a named volume for the data in the database. This is an experimental option, and changes in database container image or other things that could invalidate the data, would make the container not start properly. - - `:check_image` (optional) - Defines a custom regular expression that is used to validate the Docker image. - - ## Database Lifecycle in Testing - - It's important to note that the Mysql database initiated by this function will remain operational for the duration of the test process and is not explicitly shut down by the function. The database and its corresponding data are ephemeral, lasting only for the scope of the test session. - - After the tests conclude, Testcontainers will clean up by removing the database container, ensuring no residual data persists. This approach helps maintain a clean testing environment and prevents any unintended side effects on subsequent tests due to data leftovers. - - Users should not rely on any manual teardown or cleanup for the database, as Testcontainers handles this aspect automatically, providing isolated, repeatable test runs. - - ## Examples - # First, you must change the Ecto adapter from Postgres to MyXQL - - defmodule MyApp.Repo do - use Ecto.Repo, - otp_app: :my_app, - adapter: Ecto.Adapters.MyXQL # <- should look like this - end - - # Then, in your application.ex file in your Phoenix project: - - import Testcontainers.Ecto - - @impl true - def start(_type, _args) do - mysql_container( - app: :my_app, - user: "postgres", # consider changing this to something else here and in config/test.exs - password: "postgres" # consider changing this to something else here and in config/test.exs - ) - - # .. other setup code - end - - # Lastly, in mix.exs, modify the aliases to remove default Ecto setup tasks from the test alias, - # as they might interfere with the container-based database setup: - - def aliases do - [ - # ... other aliases - - # Ensure the following line is NOT present, as it would conflict with the container setup: - # test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"], - ] - end - - # in your config/test.exs, if you want to keep appending the MIX_TEST_PARTITION env variable to the database name, - # you must set the database option in mysql_container function to the same value - - config :my_app, MyApp.Repo, - username: "postgres", # <- consider changing this when using mysql - password: "postgres", # <- consider changing this when using mysql - hostname: "localhost", - database: "my_app_test\#{System.get_env("MIX_TEST_PARTITION")}", # set this also in mysql_container function database option, or remove the appending - pool: Ecto.Adapters.SQL.Sandbox, - pool_size: 10 - - # for example, to set the database name to the one above, in application.ex: - - @impl true - def start(_type, _args) do - mysql_container( - app: :my_app, - user: "postgres", # <- consider changing this when using mysql - password: "postgres", # <- consider changing this when using mysql - database: "my_app_test\#{System.get_env("MIX_TEST_PARTITION")}" - ) - - # .. other setup code - end - - ## Returns - - - `:ok` if the container is initiated successfully. - - `{:error, reason}` if there is a failure in initiating the container, with `reason` explaining the cause of the failure. - - ## Errors - - - Raises `ArgumentError` if the application is missing, not an atom, or not loaded. - - Raises `ArgumentError` if the repo is defined and not an atom - - Raises `ArgumentError` if the specified Docker image is not a valid MySql image. - - ## Note - - This utility is intended for testing environments requiring a genuine database instance. It is not suitable for production use. It mandates a valid Mysql Docker image to maintain consistent and reliable testing conditions. - """ - def mysql_container(options \\ []) do - database_container(:mysql, options) - end - - defp database_container(type, options) when type in [:postgres, :mysql] do - Testcontainers.start_link() - - app = Keyword.get(options, :app) - - if app == nil or not is_atom(app) do - raise ArgumentError, - "Missing or not an atom: app=#{inspect(app)}" - end - - repo = - case Keyword.get(options, :repo) do - nil -> - repo_name = (app |> Atom.to_string() |> camelize()) <> ".Repo" - Module.concat(Elixir, String.to_atom(repo_name)) - - repo when not is_atom(repo) -> - raise ArgumentError, "Not an atom: repo=#{inspect(repo)}" - - repo -> - repo - end - - user = Keyword.get(options, :user, "test") - password = Keyword.get(options, :password, "test") - database = Keyword.get(options, :database, "#{Atom.to_string(app)}_test") - migrations_path = Keyword.get(options, :migrations_path, "priv/repo/migrations") - persistent_volume_name = Keyword.get(options, :persistent_volume_name, nil) - check_image = Keyword.get(options, :check_image, nil) - - container_module = - case type do - :postgres -> PostgresContainer - :mysql -> MySqlContainer - end - - image = Keyword.get(options, :image, container_module.default_image_with_tag()) - - config = - container_module.new() - |> container_module.with_image(image) - |> container_module.with_port(container_module.default_port()) - |> container_module.with_user(user) - |> container_module.with_database(database) - |> container_module.with_password(password) - |> maybe_with_call(persistent_volume_name, &container_module.with_persistent_volume/2) - |> maybe_with_call(check_image, &container_module.with_check_image/2) - - case Testcontainers.start_container(config) do - {:ok, container} -> - :ok = - Application.put_env( - app, - repo, - Application.get_env(app, repo, []) - |> Keyword.merge( - username: user, - password: password, - database: database, - port: container_module.port(container) - ) - ) - - absolute_migrations_path = - if Path.absname(migrations_path) != migrations_path, - do: Application.app_dir(app, migrations_path), - else: migrations_path - - :ok = - case File.exists?(absolute_migrations_path) do - false -> - Logger.debug("Migrations directory does not exist, this will be ignored") - - _ -> - :ok - end - - with {:ok, _, _} <- run_migrations(repo, absolute_migrations_path) do - {:ok, container} - end - - {:error, reason} -> - {:error, reason} - end - end - - defp run_migrations(repo, migrations_path) do - try do - Ecto.Migrator.with_repo( - repo, - &Ecto.Migrator.run(&1, migrations_path, :up, all: true) - ) - rescue - e -> - {:error, e} - end - end - - defp camelize(string) do - string - |> String.split("_") - |> Enum.map(&String.capitalize/1) - |> Enum.join() - end - - defp maybe_with_call(config, nil, _function) do - config - end - - defp maybe_with_call(config, value, function) do - function.(config, value) - end -end diff --git a/mix.exs b/mix.exs index 0759a45..3efe384 100644 --- a/mix.exs +++ b/mix.exs @@ -51,9 +51,6 @@ defmodule TestcontainersElixir.MixProject do {:tesla, "~> 1.7"}, {:jason, "~> 1.4"}, {:hackney, "~> 1.20"}, - # ecto module - {:ecto_sql, "~> 3.3", optional: true}, - {:ecto, "~> 3.3", optional: true}, # mysql {:myxql, "~> 0.4", only: [:dev, :test]}, # postgres diff --git a/mix.lock b/mix.lock index 4ad7059..d70be62 100644 --- a/mix.lock +++ b/mix.lock @@ -3,26 +3,20 @@ "amqp_client": {:hex, :amqp_client, "3.12.14", "2b677bc3f2e2234ba7517042b25d72071a79735042e91f9116bd3c176854b622", [:make, :rebar3], [{:credentials_obfuscation, "3.4.0", [hex: :credentials_obfuscation, repo: "hexpm", optional: false]}, {:rabbit_common, "3.12.14", [hex: :rabbit_common, repo: "hexpm", optional: false]}], "hexpm", "5f70b6c3b1a739790080da4fddc94a867e99f033c4b1edc20d6ff8b8fb4bd160"}, "certifi": {:hex, :certifi, "2.12.0", "2d1cca2ec95f59643862af91f001478c9863c2ac9cb6e2f89780bfd8de987329", [:rebar3], [], "hexpm", "ee68d85df22e554040cdb4be100f33873ac6051387baf6a8f6ce82272340ff1c"}, "connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"}, - "cowlib": {:hex, :cowlib, "2.6.0", "8aa629f81a0fc189f261dc98a42243fa842625feea3c7ec56c48f4ccdb55490f", [:rebar3], [], "hexpm", "45a1a08e05e4c66f2af665295955e337d52c2d33b1f1cf24d353cadeddf34992"}, "crc32cer": {:hex, :crc32cer, "0.1.11", "b550da6d615feb72a882d15d020f8f7dee72dfb2cb1bcdf3b1ee8dc2afd68cfc", [:rebar3], [], "hexpm", "a39b8f0b1990ac1bf06c3a247fc6a178b740cdfc33c3b53688dc7dd6b1855942"}, "credentials_obfuscation": {:hex, :credentials_obfuscation, "3.4.0", "34e18b126b3aefd6e8143776fbe1ceceea6792307c99ac5ee8687911f048cfd7", [:rebar3], [], "hexpm", "738ace0ed5545d2710d3f7383906fc6f6b582d019036e5269c4dbd85dbced566"}, - "db_connection": {:hex, :db_connection, "2.6.0", "77d835c472b5b67fc4f29556dee74bf511bbafecdcaf98c27d27fa5918152086", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c2f992d15725e721ec7fbc1189d4ecdb8afef76648c746a8e1cad35e3b8a35f3"}, - "decimal": {:hex, :decimal, "1.9.0", "83e8daf59631d632b171faabafb4a9f4242c514b0a06ba3df493951c08f64d07", [:mix], [], "hexpm", "b1f2343568eed6928f3e751cf2dffde95bfaa19dd95d09e8a9ea92ccfd6f7d85"}, + "db_connection": {:hex, :db_connection, "2.7.0", "b99faa9291bb09892c7da373bb82cba59aefa9b36300f6145c5f201c7adf48ec", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dcf08f31b2701f857dfc787fbad78223d61a32204f217f15e881dd93e4bdd3ff"}, + "decimal": {:hex, :decimal, "2.2.0", "df3d06bb9517e302b1bd265c1e7f16cda51547ad9d99892049340841f3e15836", [:mix], [], "hexpm", "af8daf87384b51b7e611fb1a1f2c4d4876b65ef968fa8bd3adf44cff401c7f21"}, "dialyxir": {:hex, :dialyxir, "1.4.5", "ca1571ac18e0f88d4ab245f0b60fa31ff1b12cbae2b11bd25d207f865e8ae78a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b0fb08bb8107c750db5c0b324fa2df5ceaa0f9307690ee3c1f6ba5b9eb5d35c3"}, "earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"}, - "ecto": {:hex, :ecto, "3.10.3", "eb2ae2eecd210b4eb8bece1217b297ad4ff824b4384c0e3fdd28aaf96edd6135", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "44bec74e2364d491d70f7e42cd0d690922659d329f6465e89feb8a34e8cd3433"}, - "ecto_sql": {:hex, :ecto_sql, "3.10.2", "6b98b46534b5c2f8b8b5f03f126e75e2a73c64f3c071149d32987a5378b0fdbd", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.10.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "68c018debca57cb9235e3889affdaec7a10616a4e3a80c99fa1d01fdafaa9007"}, "elixir_uuid": {:hex, :elixir_uuid, "1.2.1", "dce506597acb7e6b0daeaff52ff6a9043f5919a4c3315abb4143f0b00378c097", [:mix], [], "hexpm", "f7eba2ea6c3555cea09706492716b0d87397b88946e6380898c2889d68585752"}, "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "erlzk": {:hex, :erlzk, "0.6.4", "9f51d44f097087f63e953f66f690fd8ecdab4821973123688255ca29fac9d0bc", [:rebar3], [], "hexpm", "64aa8731fbbbf82b35e5e8c283a1c19e4903e0931d36231d6d6fcb51bc24fe8e"}, "ex_aws": {:hex, :ex_aws, "2.5.7", "dbcda183903cded392742129bd5c67ccf59caed4ded604d5e68b96e75570d743", [:mix], [{:configparser_ex, "~> 4.0", [hex: :configparser_ex, repo: "hexpm", optional: true]}, {:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:jsx, "~> 2.8 or ~> 3.0", [hex: :jsx, repo: "hexpm", optional: true]}, {:mime, "~> 1.2 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:req, "~> 0.3", [hex: :req, repo: "hexpm", optional: true]}, {:sweet_xml, "~> 0.7", [hex: :sweet_xml, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2c3c577550bfc4d0899e9fed9aeef91bc6a2aedd0177b1faa726c9b20d005074"}, "ex_aws_s3": {:hex, :ex_aws_s3, "2.5.5", "d718e90e0e4803c5605ca1a7cebf44236f7439f6706151ca4485fc2dffd08bc1", [:mix], [{:ex_aws, "~> 2.0", [hex: :ex_aws, repo: "hexpm", optional: false]}, {:sweet_xml, ">= 0.0.0", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm", "ac34af1e9b3974168dda798d2fded5d12d52a1b5cf52abfeffed2a63d2eb5443"}, "ex_doc": {:hex, :ex_doc, "0.35.1", "de804c590d3df2d9d5b8aec77d758b00c814b356119b3d4455e4b8a8687aecaf", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "2121c6402c8d44b05622677b761371a759143b958c6c19f6558ff64d0aed40df"}, - "exmqtt": {:git, "https://github.com/ryanwinchester/exmqtt.git", "b6da7d412b1e7fe8c78f5e8de1895c990e34ff67", [branch: "master"]}, "fs": {:hex, :fs, "8.6.1", "7c9c0d0211e8c520e4e9eda63b960605c2711839f47285e6166c332d973be8ea", [:rebar3], [], "hexpm", "61ea2bdaedae4e2024d0d25c63e44dccf65622d4402db4a2df12868d1546503f"}, "gen_state_machine": {:hex, :gen_state_machine, "3.0.0", "1e57f86a494e5c6b14137ebef26a7eb342b3b0070c7135f2d6768ed3f6b6cdff", [:mix], [], "hexpm", "0a59652574bebceb7309f6b749d2a41b45fdeda8dbb4da0791e355dd19f0ed15"}, - "getopt": {:hex, :getopt, "1.0.2", "33d9b44289fe7ad08627ddfe1d798e30b2da0033b51da1b3a2d64e72cd581d02", [:rebar3], [], "hexpm", "a0029aea4322fb82a61f6876a6d9c66dc9878b6cb61faa13df3187384fd4ea26"}, - "gun": {:hex, :gun, "1.3.3", "cf8b51beb36c22b9c8df1921e3f2bc4d2b1f68b49ad4fbc64e91875aa14e16b4", [:rebar3], [{:cowlib, "~> 2.7.0", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "3106ce167f9c9723f849e4fb54ea4a4d814e3996ae243a1c828b256e749041e0"}, "hackney": {:hex, :hackney, "1.20.1", "8d97aec62ddddd757d128bfd1df6c5861093419f8f7a4223823537bad5d064e2", [:rebar3], [{:certifi, "~> 2.12.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "fe9094e5f1a2a2c0a7d10918fee36bfec0ec2a979994cff8cfe8058cd9af38e3"}, "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, @@ -34,17 +28,14 @@ "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, "mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [:mix], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"}, "mimerl": {:hex, :mimerl, "1.3.0", "d0cd9fc04b9061f82490f6581e0128379830e78535e017f7780f37fea7545726", [:rebar3], [], "hexpm", "a1e15a50d1887217de95f0b9b0793e32853f7c258a5cd227650889b38839fe9d"}, - "mix_rebar3": {:hex, :mix_rebar3, "0.2.0", "b33656ef3047f21a19fac3254cb30a1d2c75ea419a3ad28c4b88f42c62a4202d", [:mix], [], "hexpm", "11eabb70c0a7ead9aa3631f048c3d7d5e868172b87b6493d0dc6f6d591c1afae"}, - "myxql": {:hex, :myxql, "0.6.4", "1502ea37ee23c31b79725b95d4cc3553693c2bda7421b1febc50722fd988c918", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:geo, "~> 3.4", [hex: :geo, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "a3307f4671f3009d3708283649adf205bfe280f7e036fc8ef7f16dbf821ab8e9"}, - "nimble_options": {:hex, :nimble_options, "0.4.0", "c89babbab52221a24b8d1ff9e7d838be70f0d871be823165c94dd3418eea728f", [:mix], [], "hexpm", "e6701c1af326a11eea9634a3b1c62b475339ace9456c1a23ec3bc9a847bca02d"}, + "myxql": {:hex, :myxql, "0.7.1", "7c7b75aa82227cd2bc9b7fbd4de774fb19a1cdb309c219f411f82ca8860f8e01", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:geo, "~> 3.4", [hex: :geo, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "a491cdff53353a09b5850ac2d472816ebe19f76c30b0d36a43317a67c9004936"}, + "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, "parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"}, - "postgrex": {:hex, :postgrex, "0.17.5", "0483d054938a8dc069b21bdd636bf56c487404c241ce6c319c1f43588246b281", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "50b8b11afbb2c4095a3ba675b4f055c416d0f3d7de6633a595fc131a828a67eb"}, - "quicer": {:git, "https://github.com/emqx/quic.git", "636d2ee0aef4117eb3ffe65a9f1a574819b06b45", [tag: "0.0.114"]}, + "postgrex": {:hex, :postgrex, "0.19.3", "a0bda6e3bc75ec07fca5b0a89bffd242ca209a4822a9533e7d3e84ee80707e19", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "d31c28053655b78f47f948c85bb1cf86a9c1f8ead346ba1aa0d0df017fa05b61"}, "rabbit_common": {:hex, :rabbit_common, "3.12.14", "466123ee7346a3cdac078c0c302bcd36da4523e8acd678c1b992f7b4df1f7914", [:make, :rebar3], [{:credentials_obfuscation, "3.4.0", [hex: :credentials_obfuscation, repo: "hexpm", optional: false]}, {:recon, "2.5.3", [hex: :recon, repo: "hexpm", optional: false]}, {:thoas, "1.0.0", [hex: :thoas, repo: "hexpm", optional: false]}], "hexpm", "70c31a51f7401cc0204ddef2745d98680c2e0df67e3b0c9e198916881fde3293"}, "recon": {:hex, :recon, "2.5.3", "739107b9050ea683c30e96de050bc59248fd27ec147696f79a8797ff9fa17153", [:mix, :rebar3], [], "hexpm", "6c6683f46fd4a1dfd98404b9f78dcabc7fcd8826613a89dcb984727a8c3099d7"}, - "redix": {:hex, :redix, "1.2.1", "edf7392c0fa08708f5869e301aad20445f72ebc1949ea1c2496eaf344c845a0d", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "62608edd20a47b458a30737fd734e6f73d1f1665f3ca7821c1ee8f9abc725f11"}, - "snabbkaffe": {:hex, :snabbkaffe, "1.0.1", "8e95ccbc90e1445c6b504d7980a35fe87e140bd694ced35851965b87d42bd882", [:rebar3], [], "hexpm", "035812759963897b71ee69a11e8dff93bbbb0f475055479a557dd3c4fd72fe33"}, + "redix": {:hex, :redix, "1.5.2", "ab854435a663f01ce7b7847f42f5da067eea7a3a10c0a9d560fa52038fd7ab48", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:nimble_options, "~> 0.5.0 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "78538d184231a5d6912f20567d76a49d1be7d3fca0e1aaaa20f4df8e1142dcb8"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, "sweet_xml": {:hex, :sweet_xml, "0.7.4", "a8b7e1ce7ecd775c7e8a65d501bc2cd933bff3a9c41ab763f5105688ef485d08", [:mix], [], "hexpm", "e7c4b0bdbf460c928234951def54fe87edf1a170f6896675443279e2dbeba167"}, "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, @@ -53,5 +44,5 @@ "tortoise311": {:hex, :tortoise311, "0.12.0", "05c1f78da9aa3f7563ad66c71d2cb7904890797437078e86173d65d2a2d06f64", [:mix], [{:gen_state_machine, "~> 2.0 or ~> 3.0", [hex: :gen_state_machine, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b8bd5b1b603f75355d02c655e496a2cbb59c754e45014bcb86968899297197bb"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"}, "varint": {:hex, :varint, "1.2.0", "61bffd9dcc2d5242d59f75694506b4d4013bb103f6a23e34b94f89cebb0c1ab3", [:mix], [], "hexpm", "d94941ed8b9d1a5fdede9103a5e52035bd0aaf35081d44e67713a36799927e47"}, - "xandra": {:hex, :xandra, "0.14.0", "42d674926b12c8638e548db7263e7efb4ee89fb8aa49a6f27a2eef8c9290cbcc", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.7", [hex: :decimal, repo: "hexpm", optional: true]}, {:nimble_options, "~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}], "hexpm", "f1e918b5f933d3cc3809ecb36d52c10a9595a6c2b0504b0ceb7e3fc58a2697d6"}, + "xandra": {:hex, :xandra, "0.19.1", "3041768e92874d850f65905669fb39a9482e4b68059351efc09ddc881f1e0baa", [:mix], [{:decimal, "~> 1.7 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}, {:nimble_options, "~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f47cef0597ff04baf1416dc3c4906c6edb04f19f7081a523f8eee1d3b69a4323"}, } diff --git a/test/support/bad_migrations/20231022122557_add_posts_table.exs b/test/support/bad_migrations/20231022122557_add_posts_table.exs deleted file mode 100644 index 0b72468..0000000 --- a/test/support/bad_migrations/20231022122557_add_posts_table.exs +++ /dev/null @@ -1,12 +0,0 @@ -defmodule Testcontainers.Repo.Migrations.AddPostsTable do - use Ecto.Migration - - def change do - create table(:users) do - add(:email, :stringa, null: false) - add(:hashed_password, :string, null: false) - add(:confirmed_at, :naive_datetime) - timestamps() - end - end -end diff --git a/test/support/migrations/20231022122557_add_posts_table.exs b/test/support/migrations/20231022122557_add_posts_table.exs deleted file mode 100644 index e77c4aa..0000000 --- a/test/support/migrations/20231022122557_add_posts_table.exs +++ /dev/null @@ -1,12 +0,0 @@ -defmodule Testcontainers.Repo.Migrations.AddPostsTable do - use Ecto.Migration - - def change do - create table(:users) do - add(:email, :string, null: false) - add(:hashed_password, :string, null: false) - add(:confirmed_at, :naive_datetime) - timestamps() - end - end -end diff --git a/test/support/mysql_repo.ex b/test/support/mysql_repo.ex deleted file mode 100644 index fd0dac7..0000000 --- a/test/support/mysql_repo.ex +++ /dev/null @@ -1,5 +0,0 @@ -defmodule Testcontainers.MysqlRepo do - use Ecto.Repo, - otp_app: :testcontainers, - adapter: Ecto.Adapters.MyXQL -end diff --git a/test/support/postgres_repo.ex b/test/support/postgres_repo.ex deleted file mode 100644 index c06dd05..0000000 --- a/test/support/postgres_repo.ex +++ /dev/null @@ -1,5 +0,0 @@ -defmodule Testcontainers.PostgresRepo do - use Ecto.Repo, - otp_app: :testcontainers, - adapter: Ecto.Adapters.Postgres -end diff --git a/test/support/test_user.ex b/test/support/test_user.ex deleted file mode 100644 index 7139903..0000000 --- a/test/support/test_user.ex +++ /dev/null @@ -1,12 +0,0 @@ -defmodule Testcontainers.TestUser do - use Ecto.Schema - - schema "users" do - field(:email, :string) - field(:password, :string, virtual: true, redact: true) - field(:hashed_password, :string, redact: true) - field(:confirmed_at, :naive_datetime) - - timestamps() - end -end