Skip to content

Commit

Permalink
even more doc in test
Browse files Browse the repository at this point in the history
  • Loading branch information
JoschD committed Nov 10, 2023
1 parent a46a6cb commit ac4e6e9
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions tests/unit/test_job_submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,45 +147,51 @@ def test_htc_submit(destination: bool, uri: bool):
- `prerun = True`: create the folder structures and submit the jobs.
- `prerun = False`: check that the output data is present.
"""
if uri and not destination:
return # only need to run one of those

# Fix the kerberos ticket path, in case kerberos doesn't find it.
# Do a `klist` in terminal to find your ticket manually and adapt the path.
# MANUAL THINGS TO CHANGE ##############################################
user = "mmustermann" # set your username
tmp_name = "htc_temp" # name for the temporary folder (will be created)
prerun = True
# prerun = False # switch here after jobs finished.

# Uncomment to fix the kerberos ticket, in case htcondor doesn't find it.
# Do a `klist` in terminal and adapt the path.
# import os
# os.environ["KRB5CCNAME"] = "/tmp/krb5cc_####"
########################################################################
if uri and not destination:
return # only need to run one when destination is not set

tmp_name = "htc_temp"
# set working_directory
if destination:
tmp_name = f"{tmp_name}_dest"
if uri:
tmp_name = f"{tmp_name}_uri"

if uri:
tmp_name = f"{tmp_name}_uri"

user = "jdilly"
path = Path("/", "afs", "cern.ch", "user", user[0], user, tmp_name)
path.mkdir(exist_ok=True)

# set output_destination
dest = None
if destination:
dest = f"/eos/user/{user[0]}/{user}/{tmp_name}"
if uri:
dest = f"root://eosuser.cern.ch/{dest}"

# create setup
setup = InputParameters(
working_directory=path,
output_destination=dest,
# dryrun=True
)
setup.create_mask()

prerun = True
# prerun = False # !! Manually switch here after jobs finished.
if prerun:
# submit jobs
job_submit(**asdict(setup))
_test_subfile_content(setup)
_test_output(setup, post_run=False)
else:
# check output
_test_output(setup, post_run=True)


Expand Down

0 comments on commit ac4e6e9

Please sign in to comment.