From b44bce34a9419096be53dadb69b2e7e69b43a49f Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Sun, 15 Sep 2024 00:04:10 -0400 Subject: [PATCH] Tests use new `jana:loglevel` param --- src/examples/SubeventCUDAExample/SubeventCUDAExample.cu | 1 - src/examples/SubeventExample/SubeventExample.cc | 2 +- .../UnitTestingExample/SimpleClusterFactoryTests.cc | 3 +-- src/programs/perf_tests/PerfTests.cc | 8 +++++--- .../Components/JEventProcessorSequentialTests.cc | 6 ++---- .../unit_tests/Components/JEventProcessorTests.cc | 3 +-- src/programs/unit_tests/Components/JEventSourceTests.cc | 3 +-- src/programs/unit_tests/Components/JFactoryTests.cc | 3 ++- src/programs/unit_tests/Components/NEventNSkipTests.cc | 1 - src/programs/unit_tests/Components/UserExceptionTests.cc | 2 +- src/programs/unit_tests/Engine/ScaleTests.cc | 9 +++------ src/programs/unit_tests/Engine/TerminationTests.cc | 3 +-- .../unit_tests/Topology/MultiLevelTopologyTests.cc | 2 +- src/programs/unit_tests/Topology/SubeventTests.cc | 1 - 14 files changed, 19 insertions(+), 28 deletions(-) diff --git a/src/examples/SubeventCUDAExample/SubeventCUDAExample.cu b/src/examples/SubeventCUDAExample/SubeventCUDAExample.cu index 1bc4287d0..16ea6eee5 100644 --- a/src/examples/SubeventCUDAExample/SubeventCUDAExample.cu +++ b/src/examples/SubeventCUDAExample/SubeventCUDAExample.cu @@ -133,7 +133,6 @@ int main() { auto merge_arrow = new JMergeArrow("merge", &processor, &subevents_out, &events_out); JApplication app; - app.SetParameterValue("log:info", "JWorker,JScheduler,JArrowProcessingController,JEventProcessorArrow"); app.SetTimeoutEnabled(false); app.SetTicker(false); diff --git a/src/examples/SubeventExample/SubeventExample.cc b/src/examples/SubeventExample/SubeventExample.cc index 71f5f6b25..634b4ae9f 100644 --- a/src/examples/SubeventExample/SubeventExample.cc +++ b/src/examples/SubeventExample/SubeventExample.cc @@ -86,7 +86,7 @@ struct SimpleProcessor : public JEventProcessor { int main() { JApplication app; - app.SetParameterValue("log:info", "JWorker,JScheduler,JArrowProcessingController,JEventProcessorArrow"); + app.SetParameterValue("jana:loglevel", "info"); app.SetTimeoutEnabled(false); app.SetTicker(false); diff --git a/src/examples/UnitTestingExample/SimpleClusterFactoryTests.cc b/src/examples/UnitTestingExample/SimpleClusterFactoryTests.cc index d7ca22701..154338a90 100644 --- a/src/examples/UnitTestingExample/SimpleClusterFactoryTests.cc +++ b/src/examples/UnitTestingExample/SimpleClusterFactoryTests.cc @@ -13,8 +13,7 @@ TEST_CASE("SimpleClusterFactoryTests") { // We need to fire up the JApplication so that our Factory can access all of its JServices. // However, for unit testing, we don't need (or want!) to set up an event source or actually call JApplication::Run(). JApplication app; - app.SetParameterValue("log:debug", "SimpleClusterFactory"); - app.SetParameterValue("log:off", "JApplication,JParameterManager,JArrowProcessingController,JArrow"); + app.SetParameterValue("jana:loglevel", "off"); // Add any plugins you need here // app.AddPlugin("myPlugin"); app.Initialize(); // Load the plugins diff --git a/src/programs/perf_tests/PerfTests.cc b/src/programs/perf_tests/PerfTests.cc index 771374e4d..4395a12af 100644 --- a/src/programs/perf_tests/PerfTests.cc +++ b/src/programs/perf_tests/PerfTests.cc @@ -27,7 +27,8 @@ int main() { // entangled "block of 40": dis * 40 auto params = new JParameterManager; - params->SetParameter("log:off", "JApplication,JPluginLoader,JArrowProcessingController,JArrow,JParameterManager"); + params->SetParameter("jana:loglevel", "off"); + // Log levels get set as soon as JApp gets constructed params->SetParameter("jtest:write_csv", false); params->SetParameter("jtest:parser_ms", 2); @@ -48,7 +49,8 @@ int main() { { auto params = new JParameterManager; - params->SetParameter("log:off", "JApplication,JPluginLoader,JArrowProcessingController,JArrow,JParameterManager"); + params->SetParameter("jana:loglevel", "off"); + // Log levels get set as soon as JApp gets constructed params->SetParameter("jtest:write_csv", false); @@ -90,7 +92,7 @@ int main() { ExampleHitCollection c; auto params = new JParameterManager; - params->SetParameter("log:off", "JApplication,JPluginLoader,JArrowProcessingController,JArrow"); // Log levels get set as soon as JApp gets constructed XD + params->SetParameter("jana:loglevel", "off"); JApplication app(params); auto logger = params->GetLogger("PerfTests"); // TODO: Add Podio sources, processors, and factories just like JTest diff --git a/src/programs/unit_tests/Components/JEventProcessorSequentialTests.cc b/src/programs/unit_tests/Components/JEventProcessorSequentialTests.cc index 31aaebb16..e43edd642 100644 --- a/src/programs/unit_tests/Components/JEventProcessorSequentialTests.cc +++ b/src/programs/unit_tests/Components/JEventProcessorSequentialTests.cc @@ -51,8 +51,7 @@ TEST_CASE("JEventProcessorSequentialRootTests") { app.SetParameterValue("jana:nevents", 4); app.SetParameterValue("jana:event_source_chunksize", 1); app.SetParameterValue("jana:event_processor_chunksize", 1); - app.SetParameterValue("log:global", "OFF"); - app.SetParameterValue("log:warn", "JScheduler,JArrow,JArrowProcessingController"); + app.SetParameterValue("jana:loglevel", "warn"); auto proc = new MyRootProcessor; app.Add(proc); app.Run(true); @@ -138,8 +137,7 @@ TEST_CASE("JEventProcessorSequentialTests") { app.SetParameterValue("jana:nevents", 4); app.SetParameterValue("jana:event_source_chunksize", 1); app.SetParameterValue("jana:event_processor_chunksize", 1); - app.SetParameterValue("log:global", "OFF"); - app.SetParameterValue("log:warn", "JScheduler,JArrow,JArrowProcessingController"); + app.SetParameterValue("jana:loglevel", "warn"); auto proc = new MySeqProcessor; app.Add(proc); app.Run(true); diff --git a/src/programs/unit_tests/Components/JEventProcessorTests.cc b/src/programs/unit_tests/Components/JEventProcessorTests.cc index 71d836602..d0ea3ef97 100644 --- a/src/programs/unit_tests/Components/JEventProcessorTests.cc +++ b/src/programs/unit_tests/Components/JEventProcessorTests.cc @@ -41,8 +41,7 @@ TEST_CASE("JEventProcessor_ExpertMode_ProcessCount") { { JApplication app; - app.SetParameterValue("log:global", "off"); - app.SetParameterValue("log:info", "MyEventProcessor"); + app.SetParameterValue("jana:loglevel", "off"); app.SetParameterValue("jana:nevents", 5); app.Add(new JEventSource); diff --git a/src/programs/unit_tests/Components/JEventSourceTests.cc b/src/programs/unit_tests/Components/JEventSourceTests.cc index 2ef433887..3b7c653d1 100644 --- a/src/programs/unit_tests/Components/JEventSourceTests.cc +++ b/src/programs/unit_tests/Components/JEventSourceTests.cc @@ -36,8 +36,7 @@ TEST_CASE("JEventSource_ExpertMode_EmitCount") { sut->SetTypeName("MyEventSource"); JApplication app; - app.SetParameterValue("log:global", "off"); - app.SetParameterValue("log:info", "MyEventSource"); + app.SetParameterValue("jana:loglevel", "off"); app.Add(sut); SECTION("ShutsSelfOff") { diff --git a/src/programs/unit_tests/Components/JFactoryTests.cc b/src/programs/unit_tests/Components/JFactoryTests.cc index 436edbc79..23a620833 100644 --- a/src/programs/unit_tests/Components/JFactoryTests.cc +++ b/src/programs/unit_tests/Components/JFactoryTests.cc @@ -262,7 +262,8 @@ TEST_CASE("JFactory_Logger") { JApplication app; app.Add(new JEventSource); app.Add(new JFactoryGeneratorT()); - app.SetParameterValue("log:debug", "myfac"); + app.SetParameterValue("jana:loglevel", "off"); + app.SetParameterValue("myfac:loglevel", "debug"); app.SetParameterValue("jana:nevents", "1"); app.SetParameterValue("autoactivate", "JFactoryTestDummyObject"); app.Run(); diff --git a/src/programs/unit_tests/Components/NEventNSkipTests.cc b/src/programs/unit_tests/Components/NEventNSkipTests.cc index 03ebbc690..983d66719 100644 --- a/src/programs/unit_tests/Components/NEventNSkipTests.cc +++ b/src/programs/unit_tests/Components/NEventNSkipTests.cc @@ -83,7 +83,6 @@ TEST_CASE("NEventNSkipTests") { TEST_CASE("JEventSourceArrow with multiple JEventSources") { JApplication app; - app.SetParameterValue("log:info","JArrow,JArrowProcessingController"); auto source1 = new NEventNSkipBoundedSource(); auto source2 = new NEventNSkipBoundedSource(); auto source3 = new NEventNSkipBoundedSource(); diff --git a/src/programs/unit_tests/Components/UserExceptionTests.cc b/src/programs/unit_tests/Components/UserExceptionTests.cc index 4593ef781..2ed1fe541 100644 --- a/src/programs/unit_tests/Components/UserExceptionTests.cc +++ b/src/programs/unit_tests/Components/UserExceptionTests.cc @@ -10,7 +10,7 @@ TEST_CASE("UserExceptionTests") { JApplication app; - app.SetParameterValue("log:debug","JApplication,JScheduler,JArrowProcessingController,JWorker,JArrow"); + app.SetParameterValue("jana:loglevel","debug"); app.SetParameterValue("jana:extended_report", 0); SECTION("JEventSource::Open() excepts") { diff --git a/src/programs/unit_tests/Engine/ScaleTests.cc b/src/programs/unit_tests/Engine/ScaleTests.cc index e30962d67..47443a8eb 100644 --- a/src/programs/unit_tests/Engine/ScaleTests.cc +++ b/src/programs/unit_tests/Engine/ScaleTests.cc @@ -10,8 +10,7 @@ TEST_CASE("NThreads") { JApplication app; app.SetParameterValue("jana:nevents",3); - app.SetParameterValue("log:global", "OFF"); - app.SetParameterValue("log:warn", "JScheduler,JArrow,JWorker,JArrowProcessingController"); + app.SetParameterValue("jana:loglevel","warn"); app.Add(new scaletest::DummySource); SECTION("If nthreads not provided, default to 1") { @@ -39,8 +38,7 @@ TEST_CASE("NThreads") { TEST_CASE("ScaleNWorkerUpdate") { JApplication app; app.SetParameterValue("nthreads",4); - app.SetParameterValue("log:global", "OFF"); - app.SetParameterValue("log:warn", "JScheduler,JArrow,JWorker,JArrowProcessingController"); + app.SetParameterValue("jana:loglevel","warn"); app.Add(new scaletest::DummySource); app.Add(new scaletest::DummyProcessor); app.Run(false); @@ -65,8 +63,7 @@ TEST_CASE("ScaleNWorkerUpdate") { TEST_CASE("ScaleThroughputImprovement", "[.][performance]") { JApplication app; - app.SetParameterValue("log:global", "INFO"); - // app.SetParameterValue("log:warn", "JScheduler,JArrow,JWorker,JArrowProcessingController"); + app.SetParameterValue("jana:global_loglevel", "INFO"); app.SetTicker(false); app.Add(new scaletest::DummySource); app.Add(new scaletest::DummyProcessor); diff --git a/src/programs/unit_tests/Engine/TerminationTests.cc b/src/programs/unit_tests/Engine/TerminationTests.cc index 4e939f92b..312f91223 100644 --- a/src/programs/unit_tests/Engine/TerminationTests.cc +++ b/src/programs/unit_tests/Engine/TerminationTests.cc @@ -13,10 +13,9 @@ TEST_CASE("TerminationTests") { JApplication app; - app.SetParameterValue("log:global", "OFF"); + app.SetParameterValue("jana:loglevel", "warn"); auto processor = new CountingProcessor(); app.Add(processor); - app.SetParameterValue("jana:extended_report", 0); SECTION("Manual termination") { diff --git a/src/programs/unit_tests/Topology/MultiLevelTopologyTests.cc b/src/programs/unit_tests/Topology/MultiLevelTopologyTests.cc index c9bf633c6..c380c03c7 100644 --- a/src/programs/unit_tests/Topology/MultiLevelTopologyTests.cc +++ b/src/programs/unit_tests/Topology/MultiLevelTopologyTests.cc @@ -436,7 +436,7 @@ TEST_CASE("MultiLevelTopologyBuilderTests") { TEST_CASE("TimeslicesTests") { JApplication app; - app.SetParameterValue("log:info", "JScheduler,JArrow,JArrowProcessingController"); + app.SetParameterValue("jana:loglevel", "info"); app.SetParameterValue("jana:nevents", "5"); app.Add(new MyTimesliceSource); diff --git a/src/programs/unit_tests/Topology/SubeventTests.cc b/src/programs/unit_tests/Topology/SubeventTests.cc index b4b5c8b9a..c372bf85a 100644 --- a/src/programs/unit_tests/Topology/SubeventTests.cc +++ b/src/programs/unit_tests/Topology/SubeventTests.cc @@ -95,7 +95,6 @@ TEST_CASE("Basic subevent arrow functionality") { SECTION("Execute subevent arrows end-to-end") { JApplication app; - app.SetParameterValue("log:info", "JWorker,JScheduler,JArrow,JArrowProcessingController,JEventProcessorArrow"); app.SetTimeoutEnabled(false); app.SetTicker(false);