Skip to content

Commit

Permalink
Add a basic test.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpendragon committed Nov 20, 2024
1 parent 51752c8 commit dbad092
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule DpulCollections.IndexingPipeline.FiggyFullIntegrationTest do

alias DpulCollections.Repo
alias DpulCollections.IndexingPipeline.Figgy
alias DpulCollections.{IndexingPipeline, Solr}
alias DpulCollections.{IndexingPipeline, Solr, IndexMetricsTracker}
import SolrTestSupport

setup do
Expand Down Expand Up @@ -47,8 +47,11 @@ defmodule DpulCollections.IndexingPipeline.FiggyFullIntegrationTest do
{Figgy.IndexingConsumer,
cache_version: cache_version, batch_size: 50, write_collection: active_collection()},
{Figgy.TransformationConsumer, cache_version: cache_version, batch_size: 50},
{Figgy.HydrationConsumer, cache_version: cache_version, batch_size: 50}
{Figgy.HydrationConsumer, cache_version: cache_version, batch_size: 50},
{IndexMetricsTracker, []}
]
test_pid = self()
:ok = :telemetry.attach("hydration-full-run", [:dpulc, :indexing_pipeline, :hydrator, :time_to_poll], fn _,measurements,_,_ -> send(test_pid, {:hydrator_time_to_poll_hit, measurements}) end, nil)

Supervisor.start_link(children, strategy: :one_for_one, name: DpulCollections.TestSupervisor)

Expand Down Expand Up @@ -146,6 +149,9 @@ defmodule DpulCollections.IndexingPipeline.FiggyFullIntegrationTest do
assert hydration_entry.cache_order != hydration_entry_again.cache_order

Supervisor.stop(DpulCollections.TestSupervisor, :normal)

# Ensure metrics are being sent.
assert_receive {:hydrator_time_to_poll_hit, %{duration: _}}
end

test "indexes expected fields" do
Expand Down

0 comments on commit dbad092

Please sign in to comment.