Skip to content

Commit

Permalink
try catching stderr output
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasgameiroborges committed Dec 3, 2024
1 parent dcaa5f0 commit 7612c9d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# yamllint disable rule:line-length
name: charmed-postgresql # you probably want to 'snapcraft register <name>'
base: core24 # the base snap is the execution environment for this snap
version: '16.4' # just for humans, typically '1.2+git' or '1.3.2'
version: '16.6' # just for humans, typically '1.2+git' or '1.3.2'
summary: PostgreSQL in a snap.
description: |
PostgreSQL is a free and open-source relational database management
Expand Down
16 changes: 12 additions & 4 deletions tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,18 @@ def test_all_apps():

for app, data in snapcraft["apps"].items():
if not bool(data.get("daemon")) and app not in skip:
subprocess.run(
f"{snapcraft['name']}.{app} {override.get(app, '--help')}".split(),
check=True,
)
try:
subprocess.run(
f"{snapcraft['name']}.{app} {override.get(app, '--help')}".split(),
check=True,
capture_output=True,
text=True,
)
except subprocess.CalledProcessError as e:
# Print the error and the stderr output
print(f"Command failed with return code {e.returncode}")
print("stderr output:")
print(e.stderr)


@pytest.mark.run(after="test_install")
Expand Down

0 comments on commit 7612c9d

Please sign in to comment.