From 88bee6ecadcb9fa681e72f15452cf679114a40a9 Mon Sep 17 00:00:00 2001 From: "nicholas.goodwin" Date: Wed, 10 May 2023 14:20:36 -0500 Subject: [PATCH 1/6] version upgrade --- .github/workflows/divo.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- README.md | 6 +++--- config/config.exs | 2 +- config/dev.exs | 2 +- config/test.exs | 2 +- mix.exs | 4 ++-- mix.lock | 30 +++++++++++++++--------------- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/divo.yml b/.github/workflows/divo.yml index 383707f..dc8c5c1 100644 --- a/.github/workflows/divo.yml +++ b/.github/workflows/divo.yml @@ -18,8 +18,8 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-elixir@v1.5.0 with: - otp-version: 21.3 - elixir-version: 1.10.4 + otp-version: 25 + elixir-version: 1.14.4 experimental-otp: true - name: Get dependencies run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ad407a..74dea97 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,8 +11,8 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-elixir@v1.5.0 with: - otp-version: 21.3 - elixir-version: 1.10.4 + otp-version: 25 + elixir-version: 1.14.4 experimental-otp: true - name: Get dependencies run: | diff --git a/README.md b/README.md index 765df02..6b83556 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The package can be installed by adding `divo` to your list of dependencies in `m ```elixir def deps() do [ - {:divo, "~> 1.3.1", only: [:dev, :integration]} + {:divo, "~> 2.0.0", only: [:dev, :integration]} ] end ``` @@ -56,8 +56,8 @@ In your mix file, include the additional dependency #mix.exs def deps() do [ - {:divo, "~> 1.3.1", only: [:dev, :integration]}, - {:divo_redis, "~> 0.1.0", only: [:dev, :integration]} + {:divo, "~> 2.0.0", only: [:dev, :integration]}, + {:divo_redis, "~> 1.0.0", only: [:dev, :integration]} ] ``` And in your config, include the imported dependency module(s) as a list of tuples along with any environment variables the stack takes as a keyword list diff --git a/config/config.exs b/config/config.exs index 8233fe9..871a3d1 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,3 +1,3 @@ -use Mix.Config +import Config import_config "#{Mix.env()}.exs" diff --git a/config/dev.exs b/config/dev.exs index 82ce7b9..824e067 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -1,4 +1,4 @@ -use Mix.Config +import Config config :divo, divo: %{ diff --git a/config/test.exs b/config/test.exs index 9f4ede6..38e6d14 100644 --- a/config/test.exs +++ b/config/test.exs @@ -1,4 +1,4 @@ -use Mix.Config +import Config config :divo, divo: %{ diff --git a/mix.exs b/mix.exs index 0e150aa..494cf3e 100644 --- a/mix.exs +++ b/mix.exs @@ -4,8 +4,8 @@ defmodule Divo.MixProject do def project do [ app: :divo, - version: "1.3.2", - elixir: "~> 1.8", + version: "2.0.0", + elixir: "~> 1.14.4", start_permanent: Mix.env() == :prod, deps: deps(), package: package(), diff --git a/mix.lock b/mix.lock index 1097f93..0f5cb02 100644 --- a/mix.lock +++ b/mix.lock @@ -1,17 +1,17 @@ %{ - "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"}, - "credo": {:hex, :credo, "1.4.0", "92339d4cbadd1e88b5ee43d427b639b68a11071b6f73854e33638e30a0ea11f5", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, - "dialyxir": {:hex, :dialyxir, "1.0.0", "6a1fa629f7881a9f5aaf3a78f094b2a51a0357c843871b8bc98824e7342d00a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm"}, - "earmark": {:hex, :earmark, "1.4.4", "4821b8d05cda507189d51f2caeef370cf1e18ca5d7dfb7d31e9cafe6688106a4", [:mix], [], "hexpm"}, - "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm"}, - "ex_doc": {:hex, :ex_doc, "0.22.1", "9bb6d51508778193a4ea90fa16eac47f8b67934f33f8271d5e1edec2dc0eee4c", [:mix], [{:earmark, "~> 1.4.0", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"}, - "husky": {:hex, :husky, "1.0.3", "960fd2c74214ba3640693ff89fff39abf0a271c4ff42659e6eb8ffbc26f33927", [:mix], [{:poison, ">= 1.2.1", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm"}, - "jason": {:hex, :jason, "1.2.1", "12b22825e22f468c02eb3e4b9985f3d0cb8dc40b9bd704730efa11abd2708c44", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, - "makeup": {:hex, :makeup, "1.0.1", "82f332e461dc6c79dbd82fbe2a9c10d48ed07146f0a478286e590c83c52010b5", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.14.0", "cf8b7c66ad1cff4c14679698d532f0b5d45a3968ffbcbfd590339cb57742f1ae", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm"}, - "meck": {:hex, :meck, "0.8.13", "ffedb39f99b0b99703b8601c6f17c7f76313ee12de6b646e671e3188401f7866", [:rebar3], [], "hexpm"}, - "nimble_parsec": {:hex, :nimble_parsec, "0.5.3", "def21c10a9ed70ce22754fdeea0810dafd53c2db3219a0cd54cf5526377af1c6", [:mix], [], "hexpm"}, - "patiently": {:hex, :patiently, "0.2.0", "67eb139591e10c4b363ae0198e832552f191c58894731efd3bf124ec4722267a", [:mix], [], "hexpm"}, - "placebo": {:hex, :placebo, "1.2.2", "a3d47906b01844bfd04ab0351a605620619fdb8f011225e406696f96a88ff380", [:mix], [{:meck, "~> 0.8.13", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm"}, - "temporary_env": {:hex, :temporary_env, "2.0.1", "d4b5e031837e5619485e1f23af7cba7e897b8fd546eaaa8b10c812d642ec4546", [:mix], [], "hexpm"}, + "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"}, + "credo": {:hex, :credo, "1.4.0", "92339d4cbadd1e88b5ee43d427b639b68a11071b6f73854e33638e30a0ea11f5", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "1fd3b70dce216574ce3c18bdf510b57e7c4c85c2ec9cad4bff854abaf7e58658"}, + "dialyxir": {:hex, :dialyxir, "1.0.0", "6a1fa629f7881a9f5aaf3a78f094b2a51a0357c843871b8bc98824e7342d00a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "aeb06588145fac14ca08d8061a142d52753dbc2cf7f0d00fc1013f53f8654654"}, + "earmark": {:hex, :earmark, "1.4.4", "4821b8d05cda507189d51f2caeef370cf1e18ca5d7dfb7d31e9cafe6688106a4", [:mix], [], "hexpm", "1f93aba7340574847c0f609da787f0d79efcab51b044bb6e242cae5aca9d264d"}, + "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, + "ex_doc": {:hex, :ex_doc, "0.22.1", "9bb6d51508778193a4ea90fa16eac47f8b67934f33f8271d5e1edec2dc0eee4c", [:mix], [{:earmark, "~> 1.4.0", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "d957de1b75cb9f78d3ee17820733dc4460114d8b1e11f7ee4fd6546e69b1db60"}, + "husky": {:hex, :husky, "1.0.3", "960fd2c74214ba3640693ff89fff39abf0a271c4ff42659e6eb8ffbc26f33927", [:mix], [{:poison, ">= 1.2.1", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm", "17a8b051d7eb2d8fba80de49b2da73be243532a9af5db2c943a8faf1b65fb86b"}, + "jason": {:hex, :jason, "1.2.1", "12b22825e22f468c02eb3e4b9985f3d0cb8dc40b9bd704730efa11abd2708c44", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "b659b8571deedf60f79c5a608e15414085fa141344e2716fbd6988a084b5f993"}, + "makeup": {:hex, :makeup, "1.0.1", "82f332e461dc6c79dbd82fbe2a9c10d48ed07146f0a478286e590c83c52010b5", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "49736fe5b66a08d8575bf5321d716bac5da20c8e6b97714fec2bcd6febcfa1f8"}, + "makeup_elixir": {:hex, :makeup_elixir, "0.14.0", "cf8b7c66ad1cff4c14679698d532f0b5d45a3968ffbcbfd590339cb57742f1ae", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "d4b316c7222a85bbaa2fd7c6e90e37e953257ad196dc229505137c5e505e9eff"}, + "meck": {:hex, :meck, "0.8.13", "ffedb39f99b0b99703b8601c6f17c7f76313ee12de6b646e671e3188401f7866", [:rebar3], [], "hexpm", "d34f013c156db51ad57cc556891b9720e6a1c1df5fe2e15af999c84d6cebeb1a"}, + "nimble_parsec": {:hex, :nimble_parsec, "0.5.3", "def21c10a9ed70ce22754fdeea0810dafd53c2db3219a0cd54cf5526377af1c6", [:mix], [], "hexpm", "589b5af56f4afca65217a1f3eb3fee7e79b09c40c742fddc1c312b3ac0b3399f"}, + "patiently": {:hex, :patiently, "0.2.0", "67eb139591e10c4b363ae0198e832552f191c58894731efd3bf124ec4722267a", [:mix], [], "hexpm", "c08cc5edc27def565647a9b55a0bea8025a5f81a4472e57692f28f2292c44c94"}, + "placebo": {:hex, :placebo, "1.2.2", "a3d47906b01844bfd04ab0351a605620619fdb8f011225e406696f96a88ff380", [:mix], [{:meck, "~> 0.8.13", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm", "ba29f0f3e3c5045bb7ba769db907fcedb179c95d9a334cb8ff17332965a459ca"}, + "temporary_env": {:hex, :temporary_env, "2.0.1", "d4b5e031837e5619485e1f23af7cba7e897b8fd546eaaa8b10c812d642ec4546", [:mix], [], "hexpm", "f9420044742b5f0479a7f8243e86b048b6a2d4878bce026a3615065b11199c27"}, } From 6b432f2e1baefc9e0756f852313f46ba96a5a902 Mon Sep 17 00:00:00 2001 From: "nicholas.goodwin" Date: Wed, 10 May 2023 14:43:24 -0500 Subject: [PATCH 2/6] dockerfile and dep version bump --- Dockerfile | 2 +- mix.exs | 8 ++++---- mix.lock | 23 +++++++++++++---------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9be2af4..815ced9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM bitwalker/alpine-elixir:1.8.1 +FROM bitwalker/alpine-elixir:1.14.4 COPY . /app WORKDIR /app RUN mix local.hex --force \ diff --git a/mix.exs b/mix.exs index 494cf3e..ac0c1cd 100644 --- a/mix.exs +++ b/mix.exs @@ -28,11 +28,11 @@ defmodule Divo.MixProject do [ {:jason, "~> 1.1"}, {:patiently, "~> 0.2"}, - {:placebo, "~> 1.2", only: :test}, + {:placebo, "~> 2.0", only: :test}, {:temporary_env, "~> 2.0", only: :test}, - {:credo, "~> 1.1", only: :dev, runtime: false}, - {:dialyxir, "~> 1.0.0-rc.6", only: :dev, runtime: false}, - {:ex_doc, "~> 0.19", only: :dev, runtime: false}, + {:credo, "~> 1.7", only: :dev, runtime: false}, + {:dialyxir, "~> 1.3", only: :dev, runtime: false}, + {:ex_doc, "~> 0.29", only: :dev, runtime: false}, {:husky, "~> 1.0", only: :dev, runtime: false} ] end diff --git a/mix.lock b/mix.lock index 0f5cb02..507a745 100644 --- a/mix.lock +++ b/mix.lock @@ -1,17 +1,20 @@ %{ - "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"}, - "credo": {:hex, :credo, "1.4.0", "92339d4cbadd1e88b5ee43d427b639b68a11071b6f73854e33638e30a0ea11f5", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "1fd3b70dce216574ce3c18bdf510b57e7c4c85c2ec9cad4bff854abaf7e58658"}, - "dialyxir": {:hex, :dialyxir, "1.0.0", "6a1fa629f7881a9f5aaf3a78f094b2a51a0357c843871b8bc98824e7342d00a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "aeb06588145fac14ca08d8061a142d52753dbc2cf7f0d00fc1013f53f8654654"}, + "bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"}, + "credo": {:hex, :credo, "1.7.0", "6119bee47272e85995598ee04f2ebbed3e947678dee048d10b5feca139435f75", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "6839fcf63d1f0d1c0f450abc8564a57c43d644077ab96f2934563e68b8a769d7"}, + "dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"}, "earmark": {:hex, :earmark, "1.4.4", "4821b8d05cda507189d51f2caeef370cf1e18ca5d7dfb7d31e9cafe6688106a4", [:mix], [], "hexpm", "1f93aba7340574847c0f609da787f0d79efcab51b044bb6e242cae5aca9d264d"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.32", "fa739a0ecfa34493de19426681b23f6814573faee95dfd4b4aafe15a7b5b32c6", [:mix], [], "hexpm", "b8b0dd77d60373e77a3d7e8afa598f325e49e8663a51bcc2b88ef41838cca755"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, - "ex_doc": {:hex, :ex_doc, "0.22.1", "9bb6d51508778193a4ea90fa16eac47f8b67934f33f8271d5e1edec2dc0eee4c", [:mix], [{:earmark, "~> 1.4.0", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "d957de1b75cb9f78d3ee17820733dc4460114d8b1e11f7ee4fd6546e69b1db60"}, + "ex_doc": {:hex, :ex_doc, "0.29.4", "6257ecbb20c7396b1fe5accd55b7b0d23f44b6aa18017b415cb4c2b91d997729", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "2c6699a737ae46cb61e4ed012af931b57b699643b24dabe2400a8168414bc4f5"}, + "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, "husky": {:hex, :husky, "1.0.3", "960fd2c74214ba3640693ff89fff39abf0a271c4ff42659e6eb8ffbc26f33927", [:mix], [{:poison, ">= 1.2.1", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm", "17a8b051d7eb2d8fba80de49b2da73be243532a9af5db2c943a8faf1b65fb86b"}, - "jason": {:hex, :jason, "1.2.1", "12b22825e22f468c02eb3e4b9985f3d0cb8dc40b9bd704730efa11abd2708c44", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "b659b8571deedf60f79c5a608e15414085fa141344e2716fbd6988a084b5f993"}, - "makeup": {:hex, :makeup, "1.0.1", "82f332e461dc6c79dbd82fbe2a9c10d48ed07146f0a478286e590c83c52010b5", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "49736fe5b66a08d8575bf5321d716bac5da20c8e6b97714fec2bcd6febcfa1f8"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.14.0", "cf8b7c66ad1cff4c14679698d532f0b5d45a3968ffbcbfd590339cb57742f1ae", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "d4b316c7222a85bbaa2fd7c6e90e37e953257ad196dc229505137c5e505e9eff"}, - "meck": {:hex, :meck, "0.8.13", "ffedb39f99b0b99703b8601c6f17c7f76313ee12de6b646e671e3188401f7866", [:rebar3], [], "hexpm", "d34f013c156db51ad57cc556891b9720e6a1c1df5fe2e15af999c84d6cebeb1a"}, - "nimble_parsec": {:hex, :nimble_parsec, "0.5.3", "def21c10a9ed70ce22754fdeea0810dafd53c2db3219a0cd54cf5526377af1c6", [:mix], [], "hexpm", "589b5af56f4afca65217a1f3eb3fee7e79b09c40c742fddc1c312b3ac0b3399f"}, + "jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"}, + "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, + "makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"}, + "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, + "meck": {:hex, :meck, "0.9.2", "85ccbab053f1db86c7ca240e9fc718170ee5bda03810a6292b5306bf31bae5f5", [:rebar3], [], "hexpm", "81344f561357dc40a8344afa53767c32669153355b626ea9fcbc8da6b3045826"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.3.1", "2c54013ecf170e249e9291ed0a62e5832f70a476c61da16f6aac6dca0189f2af", [:mix], [], "hexpm", "2682e3c0b2eb58d90c6375fc0cc30bc7be06f365bf72608804fb9cffa5e1b167"}, "patiently": {:hex, :patiently, "0.2.0", "67eb139591e10c4b363ae0198e832552f191c58894731efd3bf124ec4722267a", [:mix], [], "hexpm", "c08cc5edc27def565647a9b55a0bea8025a5f81a4472e57692f28f2292c44c94"}, - "placebo": {:hex, :placebo, "1.2.2", "a3d47906b01844bfd04ab0351a605620619fdb8f011225e406696f96a88ff380", [:mix], [{:meck, "~> 0.8.13", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm", "ba29f0f3e3c5045bb7ba769db907fcedb179c95d9a334cb8ff17332965a459ca"}, + "placebo": {:hex, :placebo, "2.0.0", "c0e773dec77e941bcbcc14d10b759f2d66775aff9b75051f3e41939b64300e81", [:mix], [{:meck, "~> 0.9", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm", "e0872cec8848d7e59ba96396f45ee1ad34662c689c86ba6190694d38b4289844"}, "temporary_env": {:hex, :temporary_env, "2.0.1", "d4b5e031837e5619485e1f23af7cba7e897b8fd546eaaa8b10c812d642ec4546", [:mix], [], "hexpm", "f9420044742b5f0479a7f8243e86b048b6a2d4878bce026a3615065b11199c27"}, } From 761b6227e328fe4f5f54d23e00a4cf777be8a5e1 Mon Sep 17 00:00:00 2001 From: "nicholas.goodwin" Date: Mon, 15 May 2023 13:54:19 -0500 Subject: [PATCH 3/6] test --- Dockerfile | 2 +- config/config.exs | 2 +- config/dev.exs | 48 +++++++++++++++++++++++------------------------ config/test.exs | 2 +- mix.exs | 5 ++--- 5 files changed, 29 insertions(+), 30 deletions(-) diff --git a/Dockerfile b/Dockerfile index 815ced9..4552354 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM bitwalker/alpine-elixir:1.14.4 +FROM bitwalker/alpine-elixir:1.14 COPY . /app WORKDIR /app RUN mix local.hex --force \ diff --git a/config/config.exs b/config/config.exs index 871a3d1..8233fe9 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,3 +1,3 @@ -import Config +use Mix.Config import_config "#{Mix.env()}.exs" diff --git a/config/dev.exs b/config/dev.exs index 824e067..4e37c45 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -1,26 +1,26 @@ -import Config +# use Mix.Config -config :divo, - divo: %{ - version: "3.4", - services: %{ - redis: %{ - image: "redis:5.0.3", - command: ["redis", "start", "--foreground"], - ports: ["2181:2181"], - volumes: ["/tmp:/opt/redis"] - }, - kafka: %{ - image: "wurstmeister/kafka", - depends_on: ["zookeeper"], - ports: ["9094:9094"], - environment: [ - "VAL1=foo", - "VAL2=bar" - ] - } - } - } +# config :divo, +# divo: %{ +# version: "3.4", +# services: %{ +# redis: %{ +# image: "redis:5.0.3", +# command: ["redis", "start", "--foreground"], +# ports: ["2181:2181"], +# volumes: ["/tmp:/opt/redis"] +# }, +# kafka: %{ +# image: "wurstmeister/kafka", +# depends_on: ["zookeeper"], +# ports: ["9094:9094"], +# environment: [ +# "VAL1=foo", +# "VAL2=bar" +# ] +# } +# } +# } -config :husky, - pre_commit: "./scripts/git_pre_commit_hook.sh" +# config :husky, +# pre_commit: "./scripts/git_pre_commit_hook.sh" diff --git a/config/test.exs b/config/test.exs index 38e6d14..9f4ede6 100644 --- a/config/test.exs +++ b/config/test.exs @@ -1,4 +1,4 @@ -import Config +use Mix.Config config :divo, divo: %{ diff --git a/mix.exs b/mix.exs index ac0c1cd..16be5d6 100644 --- a/mix.exs +++ b/mix.exs @@ -26,14 +26,13 @@ defmodule Divo.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do [ - {:jason, "~> 1.1"}, + {:jason, "~> 1.4"}, {:patiently, "~> 0.2"}, {:placebo, "~> 2.0", only: :test}, {:temporary_env, "~> 2.0", only: :test}, {:credo, "~> 1.7", only: :dev, runtime: false}, {:dialyxir, "~> 1.3", only: :dev, runtime: false}, - {:ex_doc, "~> 0.29", only: :dev, runtime: false}, - {:husky, "~> 1.0", only: :dev, runtime: false} + {:ex_doc, "~> 0.29", only: :dev, runtime: false} ] end From 4a45dad7d3fce1902d0a52f871cceb5b96239a88 Mon Sep 17 00:00:00 2001 From: "nicholas.goodwin" Date: Mon, 15 May 2023 14:01:51 -0500 Subject: [PATCH 4/6] updated workflow --- .github/workflows/divo.yml | 6 ++--- .github/workflows/release.yml | 6 ++--- config/dev.exs | 47 ++++++++++++++++------------------- 3 files changed, 28 insertions(+), 31 deletions(-) diff --git a/.github/workflows/divo.yml b/.github/workflows/divo.yml index dc8c5c1..b5f6f8b 100644 --- a/.github/workflows/divo.yml +++ b/.github/workflows/divo.yml @@ -16,11 +16,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-elixir@v1.5.0 + - uses: erlef/setup-beam@v1 with: - otp-version: 25 + otp-version: 25.3.2 + version-type: strict elixir-version: 1.14.4 - experimental-otp: true - name: Get dependencies run: | bash scripts/gh-action-get-deps.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 74dea97..5bdea37 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,11 +9,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-elixir@v1.5.0 + - uses: erlef/setup-beam@v1 with: - otp-version: 25 + otp-version: 25.3.2 + version-type: strict elixir-version: 1.14.4 - experimental-otp: true - name: Get dependencies run: | bash scripts/gh-action-get-deps.sh diff --git a/config/dev.exs b/config/dev.exs index 4e37c45..6597213 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -1,26 +1,23 @@ -# use Mix.Config +use Mix.Config -# config :divo, -# divo: %{ -# version: "3.4", -# services: %{ -# redis: %{ -# image: "redis:5.0.3", -# command: ["redis", "start", "--foreground"], -# ports: ["2181:2181"], -# volumes: ["/tmp:/opt/redis"] -# }, -# kafka: %{ -# image: "wurstmeister/kafka", -# depends_on: ["zookeeper"], -# ports: ["9094:9094"], -# environment: [ -# "VAL1=foo", -# "VAL2=bar" -# ] -# } -# } -# } - -# config :husky, -# pre_commit: "./scripts/git_pre_commit_hook.sh" +config :divo, + divo: %{ + version: "3.4", + services: %{ + redis: %{ + image: "redis:5.0.3", + command: ["redis", "start", "--foreground"], + ports: ["2181:2181"], + volumes: ["/tmp:/opt/redis"] + }, + kafka: %{ + image: "wurstmeister/kafka", + depends_on: ["zookeeper"], + ports: ["9094:9094"], + environment: [ + "VAL1=foo", + "VAL2=bar" + ] + } + } + } From b8c89bef09277531340b1442e510a06b2f64770b Mon Sep 17 00:00:00 2001 From: "nicholas.goodwin" Date: Mon, 15 May 2023 15:42:18 -0500 Subject: [PATCH 5/6] update versions again and replaced Placebo with Mock --- Dockerfile | 2 +- mix.exs | 2 +- mix.lock | 1 + test/compose_test.exs | 45 ++++++++++++++++++----------------- test/file_test.exs | 55 +++++++++++++++++++++++-------------------- 5 files changed, 56 insertions(+), 49 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4552354..f685a76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM bitwalker/alpine-elixir:1.14 +FROM hexpm/elixir:1.14.4-erlang-25.3.2 COPY . /app WORKDIR /app RUN mix local.hex --force \ diff --git a/mix.exs b/mix.exs index 16be5d6..0989b92 100644 --- a/mix.exs +++ b/mix.exs @@ -28,7 +28,7 @@ defmodule Divo.MixProject do [ {:jason, "~> 1.4"}, {:patiently, "~> 0.2"}, - {:placebo, "~> 2.0", only: :test}, + {:mock, "~> 0.3", only: :test}, {:temporary_env, "~> 2.0", only: :test}, {:credo, "~> 1.7", only: :dev, runtime: false}, {:dialyxir, "~> 1.3", only: :dev, runtime: false}, diff --git a/mix.lock b/mix.lock index 507a745..5cb8286 100644 --- a/mix.lock +++ b/mix.lock @@ -13,6 +13,7 @@ "makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"}, "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, "meck": {:hex, :meck, "0.9.2", "85ccbab053f1db86c7ca240e9fc718170ee5bda03810a6292b5306bf31bae5f5", [:rebar3], [], "hexpm", "81344f561357dc40a8344afa53767c32669153355b626ea9fcbc8da6b3045826"}, + "mock": {:hex, :mock, "0.3.7", "75b3bbf1466d7e486ea2052a73c6e062c6256fb429d6797999ab02fa32f29e03", [:mix], [{:meck, "~> 0.9.2", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm", "4da49a4609e41fd99b7836945c26f373623ea968cfb6282742bcb94440cf7e5c"}, "nimble_parsec": {:hex, :nimble_parsec, "1.3.1", "2c54013ecf170e249e9291ed0a62e5832f70a476c61da16f6aac6dca0189f2af", [:mix], [], "hexpm", "2682e3c0b2eb58d90c6375fc0cc30bc7be06f365bf72608804fb9cffa5e1b167"}, "patiently": {:hex, :patiently, "0.2.0", "67eb139591e10c4b363ae0198e832552f191c58894731efd3bf124ec4722267a", [:mix], [], "hexpm", "c08cc5edc27def565647a9b55a0bea8025a5f81a4472e57692f28f2292c44c94"}, "placebo": {:hex, :placebo, "2.0.0", "c0e773dec77e941bcbcc14d10b759f2d66775aff9b75051f3e41939b64300e81", [:mix], [{:meck, "~> 0.9", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm", "e0872cec8848d7e59ba96396f45ee1ad34662c689c86ba6190694d38b4289844"}, diff --git a/test/compose_test.exs b/test/compose_test.exs index 704b8b4..aadfc3e 100644 --- a/test/compose_test.exs +++ b/test/compose_test.exs @@ -1,20 +1,21 @@ defmodule Divo.ComposeTest do - use ExUnit.Case - use Placebo - - setup do - allow(System.cmd(any(), any()), meck_options: [:passthrough]) - allow(System.get_env(any()), return: "/tmp") - allow(System.cmd(any(), any(), any()), return: {"", 0}) - :ok + use ExUnit.Case, async: false + + import Mock + + setup_with_mocks([ + {System, [:passthrough], [cmd: fn(_, _) -> {"", 0} end]}, + {System, [], [cmd: fn(_, _, _) -> {"", 0} end]}, + {System, [], [get_env: fn(_) -> "/tmp" end]} + ]) do + {:ok, foo: "bar"} end test "docker run command called with expected arguments" do Divo.Compose.run() assert_called( - System.cmd("docker-compose", ["--file", "/tmp/divo.compose", "up", "--detach"], stderr_to_stdout: true), - once() + System.cmd("docker-compose", ["--file", "/tmp/divo.compose", "up", "--detach"], stderr_to_stdout: true) ) end @@ -23,14 +24,16 @@ defmodule Divo.ComposeTest do error_message = "Failed to get authorization token: NoCredentialProviders: no valid providers in chain. Deprecated." - allow(Divo.Validate.validate(any()), return: :ok) - - allow(System.cmd(any(), any(), any()), - return: {error_message, 1} - ) - - assert_raise RuntimeError, "Docker Compose exited with code: 1. " <> error_message, fn -> - Divo.Compose.run() + with_mocks( + [ + {Divo.Validate, [], [validate: fn(_) -> :ok end]}, + {System, [], [cmd: fn(_, _, _) -> {error_message, 1} end]}, + {System, [], [get_env: fn(_) -> "/tmp" end]} + ] + ) do + assert_raise RuntimeError, "Docker Compose exited with code: 1. " <> error_message, fn -> + Divo.Compose.run() + end end end @@ -38,8 +41,7 @@ defmodule Divo.ComposeTest do :ok = Divo.Compose.stop() assert_called( - System.cmd("docker-compose", ["--file", "/tmp/divo.compose", "stop"], stderr_to_stdout: true), - once() + System.cmd("docker-compose", ["--file", "/tmp/divo.compose", "stop"], stderr_to_stdout: true) ) end @@ -47,8 +49,7 @@ defmodule Divo.ComposeTest do :ok = Divo.Compose.kill() assert_called( - System.cmd("docker-compose", ["--file", "/tmp/divo.compose", "down"], stderr_to_stdout: true), - once() + System.cmd("docker-compose", ["--file", "/tmp/divo.compose", "down"], stderr_to_stdout: true) ) end end diff --git a/test/file_test.exs b/test/file_test.exs index 7073adc..918dc2c 100644 --- a/test/file_test.exs +++ b/test/file_test.exs @@ -1,18 +1,20 @@ defmodule Divo.FileTest do use ExUnit.Case - use Placebo + + import Mock + require TemporaryEnv test "correctly determines the filename" do - allow(System.get_env("TMPDIR"), return: "/var/tmp/foo") - - assert Divo.File.file_name() == "/var/tmp/foo/divo.compose" + with_mock(System, [], [get_env: fn ("TMPDIR") -> "/var/tmp/foo" end]) do + assert Divo.File.file_name() == "/var/tmp/foo/divo.compose" + end end test "correctly defaults the filename" do - allow(System.get_env("TMPDIR"), return: nil) - - assert Divo.File.file_name() == "/tmp/divo.compose" + with_mock(System, [], [get_env: fn ("TMPDIR") -> nil end]) do + assert Divo.File.file_name() == "/tmp/divo.compose" + end end test "uses existing compose file" do @@ -23,31 +25,33 @@ defmodule Divo.FileTest do end end - test "generates compose file from app config" do - allow(File.write!(any(), any()), return: :ok) - allow(System.get_env("TMPDIR"), return: "/var/tmp/foo") - config = Divo.Helper.fetch_config() + describe "generate" do + setup_with_mocks([ + {System, [], [get_env: fn ("TMPDIR") -> "/var/tmp/foo" end]}, + {File, [], [write!: fn (_, _) -> :ok end]}, + {DivoFoobar, [:non_strict], [gen_stack: fn(_) -> %{} end]}, + {DivoBarbaz, [:non_strict], [gen_stack: fn(_) -> %{} end]} + ]) do + {:ok, foo: "bar"} + end - assert Divo.File.ensure_file(config) == "/var/tmp/foo/divo.compose" - end + test "generates compose file from app config" do + config = Divo.Helper.fetch_config() - test "generates compose file from a behaviour implementation of a single service" do - allow(File.write!(any(), any()), return: :ok) - allow(System.get_env("TMPDIR"), return: "/var/tmp/bar") + assert Divo.File.ensure_file(config) == "/var/tmp/foo/divo.compose" + end - services = [{DivoFoobar, [db_password: "we-are-divo", db_name: "foobar-db", something: "else"]}] + test "generates compose file from a behaviour implementation of a single service" do + services = [{DivoFoobar, [db_password: "we-are-divo", db_name: "foobar-db", something: "else"]}] - TemporaryEnv.put :divo, :divo, services do - config = Divo.Helper.fetch_config() + TemporaryEnv.put :divo, :divo, services do + config = Divo.Helper.fetch_config() - assert Divo.File.ensure_file(config) == "/var/tmp/bar/divo.compose" + assert Divo.File.ensure_file(config) == "/var/tmp/foo/divo.compose" + end end - end test "concatenates compose file from multiple implementations of the behaviour" do - allow(File.write!(any(), any()), return: :ok) - allow(System.get_env("TMPDIR"), return: "/var/tmp/bar") - services = [ {DivoFoobar, [db_password: "we-are-divo", db_name: "foobar-db", something: "else"]}, DivoBarbaz @@ -56,7 +60,8 @@ defmodule Divo.FileTest do TemporaryEnv.put :divo, :divo, services do config = Divo.Helper.fetch_config() - assert Divo.File.ensure_file(config) == "/var/tmp/bar/divo.compose" + assert Divo.File.ensure_file(config) == "/var/tmp/foo/divo.compose" end end + end end From 69ff17287a31eccf15afe9d6c7bcb84d6f83e20b Mon Sep 17 00:00:00 2001 From: "nicholas.goodwin" Date: Mon, 15 May 2023 15:53:47 -0500 Subject: [PATCH 6/6] removed elixir warnings --- config/config.exs | 2 +- config/dev.exs | 2 +- config/test.exs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/config.exs b/config/config.exs index 8233fe9..871a3d1 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,3 +1,3 @@ -use Mix.Config +import Config import_config "#{Mix.env()}.exs" diff --git a/config/dev.exs b/config/dev.exs index 6597213..f8fe76c 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -1,4 +1,4 @@ -use Mix.Config +import Config config :divo, divo: %{ diff --git a/config/test.exs b/config/test.exs index 9f4ede6..38e6d14 100644 --- a/config/test.exs +++ b/config/test.exs @@ -1,4 +1,4 @@ -use Mix.Config +import Config config :divo, divo: %{