From 7dea31ce4904355fd7dc36b116dba18d7046fafe Mon Sep 17 00:00:00 2001
From: Sebastien Ponce <sebastien.ponce@cern.ch>
Date: Wed, 7 Dec 2022 18:02:55 +0100
Subject: [PATCH] Attempt to fix tests depending on algo names

---
 AllenOnline/options/AllenConfig.py            | 21 ++++++++++---------
 AllenOnline/python/AllenOnline/utils.py       |  5 ++++-
 .../tests/options/sequence_with_tck.py        |  5 ++++-
 .../tests/options/test_allen_lumisummaries.py |  3 ++-
 4 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/AllenOnline/options/AllenConfig.py b/AllenOnline/options/AllenConfig.py
index 0e0d9a868..5fec821ad 100755
--- a/AllenOnline/options/AllenConfig.py
+++ b/AllenOnline/options/AllenConfig.py
@@ -77,7 +77,7 @@ json_file = os.path.expandvars(
     "${ALLEN_INSTALL_DIR}/constants/") + allen_sequence + ".json"
 with open(json_file) as jf:
     json_config = json.load(jf)
-    gs = json_config.get('gather_selections_79f7b3', {})
+    gs = json_config.get('gather_selections_bada3724', {})
     active_lines = gs.get('names_of_active_lines', '')
     n_lines = len(active_lines.split(',')) if active_lines else 0
 
@@ -182,15 +182,16 @@ messageSvc.OutputLevel = 3
 monSink = OnlMonitorSink(
     CountersToPublish=[("Bursts", "IN"), ("Bursts", "OUT"), ("Events", "IN"),
                        ("Events", "OUT"), ("Events", "MB_IN"),
-                       ("Events", "MB_OUT"), ("gather_selections_79f7b3",
-                                              "Hlt1.*Pass"),
-                       ("gather_selections_79f7b3", "Hlt1.*Rate"),
-                       ("velo_consolidate_tracks_234e40", "n_velo_tracks"),
-                       ("scifi_consolidate_seeds_7b68a2", "n_seed_tracks"),
-                       ("scifi_consolidate_tracks_8cb362", "n_long_tracks"),
-                       ("matching_consolidate_tracks_c6c7a0", "n_long_tracks"),
-                       ("filter_clusters_ae8dd8", "n_calo_clusters"),
-                       ("pv_beamline_cleanup_fece7e", "total_pvs")],
+                       ("Events", "MB_OUT"),
+                       ("gather_selections_bada3724", "Hlt1.*Pass"),
+                       ("gather_selections_bada3724", "Hlt1.*Rate"),
+                       ("velo_consolidate_tracks_ca09ac3f", "n_velo_tracks"),
+                       ("scifi_consolidate_seeds_7b68a248", "n_seed_tracks"),
+                       ("scifi_consolidate_tracks_85f4cc16", "n_long_tracks"),
+                       ("matching_consolidate_tracks_ie8943489",
+                        "n_long_tracks"),
+                       ("filter_clusters_ae8dd84a", "n_calo_clusters"),
+                       ("pv_beamline_cleanup_d0beb1db", "total_pvs")],
     HistogramsToPublish=[(".*", ".*")])
 appMgr.ExtSvc = [monSvc, monSink] + appMgr.ExtSvc
 
diff --git a/AllenOnline/python/AllenOnline/utils.py b/AllenOnline/python/AllenOnline/utils.py
index 87423248b..8b71d7f0a 100644
--- a/AllenOnline/python/AllenOnline/utils.py
+++ b/AllenOnline/python/AllenOnline/utils.py
@@ -30,7 +30,10 @@ def get_allen_hlt1_decision_ids():
         raise
 
     # Line names are stored in the JSON as a single string separated by commas
-    barrier_algorithm_name = [a[1] for a in config["sequence"]["configured_algorithms"] if a[2] == "BarrierAlgorithm"][0]
+    barrier_algorithm_name = [
+        a[1] for a in config["sequence"]["configured_algorithms"]
+        if a[2] == "BarrierAlgorithm"
+    ][0]
     active_lines = str(config[barrier_algorithm_name]["names_of_active_lines"])
     decision_names = [name + "Decision" for name in active_lines.split(",")]
 
diff --git a/AllenOnline/tests/options/sequence_with_tck.py b/AllenOnline/tests/options/sequence_with_tck.py
index 722152f7a..3c1915141 100644
--- a/AllenOnline/tests/options/sequence_with_tck.py
+++ b/AllenOnline/tests/options/sequence_with_tck.py
@@ -38,7 +38,10 @@ with allen_json_sequence.bind(sequence=args.sequence), flush_key_registry():
         with open(os.path.expandvars(json_filename)) as json_file:
             sequence_json = json.load(json_file)
 
-        dec_reporter_name = [a[1] for a in sequence_json["sequence"]["configured_algorithms"] if a[0] == "dec_reporter::dec_reporter_t"][0]
+        dec_reporter_name = [
+            a[1] for a in sequence_json["sequence"]["configured_algorithms"]
+            if a[0] == "dec_reporter::dec_reporter_t"
+        ][0]
         sequence_json[dec_reporter_name]['tck'] = encoding_key
 
         with open(sequence + '.json', 'w') as json_file:
diff --git a/AllenOnline/tests/options/test_allen_lumisummaries.py b/AllenOnline/tests/options/test_allen_lumisummaries.py
index 7b0fcbb6c..cac0117fd 100755
--- a/AllenOnline/tests/options/test_allen_lumisummaries.py
+++ b/AllenOnline/tests/options/test_allen_lumisummaries.py
@@ -122,7 +122,8 @@ while True:
     if not TES["/Event"]:
         break
 
-    dec_reports = TES['HltDecReportsDecoder/OutputHltDecReportsLocation']
+    dec_reports = TES[
+        'HltDecReportsDecoder_fa1120a7/OutputHltDecReportsLocation']
     lumi_report = dec_reports.decReport("Hlt1ODINLumiDecision")
 
     if not lumi_report.decision():
-- 
GitLab