Skip to content

Commit

Permalink
chore: add support for new packages
Browse files Browse the repository at this point in the history
  • Loading branch information
cdummett committed Aug 27, 2024
1 parent dbeded9 commit a44d77e
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 6 deletions.
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,22 @@ build_deps_capsule:
@mkdir -p ./vega_sim/bin
cd ${EXTERN_DIR}/vegacapsule && go build -o ../../vega_sim/bin/ ./...

protos:
@if [ ! -d ./extern/ ]; then mkdir ./extern/; fi
@echo "Downloading Git dependencies into " ${EXTERN_DIR}
@echo "Downloading Vega"
@if [ ! -d ./extern/vega ]; then mkdir ./extern/vega; git clone https://github.com/vegaprotocol/vega ${EXTERN_DIR}/vega; fi
ifneq (${VEGA_TAG},develop)
@git -C ${EXTERN_DIR}/vega pull; git -C ${EXTERN_DIR}/vega checkout ${VEGA_TAG}
else
@git -C ${EXTERN_DIR}/vega checkout develop; git -C ${EXTERN_DIR}/vega pull
endif
@rm -rf ./vega_protos/protos
@mkdir ./vega_protos/protos
@buf generate extern/vega/protos/sources --template ./vega_protos/buf.gen.yaml
@GENERATED_DIR=./vega_protos/protos vega_protos/post-generate.sh
@black .

.PHONY: black
black:
@black .
Expand All @@ -109,6 +125,14 @@ test:
test_api:
@env PYTHONPATH=. pytest -m api tests/

.PHONY: test_protos
test_protos:
@env PYTHONPATH=. pytest tests/vega_protos

.PHONY: test_query
test_query:
@env PYTHONPATH=. pytest tests/vega_query

.PHONY: test_integration
test_integration:
@env PYTHONPATH=. pytest -m integration tests/
Expand Down
4 changes: 3 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[pytest]
markers =
integration: mark a test as requiring a full vega sim infrastructure with running backend\
integration: mark a test as requiring a full vega sim infrastructure with running backend
vega_query: tests for checking vega_query package
vega_protos: tests for checking vega_protos package
api: mark a test as checking vega-market-sim api coverage

log_file_format=%(asctime)s.%(msecs)03d %(threadName)s %(processName)s (%(filename)s:%(funcName)s:%(lineno)s):%(message)s
Expand Down
6 changes: 4 additions & 2 deletions tests/vega_protos/test_protos.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import vega_protos as protos
import pytest

import vega_protos as protos

@pytest.integration.vega_protos
def test_data_node_attributes():
protos.data_node.api.v2.trading_data


@pytest.mark.vega_protos
def test_vega_attributes():
protos.vega.assets
protos.vega.chain_events
Expand Down
4 changes: 2 additions & 2 deletions tests/vega_query/service/networks/test_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from vega_query.service.service_trading_data import TradingDataService


@pytest.mark.networks
@pytest.mark.vega_query
@pytest.mark.parametrize(
"network",
[
Expand All @@ -17,7 +17,7 @@ def test_network_public(network: Network):
assert network.config.exists()


@pytest.mark.networks
@pytest.mark.vega_query
@pytest.mark.parametrize(
"network",
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from vega_query.service.service_trading_data import TradingDataService


@pytest.mark.networks
@pytest.mark.vega_query
@pytest.mark.vega_query
@pytest.mark.parametrize(
"network",
Expand Down

0 comments on commit a44d77e

Please sign in to comment.