Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Framework/test/testCcdbDatabase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <DataFormatsQualityControl/FlagTypeFactory.h>
#include <TROOT.h>
#include <CCDB/CcdbApi.h>
#include <cstdlib>

namespace utf = boost::unit_test;

Expand All @@ -48,7 +49,13 @@ using namespace o2::quality_control::core;
using namespace o2::quality_control::repository;
using namespace std;

const std::string CCDB_ENDPOINT = "ccdb-test.cern.ch:8080";
// These tests upload, so this has to be a WRITABLE instance -- ccdb-test by
// default. ALICEO2_CCDB_HOST lets a network-isolated build container reach one
// through a broker instead; unset, behaviour is unchanged.
const std::string CCDB_ENDPOINT = [] {
const char* host = std::getenv("ALICEO2_CCDB_HOST");
return std::string((host && *host) ? host : "ccdb-test.cern.ch:8080");
}();

/**
* Fixture for the tests, i.e. code is ran in every test that uses it, i.e. it is like a setup and teardown for tests.
Expand Down
9 changes: 8 additions & 1 deletion Framework/test/testCcdbDatabaseExtra.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <boost/test/unit_test.hpp>
#include <TH1F.h>
#include <cstdlib>

namespace utf = boost::unit_test;

Expand All @@ -39,7 +40,13 @@ using namespace o2::quality_control::core;
using namespace o2::quality_control::repository;
using namespace std;

const std::string CCDB_ENDPOINT = "ccdb-test.cern.ch:8080";
// These tests upload, so this has to be a WRITABLE instance -- ccdb-test by
// default. ALICEO2_CCDB_HOST lets a network-isolated build container reach one
// through a broker instead; unset, behaviour is unchanged.
const std::string CCDB_ENDPOINT = [] {
const char* host = std::getenv("ALICEO2_CCDB_HOST");
return std::string((host && *host) ? host : "ccdb-test.cern.ch:8080");
}();
std::unordered_map<std::string, std::string> Objects;

/**
Expand Down
11 changes: 9 additions & 2 deletions Framework/test/testReductor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@
#define BOOST_TEST_DYN_LINK

#include <boost/test/unit_test.hpp>

const std::string CCDB_ENDPOINT = "ccdb-test.cern.ch:8080";
#include <cstdlib>

// These tests upload, so this has to be a WRITABLE instance -- ccdb-test by
// default. ALICEO2_CCDB_HOST lets a network-isolated build container reach one
// through a broker instead; unset, behaviour is unchanged.
const std::string CCDB_ENDPOINT = [] {
const char* host = std::getenv("ALICEO2_CCDB_HOST");
return std::string((host && *host) ? host : "ccdb-test.cern.ch:8080");
}();

using namespace o2::quality_control;
using namespace o2::quality_control::core;
Expand Down
8 changes: 7 additions & 1 deletion Framework/test/testTriggers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ using namespace o2::quality_control::postprocessing;
using namespace o2::quality_control::core;
using namespace o2::quality_control::repository;

const std::string CCDB_ENDPOINT = "ccdb-test.cern.ch:8080";
// These tests upload, so this has to be a WRITABLE instance -- ccdb-test by
// default. ALICEO2_CCDB_HOST lets a network-isolated build container reach one
// through a broker instead; unset, behaviour is unchanged.
const std::string CCDB_ENDPOINT = [] {
const char* host = std::getenv("ALICEO2_CCDB_HOST");
return std::string((host && *host) ? host : "ccdb-test.cern.ch:8080");
}();

BOOST_AUTO_TEST_CASE(test_casting_triggers)
{
Expand Down
Loading