Skip to content

Commit 62d85c8

Browse files
committed
Capture solana logs in integration tests
1 parent 296d7d1 commit 62d85c8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

pyth/tests/conftest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,19 @@ def pyth_add_publisher(
321321
return pyth_add_price
322322

323323

324+
@pytest.fixture(scope='session')
325+
def solana_logs(solana_test_validator, solana_keygen):
326+
with open("solana_logs.txt", 'w') as f:
327+
cmd = [
328+
'solana', 'logs',
329+
'--url', 'localhost',
330+
'--keypair', solana_keygen[1],
331+
]
332+
p = subprocess.Popen(cmd, stdout=f)
333+
yield
334+
p.kill()
335+
336+
324337
@pytest.fixture(scope='function')
325338
def pyth_init_price(solana_test_validator, pyth_dir, pyth_add_publisher):
326339

pyth/tests/test_update_price.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from pyth.tests.conftest import PRODUCTS
1010

1111
@pytest.mark.asyncio
12-
async def test_batch_update_price(solana_test_validator, pythd, pyth_dir, pyth_init_product, pyth_init_price):
12+
async def test_batch_update_price(solana_test_validator, solana_logs, pythd, pyth_dir, pyth_init_product, pyth_init_price):
1313

1414
messageIds = itertools.count()
1515

0 commit comments

Comments
 (0)