Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zehvogel committed Oct 19, 2023
1 parent bfe1097 commit 8dc6054
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Download test inputs
run: |
wget http://lreichen.webtest.cern.ch/test.slcio
- name: Start container
run: |
docker run \
Expand Down
27 changes: 24 additions & 3 deletions test/test_CLDConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,32 @@ def _CLDConfig(test_fun):
test_fun()
os.chdir("..")

detectorModel = os.path.join(os.environ["K4GEO"], "FCCee/CLD/compact/FCCee_o1_v04/FCCee_o1_v04.xml")

@_CLDConfig
def test_lcio_edm4hep():
command = "k4run --inputFiles=../test.slcio --outputBasename=rec_test CLDReconstruction.py".split()
detectorModel = os.path.join(os.environ["K4GEO"], "FCCee/CLD/compact/FCCee_o1_v04/FCCee_o1_v04.xml")
def test_ddsim_lcio():
command = "ddsim -S cld_steer.py -N 3 --inputFile ../test/yyxyev_000.stdhep --outputFile test.slcio".split()
command.extend(["--compactFile", detectorModel])
res = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
assert res.returncode == 0, res.stdout

@_CLDConfig
def test_ddsim_edm4hep():
command = "ddsim -S cld_steer.py -N 3 --inputFile ../test/yyxyev_000.stdhep --outputFile test.edm4hep.root".split()
command.extend(["--compactFile", detectorModel])
res = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
assert res.returncode == 0, res.stdout

@_CLDConfig
def test_lcio_input():
command = "k4run --inputFiles=test.slcio --outputBasename=rec_test_lcio CLDReconstruction.py".split()
command.extend(["--GeoSvc.detectors", detectorModel])
res = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
assert res.returncode == 0, res.stdout

@_CLDConfig
def test_edm4hep_input():
command = "k4run --inputFiles=test.edm4hep.root --outputBasename=rec_test_edm4hep CLDReconstruction.py".split()
command.extend(["--GeoSvc.detectors", detectorModel])
res = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
assert res.returncode == 0, res.stdout
Binary file added test/yyxyev_000.stdhep
Binary file not shown.

0 comments on commit 8dc6054

Please sign in to comment.