Skip to content

Commit

Permalink
fix: Enable G4 based python tests and fix them (#1044)
Browse files Browse the repository at this point in the history
CI did not run the python G4 based tests because of a missing setup script. This revealed an off-by-one error in the material track reading.
  • Loading branch information
paulgessinger committed Oct 21, 2021
1 parent 43d0b76 commit 9a2dea0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:
${SETUP}
&& source /usr/local/bin/thisroot.sh
&& source /usr/local/bin/thisdd4hep_only.sh
&& /usr/local/bin/download_geant4_data.sh
&& source /usr/local/bin/geant4.sh
&& source build/python/setup.sh
&& pip3 install pytest
&& pytest -rFs
Expand Down
2 changes: 1 addition & 1 deletion Examples/Io/Root/src/RootMaterialTrackReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ ActsExamples::RootMaterialTrackReader::RootMaterialTrackReader(
<< "'.");
}

m_events = m_inputChain->GetMaximum("event_id");
m_events = m_inputChain->GetMaximum("event_id") + 1;
ACTS_DEBUG("The full chain has " << m_events << " entries.");

// If the events are not in order, get the entry numbers for ordered events
Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def test_root_material_track_reader(material_recording):

s.run()

assert alg.events_seen == 198
assert alg.events_seen == 2


@pytest.mark.csv
Expand Down

0 comments on commit 9a2dea0

Please sign in to comment.