From dbad0920658decfa1e35fdbaeb0d1178dd42560e Mon Sep 17 00:00:00 2001 From: Trey Pendragon Date: Tue, 22 Oct 2024 10:41:21 -0700 Subject: [PATCH] Add a basic test. --- .../integration/full_integration_test.exs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/dpul_collections/indexing_pipeline/integration/full_integration_test.exs b/test/dpul_collections/indexing_pipeline/integration/full_integration_test.exs index a6134ce0..bb66c977 100644 --- a/test/dpul_collections/indexing_pipeline/integration/full_integration_test.exs +++ b/test/dpul_collections/indexing_pipeline/integration/full_integration_test.exs @@ -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 @@ -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) @@ -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