3030#include < functional>
3131
3232#include < catch_amalgamated.hpp>
33+ #include < cstdlib>
3334
3435using namespace o2 ::quality_control::core;
3536using namespace o2 ::quality_control::postprocessing;
3637using namespace o2 ::quality_control::repository;
3738using namespace o2 ::framework;
3839
39- const std::string CCDB_ENDPOINT = " ali-qcdb-test.cern.ch:8083" ;
40+ // A QC-specific CCDB instance: ali-qcdb-test by default. It holds different
41+ // objects from ccdb-test -- see the TODO in testTimekeeper.cxx -- so this is
42+ // deliberately NOT ALICEO2_CCDB_HOST. ALICEO2_QCDB_HOST lets a network-isolated
43+ // build container reach it through a broker instead; unset, behaviour is
44+ // unchanged.
45+ const std::string QCDB_ENDPOINT = [] {
46+ const char * host = std::getenv (" ALICEO2_QCDB_HOST" );
47+ return std::string ((host && *host) ? host : " ali-qcdb-test.cern.ch:8083" );
48+ }();
4049
4150struct CleanupAtDestruction {
4251 public:
@@ -86,7 +95,8 @@ TEST_CASE("test_trending_task")
8695 "config": {
8796 "database": {
8897 "implementation": "CCDB",
89- "host": "ali-qcdb-test.cern.ch:8083"
98+ "host": ")json"
99+ << QCDB_ENDPOINT << R"json( "
90100 },
91101 "Activity": {},
92102 "monitoring": {
@@ -105,7 +115,7 @@ TEST_CASE("test_trending_task")
105115 {
106116 "type": "repository",
107117 "path": "TST/MO/)json" +
108- taskName + R"json( ",
118+ taskName + R"json( ",
109119 "name": "testHistoTrending",
110120 "reductorName": "o2::quality_control_modules::common::TH1Reductor",
111121 "reductorParameters": {
@@ -121,7 +131,7 @@ TEST_CASE("test_trending_task")
121131 "type": "repository-quality",
122132 "path": "TST/QO",
123133 "names": [ ")json" +
124- checkName + R"json( " ],
134+ checkName + R"json( " ],
125135 "reductorName": "o2::quality_control_modules::common::QualityReductor",
126136 "moduleName": "QcCommon"
127137 }
@@ -140,7 +150,7 @@ TEST_CASE("test_trending_task")
140150 "name": "quality_histogram",
141151 "title": "Histogram of qualities",
142152 "varexp": ")json" +
143- checkName + R"json( .level",
153+ checkName + R"json( .level",
144154 "selection": "",
145155 "option": ""
146156 }
@@ -157,7 +167,7 @@ TEST_CASE("test_trending_task")
157167
158168 // clean
159169 std::shared_ptr<DatabaseInterface> repository = DatabaseFactory::create (" CCDB" );
160- repository->connect (CCDB_ENDPOINT , " " , " " , " " );
170+ repository->connect (QCDB_ENDPOINT , " " , " " , " " );
161171 repository->truncate (" qc/TST/MO/" + taskName, " *" );
162172 repository->truncate (" qc/TST/QO" , checkName);
163173
0 commit comments