Skip to content

Commit

Permalink
Enable all tests in CI (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Beckman committed Mar 20, 2019
1 parent c47c741 commit c60745c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -139,5 +139,5 @@ dockerrun-test: dockerbuild-test
ifndef ES_PASSWD
$(error ES_PASSWD is not set)
endif
docker run -e ES_PASSWD="$(ES_PASSWD)" -e GOOGLE_APPLICATION_CREDENTIALS=./spacemesh.json -it go-spacemesh-python pytest -k test_client -s --tc-file=config.yaml --tc-format=yaml
docker run -e ES_PASSWD="$(ES_PASSWD)" -e GOOGLE_APPLICATION_CREDENTIALS=./spacemesh.json -it go-spacemesh-python pytest -s --tc-file=config.yaml --tc-format=yaml
.PHONY: dockerrun-test
2 changes: 2 additions & 0 deletions tests/__init__.py
@@ -0,0 +1,2 @@

__all__ = ['test_bs', 'misc', 'fixtures']
17 changes: 10 additions & 7 deletions tests/test_bs.py
@@ -1,5 +1,5 @@
from datetime import datetime, timedelta
from fixtures import load_config
from tests.fixtures import load_config
import os
from os import path
import pytest
Expand All @@ -15,7 +15,7 @@
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search, Q

from misc import NodeInfo, ContainerSpec
from tests.misc import NodeInfo, ContainerSpec

BOOT_DEPLOYMENT_FILE = './k8s/bootstrap-w-conf.yml'
CLIENT_DEPLOYMENT_FILE = './k8s/client-w-conf.yml'
Expand Down Expand Up @@ -126,7 +126,7 @@ def setup_oracle():
return namespaced_pods[0].status.pod_ip


@pytest.fixture
@pytest.fixture(scope='module')
def setup_bootstrap(request, load_config, setup_oracle, create_configmap):
def _setup_bootstrap_in_namespace(name_space):
global bs_info
Expand Down Expand Up @@ -163,7 +163,7 @@ def fin():
return _setup_bootstrap_in_namespace(testconfig['namespace'])


@pytest.fixture
@pytest.fixture(scope='module')
def setup_clients(request, setup_oracle, setup_bootstrap):
def _setup_clients_in_namespace(name_space):
global bs_info, client_info
Expand Down Expand Up @@ -207,7 +207,7 @@ def fin():
return _setup_clients_in_namespace(testconfig['namespace'])


@pytest.fixture
@pytest.fixture(scope='module')
def create_configmap(request):
def _create_configmap_in_namespace(nspace):
# Configure ConfigMap metadata
Expand Down Expand Up @@ -247,7 +247,7 @@ def fin():
return _create_configmap_in_namespace(testconfig['namespace'])


@pytest.fixture
@pytest.fixture(scope='module')
def save_log_on_exit(request):
yield
if testconfig['script_on_exit'] != '' and request.session.testsfailed == 1:
Expand Down Expand Up @@ -293,7 +293,10 @@ def test_gossip(load_config, setup_clients):
(out, err) = p.communicate()
assert '{"value":"ok"}' in out.decode("utf-8")

time.sleep(40)
gossip_propagation_sleep = len(setup_clients)*2
print('sleep for {0} sec to enable gossip propagation'.format(gossip_propagation_sleep))
time.sleep(gossip_propagation_sleep)

peers_for_gossip = query_es_gossip_message(current_index, testconfig['namespace'], client_info.bs_deployment_name)
assert len(setup_clients) == peers_for_gossip

Expand Down

0 comments on commit c60745c

Please sign in to comment.