Skip to content

Commit

Permalink
capture and print test_scripts output for debugging CI-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
gph82 committed Jan 3, 2025
1 parent 23c2f72 commit a2f2b10
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
if: ${{ matrix.python-version != '3.7' }}
run: |
echo -e '[run]\nomit = *dihedrals.py,*contact_matrix.py' > .coveragerc
pytest -n 8 -vs --cov=./ --cov-report=xml --disable-warnings --cov-config=.coveragerc
pytest -k Test_ExamplesCLTs -n 8 -vs --cov=./ --cov-report=xml --disable-warnings --cov-config=.coveragerc
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion mdciao/examples/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def run(self, clt,show=True):
oneline = self._join_args(clt)
CP = []
for line in oneline.split("\n\n"):
CP.append(_run(line.split()))
CP.append(_run(line.split(), capture_output=True))
if self.test:
return CP

Expand Down
20 changes: 20 additions & 0 deletions tests/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def test_mdc_sites(self):
CP = self.xCLTs.run("mdc_sites",
# show=True
)
print([iCP.stdout.decode().splitlines() for iCP in CP])
print([iCP.stderr.decode().splitlines() for iCP in CP])
assert _np.unique([iCP.returncode for iCP in CP]) == 0

def test_mdc_neighborhood(self):
Expand All @@ -52,6 +54,8 @@ def test_mdc_neighborhood(self):
CP = self.xCLTs.run("mdc_neighborhoods",
# show=True
)
print([iCP.stdout.decode().splitlines() for iCP in CP])
print([iCP.stderr.decode().splitlines() for iCP in CP])
assert _np.unique([iCP.returncode for iCP in CP]) == 0

def test_mdc_interface(self):
Expand All @@ -60,6 +64,8 @@ def test_mdc_interface(self):
CP = self.xCLTs.run("mdc_interface",
# show=True
)
print([iCP.stdout.decode().splitlines() for iCP in CP])
print([iCP.stderr.decode().splitlines() for iCP in CP])
assert _np.unique([iCP.returncode for iCP in CP]) == 0

def test_mdc_fragments(self):
Expand All @@ -68,6 +74,8 @@ def test_mdc_fragments(self):
CP = self.xCLTs.run("mdc_fragments",
# show=True
)
print([iCP.stdout.decode().splitlines() for iCP in CP])
print([iCP.stderr.decode().splitlines() for iCP in CP])
assert _np.unique([iCP.returncode for iCP in CP]) == 0

def test_mdc_BW(self):
Expand All @@ -76,6 +84,8 @@ def test_mdc_BW(self):
CP = self.xCLTs.run("mdc_GPCR_overview",
# show=True
)
print([iCP.stdout.decode().splitlines() for iCP in CP])
print([iCP.stderr.decode().splitlines() for iCP in CP])
assert _np.unique([iCP.returncode for iCP in CP]) == 0, CP

def test_mdc_CGN(self):
Expand All @@ -84,6 +94,8 @@ def test_mdc_CGN(self):
CP = self.xCLTs.run("mdc_CGN_overview",
# show=True
)
print([iCP.stdout.decode().splitlines() for iCP in CP])
print([iCP.stderr.decode().splitlines() for iCP in CP])
assert _np.unique([iCP.returncode for iCP in CP]) == 0

def test_mdc_pdb(self):
Expand All @@ -92,24 +104,32 @@ def test_mdc_pdb(self):
CP = self.xCLTs.run("mdc_pdb",
# show=True
)
print([iCP.stdout.decode().splitlines() for iCP in CP])
print([iCP.stderr.decode().splitlines() for iCP in CP])
assert _np.unique([iCP.returncode for iCP in CP]) == 0

def test_mdc_compare(self):
with remember_cwd():
os.chdir(self.tmpdir)
CP = self.xCLTs.run("mdc_compare")
print([iCP.stdout.decode().splitlines() for iCP in CP])
print([iCP.stderr.decode().splitlines() for iCP in CP])
assert _np.unique([iCP.returncode for iCP in CP]) == 0

def test_mdc_residues(self):
with remember_cwd():
os.chdir(self.tmpdir)
CP = self.xCLTs.run("mdc_residues")
print([iCP.stdout.decode().splitlines() for iCP in CP])
print([iCP.stderr.decode().splitlines() for iCP in CP])
assert _np.unique([iCP.returncode for iCP in CP]) == 0

def test_mdc_notebooks(self):
with remember_cwd():
os.chdir(self.tmpdir)
CP = self.xCLTs.run("mdc_notebooks")
print([iCP.stdout.decode().splitlines() for iCP in CP])
print([iCP.stderr.decode().splitlines() for iCP in CP])
assert _np.unique([iCP.returncode for iCP in CP]) == 0


Expand Down

0 comments on commit a2f2b10

Please sign in to comment.