Only run `kraken` feed tests in CI, use `open_test_pikerd()`

agg_feedz
Tyler Goodlet 2023-01-09 18:16:55 -05:00
parent 06622105cd
commit 593db0ed0d
1 changed files with 16 additions and 16 deletions

View File

@ -4,15 +4,15 @@ Data feed layer APIs, performance, msg throttling.
''' '''
from collections import Counter from collections import Counter
from pprint import pprint from pprint import pprint
from typing import AsyncContextManager
import pytest import pytest
# import tractor # import tractor
import trio import trio
from piker import ( from piker.data import (
open_piker_runtime, ShmArray,
open_feed, open_feed,
) )
from piker.data import ShmArray
from piker.data._source import ( from piker.data._source import (
unpack_fqsn, unpack_fqsn,
) )
@ -22,25 +22,33 @@ from piker.data._source import (
'fqsns', 'fqsns',
[ [
# binance # binance
(100, {'btcusdt.binance', 'ethusdt.binance'}), (100, {'btcusdt.binance', 'ethusdt.binance'}, False),
# kraken # kraken
(20, {'ethusdt.kraken', 'xbtusd.kraken'}), (20, {'ethusdt.kraken', 'xbtusd.kraken'}, True),
# binance + kraken # binance + kraken
(100, {'btcusdt.binance', 'xbtusd.kraken'}), (100, {'btcusdt.binance', 'xbtusd.kraken'}, False),
], ],
ids=lambda param: f'quotes={param[0]}@fqsns={param[1]}', ids=lambda param: f'quotes={param[0]}@fqsns={param[1]}',
) )
def test_multi_fqsn_feed( def test_multi_fqsn_feed(
open_test_pikerd: AsyncContextManager,
fqsns: set[str], fqsns: set[str],
ci_env: bool
): ):
''' '''
Start a real-time data feed for provided fqsn and pull Start a real-time data feed for provided fqsn and pull
a few quotes then simply shut down. a few quotes then simply shut down.
''' '''
max_quotes, fqsns = fqsns max_quotes, fqsns, run_in_ci = fqsns
if (
ci_env
and not run_in_ci
):
pytest.skip('Skipping CI disabled test due to feed restrictions')
brokers = set() brokers = set()
for fqsn in fqsns: for fqsn in fqsns:
@ -49,15 +57,7 @@ def test_multi_fqsn_feed(
async def main(): async def main():
async with ( async with (
open_piker_runtime( open_test_pikerd(),
'test_basic_rt_feed',
# XXX tractor BUG: this doesn't translate through to the
# ``tractor._state._runtimevars``...
# registry_addr=('127.0.0.1', 6666),
debug_mode=True,
),
open_feed( open_feed(
fqsns, fqsns,
loglevel='info', loglevel='info',