Skip to content

Commit

Permalink
Skip test_useless_frontend if local RSE is not found (#1537)
Browse files Browse the repository at this point in the history
* Skip `test_useless_frontend` if local RSE is not found

* Add missing configuration
  • Loading branch information
dachengx authored Jan 23, 2025
1 parent 8301dea commit 0bdc729
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions straxen/storage/rucio_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class RucioLocalFrontend(strax.StorageFrontend):
storage_type = strax.StorageType.LOCAL
local_prefixes = {
"UC_DALI_USERDISK": "/dali/lgrandi/rucio/",
"SDSC_USERDISK": "/expanse/lustre/projects/chi135/shockley/rucio",
"SDSC_USERDISK": "/expanse/lustre/projects/chi135/shockley/rucio/",
}
local_rses = {"UC_DALI_USERDISK": r".rcc.", "SDSC_USERDISK": r".sdsc."}
local_rses = {"UC_DALI_USERDISK": r"^dali(\w*).rcc.", "SDSC_USERDISK": r".sdsc."}

def __init__(self, path=None, *args, **kwargs):
kwargs.setdefault("readonly", True)
Expand Down
14 changes: 9 additions & 5 deletions tests/storage/test_rucio_local.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import os
import re
import json
from bson import json_util
import shutil
import socket
import unittest
import strax
import os
import straxen
import shutil
import json
from bson import json_util


class TestRucioLocal(unittest.TestCase):
Expand Down Expand Up @@ -175,7 +176,10 @@ class DummyLocalRucio(straxen.RucioLocalFrontend):

@unittest.skipIf(not straxen.utilix_is_configured(), "No DB access")
@unittest.skipIf(
socket.getfqdn() in straxen.RucioLocalFrontend.local_rses,
any(
re.search(socket.getfqdn(), v) is not None
for v in straxen.RucioLocalFrontend.local_rses.values()
),
"Testing useless frontends only works on hosts where it's not supposed to work",
)
def test_useless_frontend(self):
Expand Down

0 comments on commit 0bdc729

Please sign in to comment.