Skip to content

Commit

Permalink
test: Set /DiracX/URL when running integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburr committed Oct 8, 2023
1 parent da42574 commit 683b523
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/DIRAC/Core/scripts/dirac_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ def setLegacyExchangeApiKey(self, optionValue):
DIRAC.gConfig.setOptionValue(cfgInstallPath("LegacyExchangeApiKey"), self.legacyExchangeApiKey)
return DIRAC.S_OK()

def setDiracxUrl(self, optionValue):
self.diracxUrl = optionValue
Script.localCfg.addDefaultEntry("/DiracX/URL", self.diracxUrl)
DIRAC.gConfig.setOptionValue(cfgInstallPath("URL"), self.diracxUrl)
return DIRAC.S_OK()

def _runConfigurationWizard(setups, defaultSetup):
"""The implementation of the configuration wizard"""
Expand Down Expand Up @@ -371,6 +376,7 @@ def runDiracConfigure(params):
Script.registerSwitch(
"K:", "LegacyExchangeApiKey=", "Set the Api Key to talk to DiracX", params.setLegacyExchangeApiKey
)
Script.registerSwitch("", "DiracxUrl=", "Set the URL to talk to DiracX", params.setDiracxUrl)

Script.registerSwitch("W:", "gateway=", "Configure <gateway> as DIRAC Gateway for the site", params.setGateway)

Expand Down
7 changes: 6 additions & 1 deletion tests/Jenkins/dirac_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,12 @@ installSite() {

echo "==> Done installing, now configuring"
source "${SERVERINSTALLDIR}/bashrc"
if ! dirac-configure --cfg "${SERVERINSTALLDIR}/install.cfg" --LegacyExchangeApiKey='diracx:legacy:InsecureChangeMe' "${DEBUG}"; then
configureArgs=()
if [[ -n "${TEST_DIRACX:-}" ]]; then
configureArgs+=("--LegacyExchangeApiKey=diracx:legacy:InsecureChangeMe")
configureArgs+=("--DiracxUrl=${DIRACX_URL}")
fi
if ! dirac-configure --cfg "${SERVERINSTALLDIR}/install.cfg" "${configureArgs[@]}" "${DEBUG}"; then
echo "ERROR: dirac-configure failed" >&2
exit 1
fi
Expand Down

0 comments on commit 683b523

Please sign in to comment.