From 1ebbe18457b2086349d142350a7bea53ae23b00c Mon Sep 17 00:00:00 2001 From: "nicholas.goodwin" Date: Tue, 6 Jun 2023 09:54:18 -0500 Subject: [PATCH] full version bump --- .github/workflows/main.yml | 21 ++++---- .github/workflows/master.yml | 7 +-- .github/workflows/release.yml | 7 +-- README.md | 2 +- config/config.exs | 4 +- config/dev.exs | 2 +- config/integration.exs | 2 +- config/test.exs | 2 +- mix.exs | 24 ++++----- mix.lock | 51 ++++++++++--------- .../off_broadway/kafka/acknowledger_test.exs | 22 ++++---- .../unit/off_broadway/kafka/producer_test.exs | 14 ++--- 12 files changed, 84 insertions(+), 74 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e5bbd61..aac39cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,10 +9,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-elixir@v1.2.0 + - uses: erlef/setup-beam@v1 with: - otp-version: 21.3 - elixir-version: 1.8.2 + otp-version: 25.3.2 + version-type: strict + elixir-version: 1.14.4 - name: Get depedencies run: | mix local.rebar --force @@ -26,10 +27,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-elixir@v1.2.0 + - uses: erlef/setup-beam@v1 with: - otp-version: 21.3 - elixir-version: 1.8.2 + otp-version: 25.3.2 + version-type: strict + elixir-version: 1.14.4 - name: Get dependencies run: | mix local.rebar --force @@ -43,10 +45,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-elixir@v1.2.0 + - uses: erlef/setup-beam@v1 with: - otp-version: 21.3 - elixir-version: 1.8.2 + otp-version: 25.3.2 + version-type: strict + elixir-version: 1.14.4 - name: Retrieve cached PLT uses: actions/cache@v1 with: diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 4699fbf..e2cc869 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -9,10 +9,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-elixir@v1.2.0 + - uses: erlef/setup-beam@v1 with: - otp-version: 21.3 - elixir-version: 1.8.2 + otp-version: 25.3.2 + version-type: strict + elixir-version: 1.14.4 - name: Get dependencies run: | mix local.rebar --force diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f519b87..e739442 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,10 +8,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-elixir@v1.2.0 + - uses: erlef/setup-beam@v1 with: - otp-version: 21.3 - elixir-version: 1.8.2 + otp-version: 25.3.2 + version-type: strict + elixir-version: 1.14.4 - name: Build run: | mix local.rebar --force diff --git a/README.md b/README.md index c6aeb66..309aa89 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Add `off_broadway_kafka` to the list of dependencies in `mix.exs`: ```elixir def deps do [ - {:off_broadway_kafka, "~> 1.0"} + {:off_broadway_kafka, "~> 2.0"} ] end ``` diff --git a/config/config.exs b/config/config.exs index 2f4b176..7808941 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,6 +1,6 @@ # This file is responsible for configuring your application # and its dependencies with the aid of the Mix.Config module. -use Mix.Config +import Config # This configuration is loaded before any dependency and is restricted # to this project. If another project depends on this project, this @@ -27,4 +27,4 @@ use Mix.Config # 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 "#{config_env()}.exs" diff --git a/config/dev.exs b/config/dev.exs index d2d855e..becde76 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -1 +1 @@ -use Mix.Config +import Config diff --git a/config/integration.exs b/config/integration.exs index d439edc..ac0383d 100644 --- a/config/integration.exs +++ b/config/integration.exs @@ -1,4 +1,4 @@ -use Mix.Config +import Config config :off_broadway_kafka, divo: [ diff --git a/config/test.exs b/config/test.exs index d2d855e..becde76 100644 --- a/config/test.exs +++ b/config/test.exs @@ -1 +1 @@ -use Mix.Config +import Config diff --git a/mix.exs b/mix.exs index a2308e0..6346541 100644 --- a/mix.exs +++ b/mix.exs @@ -1,13 +1,13 @@ defmodule OffBroadwayKafka.MixProject do use Mix.Project - @github "https://github.com/bbalser/off_broadway_kafka" + @github "https://github.com/UrbanOS-Public/off_broadway_kafka" def project do [ app: :off_broadway_kafka, - version: "1.0.1", - elixir: "~> 1.8", + version: "2.0.0", + elixir: "~> 1.14", start_permanent: Mix.env() == :prod, deps: deps(), description: description(), @@ -29,23 +29,23 @@ defmodule OffBroadwayKafka.MixProject do defp deps do [ - {:elsa, "~> 0.12"}, - {:broadway, "~> 0.6"}, - {:retry, "~> 0.13"}, - {:placebo, "~> 1.2", only: [:dev, :test, :integration]}, - {:checkov, "~> 0.5", only: [:dev, :test, :integration]}, - {:divo, "~> 1.1", only: [:dev, :integration]}, - {:divo_kafka, "~> 0.1.6", only: [:dev, :integration]}, + {:elsa_kafka, "~> 2.0"}, + {:broadway, "~> 1.0"}, + {:retry, "~> 0.15"}, + {:mock, "~> 0.3", only: [:dev, :test, :integration]}, + {:checkov, "~> 1.0", only: [:dev, :test, :integration]}, + {:divo, "~> 2.0", only: [:dev, :integration]}, + {:divo_kafka, "~> 1.0", only: [:dev, :integration]}, {:patiently, "~> 0.2", only: [:test, :integration], override: true}, {:ex_doc, "~> 0.21", only: [:dev], runtime: false}, {:benchee, "~> 1.0", only: [:integration]}, - {:dialyxir, "~> 1.0.0-rc.7", only: [:dev], runtime: false} + {:dialyxir, "~> 1.3", only: [:dev], runtime: false} ] end defp package do [ - maintainers: ["Brian Balser", "Jeff Grunewald"], + maintainers: ["Smartcitiesdata"], licenses: ["Apache 2.0"], links: %{"GitHub" => @github} ] diff --git a/mix.lock b/mix.lock index 9526a11..19f640e 100644 --- a/mix.lock +++ b/mix.lock @@ -1,28 +1,31 @@ %{ - "benchee": {:hex, :benchee, "1.0.1", "66b211f9bfd84bd97e6d1beaddf8fc2312aaabe192f776e8931cb0c16f53a521", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}], "hexpm", "3ad58ae787e9c7c94dd7ceda3b587ec2c64604563e049b2a0e8baafae832addb"}, - "broadway": {:hex, :broadway, "0.6.0", "ef14ec31efd2044c1b280691a46e022dbfe557044da97414678e8ee996673746", [:mix], [{:gen_stage, "~> 1.0", [hex: :gen_stage, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d47c11b315d50bc15a712dbaf1e8ceba8a2ec4f50b53146192f40bb733ca051"}, - "brod": {:hex, :brod, "3.9.5", "b311cdb78a359fdea8998ad98ceefb3bfedfdb513a272993e2d150bc6a58108a", [:make, :rebar, :rebar3], [{:kafka_protocol, "2.3.3", [hex: :kafka_protocol, repo: "hexpm", optional: false]}, {:supervisor3, "1.1.8", [hex: :supervisor3, repo: "hexpm", optional: false]}], "hexpm", "b14727482de1d00529c36190979283fd7e90a5aa4a5bec91472406c47bacb2ee"}, - "checkov": {:hex, :checkov, "0.5.0", "68a5e118293775386ce98b58fe14bb29e659b22a7915d1a825dfa8dad503015c", [:mix], [], "hexpm", "f51d97dd6964ca0279ff12d5641ae1e99a8080bf3bf25b3b8370b9418b51c9b9"}, - "crc32cer": {:hex, :crc32cer, "0.1.3", "8984906c4b4fae6aa292c48f286a1c83b19ad44bd102287acb94d696015967ce", [:make, :rebar, :rebar3], [], "hexpm", "e35840bfd312192748bf177e92e85270e2bf0bbc01462da1f7afd4298edae4a7"}, + "benchee": {:hex, :benchee, "1.1.0", "f3a43817209a92a1fade36ef36b86e1052627fd8934a8b937ac9ab3a76c43062", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}], "hexpm", "7da57d545003165a012b587077f6ba90b89210fd88074ce3c60ce239eb5e6d93"}, + "broadway": {:hex, :broadway, "1.0.7", "7808f9e3eb6f53ca6d060f0f9d61012dd8feb0d7a82e62d087dd517b9b66fa53", [:mix], [{:gen_stage, "~> 1.0", [hex: :gen_stage, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.3.7 or ~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e76cfb0a7d64176c387b8b1ddbfb023e2ee8a63e92f43664d78e6d5d0b1177c6"}, + "brod": {:hex, :brod, "3.16.5", "c1ef9264bdc8d72e8f5b82234f1ad7f05c82f769851ed85393376a0d4b430812", [:rebar3], [{:kafka_protocol, "4.1.0", [hex: :kafka_protocol, repo: "hexpm", optional: false]}, {:snappyer, "1.2.8", [hex: :snappyer, repo: "hexpm", optional: false]}, {:supervisor3, "1.1.11", [hex: :supervisor3, repo: "hexpm", optional: false]}], "hexpm", "fad2d9c644ccdc6cda25dd96cee78376261f053e28ca0403f787338f4b20cc40"}, + "checkov": {:hex, :checkov, "1.0.0", "cecf1be22ea506b2fbd6741d7c00f4876bb2be76ea1b95493c25b51028f24410", [:mix], [], "hexpm", "9fa85e6fdf1bcec2dd0d996d0c1e5a83e336dafb97c931232af1cb1e7ef4420a"}, + "crc32cer": {:hex, :crc32cer, "0.1.8", "c6c2275c5fb60a95f4935d414f30b50ee9cfed494081c9b36ebb02edfc2f48db", [:rebar3], [], "hexpm", "251499085482920deb6c9b7aadabf9fb4c432f96add97ab42aee4501e5b6f591"}, "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, - "dialyxir": {:hex, :dialyxir, "1.0.0-rc.7", "6287f8f2cb45df8584317a4be1075b8c9b8a69de8eeb82b4d9e6c761cf2664cd", [:mix], [{:erlex, ">= 0.2.5", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "506294d6c543e4e5282d4852aead19ace8a35bedeb043f9256a06a6336827122"}, - "divo": {:hex, :divo, "1.1.9", "6f91b0a02bd97800eb9a99abd771b4c9b67d282b67abc223eb2832b93f557b7e", [:mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:patiently, "~> 0.2", [hex: :patiently, repo: "hexpm", optional: false]}], "hexpm", "b0edcd689089d723802c2d582bab54a77725f673445aa474eea259448910c252"}, - "divo_kafka": {:hex, :divo_kafka, "0.1.6", "dffaa5d419d75e6607b581187347e6fef18b9d06d517a0f7a49772b52f60115f", [:mix], [{:divo, "~> 1.1", [hex: :divo, repo: "hexpm", optional: false]}], "hexpm", "cbc408a8b6593784524b5fee09aae0e9cc58328a174fc6d3f337d9fb34b4bc62"}, - "earmark": {:hex, :earmark, "1.4.2", "3aa0bd23bc4c61cf2f1e5d752d1bb470560a6f8539974f767a38923bb20e1d7f", [:mix], [], "hexpm", "5e8806285d8a3a8999bd38e4a73c58d28534c856bc38c44818e5ba85bbda16fb"}, - "elsa": {:hex, :elsa, "0.12.1", "6fa0398383ee290f7af64b4dce67848e2106d8ceec25cba6bf6b52bd80a400b2", [:mix], [{:brod, "~> 3.9", [hex: :brod, repo: "hexpm", optional: false]}], "hexpm", "ab4f3e279ace1724e11d1cca38cc1ea70b640224e801b2bbce06d7dba75d807d"}, - "erlex": {:hex, :erlex, "0.2.5", "e51132f2f472e13d606d808f0574508eeea2030d487fc002b46ad97e738b0510", [:mix], [], "hexpm", "756d3e19b056339af674b715fdd752c5dac468cf9d0e2d1a03abf4574e99fbf8"}, - "ex_doc": {:hex, :ex_doc, "0.21.2", "caca5bc28ed7b3bdc0b662f8afe2bee1eedb5c3cf7b322feeeb7c6ebbde089d6", [:mix], [{:earmark, "~> 1.3.3 or ~> 1.4", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "f1155337ae17ff7a1255217b4c1ceefcd1860b7ceb1a1874031e7a861b052e39"}, - "gen_stage": {:hex, :gen_stage, "1.0.0", "51c8ae56ff54f9a2a604ca583798c210ad245f415115453b773b621c49776df5", [:mix], [], "hexpm", "1d9fc978db5305ac54e6f5fec7adf80cd893b1000cf78271564c516aa2af7706"}, - "jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fdf843bca858203ae1de16da2ee206f53416bbda5dc8c9e78f43243de4bc3afe"}, - "kafka_protocol": {:hex, :kafka_protocol, "2.3.3", "a43eaf1768a1a0300e81c356f543f9e6c02576c5a6a3301a1e5eea7eeede7435", [:rebar, :rebar3], [{:crc32cer, "0.1.3", [hex: :crc32cer, repo: "hexpm", optional: false]}, {:snappyer, "1.2.4", [hex: :snappyer, repo: "hexpm", optional: false]}], "hexpm", "3405854af32823697255bda9550f6d6e7267a01769a5df97923f1aa479ce53be"}, - "makeup": {:hex, :makeup, "1.0.0", "671df94cf5a594b739ce03b0d0316aa64312cee2574b6a44becb83cd90fb05dc", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "a10c6eb62cca416019663129699769f0c2ccf39428b3bb3c0cb38c718a0c186d"}, - "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.2", "1d71150d5293d703a9c38d4329da57d3935faed2031d64bc19e77b654ef2d177", [:mix], [], "hexpm", "51aa192e0941313c394956718bdb1e59325874f88f45871cff90345b97f60bba"}, + "dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"}, + "divo": {:hex, :divo, "2.0.0", "8b4b84bb2ad11332a8331e226718e32eb1b766b548d946fcce4f18cbd994f5b5", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:patiently, "~> 0.2", [hex: :patiently, repo: "hexpm", optional: false]}], "hexpm", "a3c12147700e40774502ebecd10b71bcea9d9255977522a4218bb8ad1dcde87e"}, + "divo_kafka": {:hex, :divo_kafka, "1.0.1", "866cbd16775dec140b0f37b13cd679a0183be7ef02e0aa04b8fb3c5955ee2e04", [:mix], [{:divo, "~> 2.0", [hex: :divo, repo: "hexpm", optional: false]}], "hexpm", "24d8be433f77e29161c78a4fcf3ca22e0f9e69c51c220e44de805cd211d836db"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.32", "fa739a0ecfa34493de19426681b23f6814573faee95dfd4b4aafe15a7b5b32c6", [:mix], [], "hexpm", "b8b0dd77d60373e77a3d7e8afa598f325e49e8663a51bcc2b88ef41838cca755"}, + "elsa_kafka": {:hex, :elsa_kafka, "2.0.0", "1a2493291a7f762cea96989b37fe0335c40334a927dea3a0712b1b86c90a231b", [:mix], [{:brod, "~> 3.16.5", [hex: :brod, repo: "hexpm", optional: false]}], "hexpm", "65599a92ac2fbd261aabe54dbcc9c2e37671076843855d91d1ca9127eb055274"}, + "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, + "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"}, + "gen_stage": {:hex, :gen_stage, "1.2.1", "19d8b5e9a5996d813b8245338a28246307fd8b9c99d1237de199d21efc4c76a1", [:mix], [], "hexpm", "83e8be657fa05b992ffa6ac1e3af6d57aa50aace8f691fcf696ff02f8335b001"}, + "jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"}, + "kafka_protocol": {:hex, :kafka_protocol, "4.1.0", "53fac8866969484f783bff204bd4e41e62a97ce9753c83f802a08d5bfc0e0c4c", [:rebar3], [{:crc32cer, "0.1.8", [hex: :crc32cer, repo: "hexpm", optional: false]}], "hexpm", "61cb8b80199bf95122cf8073e0f4c0ad62f82515b4d44c54f946a5972c3f5fa5"}, + "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"}, + "mock": {:hex, :mock, "0.3.7", "75b3bbf1466d7e486ea2052a73c6e062c6256fb429d6797999ab02fa32f29e03", [:mix], [{:meck, "~> 0.9.2", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm", "4da49a4609e41fd99b7836945c26f373623ea968cfb6282742bcb94440cf7e5c"}, + "nimble_options": {:hex, :nimble_options, "1.0.2", "92098a74df0072ff37d0c12ace58574d26880e522c22801437151a159392270e", [:mix], [], "hexpm", "fd12a8db2021036ce12a309f26f564ec367373265b53e25403f0ee697380f1b8"}, + "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"}, - "retry": {:hex, :retry, "0.13.0", "bb9b2713f70f39337837852337ad280c77662574f4fb852a8386c269f3d734c4", [:mix], [], "hexpm", "f9da7547ffe15d84f880d4762c76661df5d5a5dd38d55860081e73921ac59fa3"}, - "snappyer": {:hex, :snappyer, "1.2.4", "6d739c534cd2339633127a2b40279be71f149e5842c5363a4d88e66efb7c1fec", [:make, :rebar, :rebar3], [], "hexpm", "76abb8ed503722e10ee0f587956662881af9009067efdec87798a03db3527184"}, - "supervisor3": {:hex, :supervisor3, "1.1.8", "5cf95c95342b589ec8d74689eea0646c0a3eb92820241e0c2d0ca4c104df92bc", [:make, :rebar, :rebar3], [], "hexpm", "4814b4d4343e777cc724312a588061828703f05149129cda2cb30d14105b1128"}, - "telemetry": {:hex, :telemetry, "0.4.1", "ae2718484892448a24470e6aa341bc847c3277bfb8d4e9289f7474d752c09c7f", [:rebar3], [], "hexpm", "4738382e36a0a9a2b6e25d67c960e40e1a2c95560b9f936d8e29de8cd858480f"}, + "retry": {:hex, :retry, "0.18.0", "dc58ebe22c95aa00bc2459f9e0c5400e6005541cf8539925af0aa027dc860543", [:mix], [], "hexpm", "9483959cc7bf69c9e576d9dfb2b678b71c045d3e6f39ab7c9aa1489df4492d73"}, + "snappyer": {:hex, :snappyer, "1.2.8", "201ce9067a33c71a6a5087c0c3a49a010b17112d461e6df696c722dcb6d0934a", [:rebar3], [], "hexpm", "35518e79a28548b56d8fd6aee2f565f12f51c2d3d053f9cfa817c83be88c4f3d"}, + "statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"}, + "supervisor3": {:hex, :supervisor3, "1.1.11", "d81cdec31d102fde407423e1d05b569572850deebed86b951d5233c387cba80b", [:rebar3], [], "hexpm", "e6c2dedbcabcba24995a218aca12db5e208b80d3252692b22ef0f1a266104b50"}, + "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, } diff --git a/test/unit/off_broadway/kafka/acknowledger_test.exs b/test/unit/off_broadway/kafka/acknowledger_test.exs index db42771..c8e189f 100644 --- a/test/unit/off_broadway/kafka/acknowledger_test.exs +++ b/test/unit/off_broadway/kafka/acknowledger_test.exs @@ -1,6 +1,7 @@ defmodule OffBroadway.Kafka.AcknowledgerTest do use ExUnit.Case - use Placebo + + import Mock alias OffBroadway.Kafka.Acknowledger @@ -9,9 +10,9 @@ defmodule OffBroadway.Kafka.AcknowledgerTest do @partition 0 @generation_id 7 - setup do - allow Elsa.Group.Acknowledger.ack(any(), any(), any(), any(), any()), return: :ok - + setup_with_mocks([ + {Elsa.Group.Acknowledger, [], [ack: fn(_, _, _, _, _) -> :ok end]} + ]) do {:ok, pid} = Acknowledger.start_link( connection: @connection, @@ -25,7 +26,6 @@ defmodule OffBroadway.Kafka.AcknowledgerTest do ack_ref: %{pid: pid, topic: @topic, partition: @partition, generation_id: @generation_id} ] end - test "should ack offsets as acknowledged", %{pid: pid, ack_ref: ack_ref} do Acknowledger.add_offsets(pid, 1..100) @@ -33,7 +33,7 @@ defmodule OffBroadway.Kafka.AcknowledgerTest do Patiently.wait_for!( fn -> - called?(Elsa.Group.Acknowledger.ack(@connection, @topic, @partition, @generation_id, 1)) + is_nil(assert_called(Elsa.Group.Acknowledger.ack(@connection, @topic, @partition, @generation_id, 1))) end, dwell: 200, max_tries: 10 @@ -46,7 +46,7 @@ defmodule OffBroadway.Kafka.AcknowledgerTest do Acknowledger.ack(ack_ref, [broadway_message(3)], []) Process.sleep(1_000) - refute_called Elsa.Group.Acknowledger.ack(@connection, @topic, @partition, @generation_id, any()) + assert_not_called Elsa.Group.Acknowledger.ack(@connection, @topic, @partition, @generation_id, :_) end test "should ack all messages up to the latest that have been processed", %{pid: pid, ack_ref: ack_ref} do @@ -56,8 +56,8 @@ defmodule OffBroadway.Kafka.AcknowledgerTest do Patiently.wait_for!( fn -> - called?(Elsa.Group.Acknowledger.ack(@connection, @topic, @partition, @generation_id, any()), once()) - called?(Elsa.Group.Acknowledger.ack(@connection, @topic, @partition, @generation_id, 3)) + assert_called_exactly Elsa.Group.Acknowledger.ack(@connection, @topic, @partition, @generation_id, :_), 1 + is_nil(assert_called(Elsa.Group.Acknowledger.ack(@connection, @topic, @partition, @generation_id, 3))) end, dwell: 200, max_tries: 10 @@ -71,8 +71,8 @@ defmodule OffBroadway.Kafka.AcknowledgerTest do Patiently.wait_for!( fn -> - called?(Elsa.Group.Acknowledger.ack(@connection, @topic, @partition, @generation_id, any()), once()) - called?(Elsa.Group.Acknowledger.ack(@connection, @topic, @partition, @generation_id, 41)) + assert_called_exactly Elsa.Group.Acknowledger.ack(@connection, @topic, @partition, @generation_id, :_), 1 + is_nil(assert_called(Elsa.Group.Acknowledger.ack(@connection, @topic, @partition, @generation_id, 41))) end, dwell: 200, max_tries: 10 diff --git a/test/unit/off_broadway/kafka/producer_test.exs b/test/unit/off_broadway/kafka/producer_test.exs index 80d1414..3c346c0 100644 --- a/test/unit/off_broadway/kafka/producer_test.exs +++ b/test/unit/off_broadway/kafka/producer_test.exs @@ -1,6 +1,7 @@ defmodule OffBroadway.Kafka.ProducerTest do use ExUnit.Case - use Placebo + + import Mock describe "handle_info/2" do test "it adds incoming messages to its state" do @@ -25,14 +26,15 @@ defmodule OffBroadway.Kafka.ProducerTest do end test "sends incoming messages to the acknowledger" do - allow OffBroadway.Kafka.Acknowledger.add_offsets(any(), any()), return: :ok, meck_options: [:passthrough] + with_mock(OffBroadway.Kafka.Acknowledger, [:passthrough], [add_offsets: fn(_, _) -> :ok end]) do - events = create_messages(1..10) - state = state(10, events) + events = create_messages(1..10) + state = state(10, events) - {:noreply, _sent_events, _new_state} = OffBroadway.Kafka.Producer.handle_info({:process_messages, events}, state) + {:noreply, _sent_events, _new_state} = OffBroadway.Kafka.Producer.handle_info({:process_messages, events}, state) - assert_called OffBroadway.Kafka.Acknowledger.add_offsets(:acknowledger_pid, 1..10) + assert_called OffBroadway.Kafka.Acknowledger.add_offsets(:acknowledger_pid, 1..10) + end end end