Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full build on branch #832

Merged
merged 12 commits into from Apr 28, 2019

Merge branch 'develop' into full-build-on-branch

  • Loading branch information...
beckmani committed Apr 17, 2019
commit ec2d58e7d5eeeab56a529c72b1c8dded889674e8
@@ -4,7 +4,7 @@ config_map_name: conf

script_on_exit: '' # Uncomment this to save logs './k8s/log-client-pods.sh'

genesis_delta: 100
genesis_delta: 120
deployment_ready_time_out: 120

bootstrap:
@@ -7,6 +7,7 @@
from pytest_testconfig import config as testconfig



class DeploymentInfo():
def __init__(self, dep_id=None):
self.deployment_name = ''
@@ -42,13 +43,14 @@ def set_docker_images():
@pytest.fixture(scope='session')
def set_namespace(request, load_config):

v1 = client.CoreV1Api()

def _setup_namespace():
k8s_namespace = os.getenv('K8S_NAMESPACE', '')
if k8s_namespace != '':
testconfig['namespace'] = k8s_namespace

print("Run tests in namespace: {0}".format(testconfig['namespace']))
v1 = client.CoreV1Api()
namespaces_list = [ns.metadata.name for ns in v1.list_namespace().items]
if testconfig['namespace'] in namespaces_list:
return
@@ -58,7 +60,6 @@ def _setup_namespace():
v1.create_namespace(body)

def fin():
v1 = client.CoreV1Api()
v1.delete_namespace(name=testconfig['namespace'], body=client.V1DeleteOptions())

request.addfinalizer(fin)
@@ -76,6 +76,7 @@ def query_hare_output_set(indx, namespace, client_po_name):


def test_hare_sanity(set_namespace, setup_clients, save_log_on_exit):
wait_genesis()
# Need to wait for 1 full iteration + the time it takes the logs to propagate to ES
delay = int(testconfig['client']['args']['hare-round-duration-sec']) * NUM_OF_EXPECTED_ROUNDS + \
EFK_LOG_PROPAGATION_DELAY
@@ -10,12 +10,15 @@ spec:
name: bootstrap
spec:
containers:
- name: bootstrap
image: spacemeshos/go-spacemesh-dev:full-build-on-branch
imagePullPolicy: Always
args: ['--config', '/etc/config/config.toml', '--oracle_server', 'http://10.12.3.146:3030', '--test-mode', '--genesis-time', '019-13-19T13:24:05Z']
ports:
- containerPort: 9999
- name: bootstrap
image: spacemeshos/go-spacemesh:develop
imagePullPolicy: Always
args: ['--config', '/etc/config/config.toml', '--oracle_server', 'http://10.12.3.110:3030', '--test-mode','--layer-duration-sec', '60','--hare-committee-size', '20','--hare-max-adversaries', '9','--hare-round-duration-sec', '10','--layer-average-size', '20']
ports:
- containerPort: 9999
volumeMounts:
- name: config-volume
mountPath: /etc/config
volumes:
- name: config-volume
configMap:
@@ -1,6 +1,6 @@
from datetime import datetime, timedelta

from tests.fixtures import load_config, bootstrap_deployment_info, client_deployment_info
from tests.fixtures import load_config, bootstrap_deployment_info, client_deployment_info, set_namespace
from tests.fixtures import init_session, set_namespace, set_docker_images
import os
from os import path
@@ -368,12 +368,17 @@ def test_bootstrap(set_namespace, setup_bootstrap):


def test_client(set_namespace, setup_clients, save_log_on_exit):
peers = query_es_client_bootstrap(current_index, testconfig['namespace'], setup_clients.deployment_name)
fields = {'M':'discovery_bootstrap'}
timetowait = len(setup_clients.pods)/2
print("Sleeping " + str(timetowait) + "before checking out bootstrap results")
time.sleep(timetowait)
peers = query_message(current_index, testconfig['namespace'], setup_clients.deployment_name, fields, True)
assert peers == len(setup_clients.pods)


def test_gossip(set_namespace, setup_clients):

fields = {'M':'new_gossip_message', 'protocol': 'api_test_gossip'}
# *note*: this already waits for bootstrap so we can send the msg right away.
# send message to client via rpc
client_ip = setup_clients.pods[0]['pod_ip']
podname = setup_clients.pods[0]['name']
@@ -414,7 +419,6 @@ def test_transaction(set_namespace, setup_clients):
assert '{"value":"ok"}' in out.decode("utf-8")
print("submit transaction ok")
print("wait for confirmation ")

api = 'v1/balance'
data = '{"address":"222"}'
start = time.time()
@@ -427,4 +431,6 @@ def test_transaction(set_namespace, setup_clients):
end = time.time()
break


print("test took ", end - start, "seconds ")
assert '{"value":"100"}' in out.decode("utf-8")
print("balance ok")
You are viewing a condensed version of this merge commit. You can view the full changes here.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.