Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Update regression logging #1803

Merged
merged 1 commit into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions python-regression/tests/features/steps/api_test_steps.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from aloe import *
from util import static_vals
from util import logger as log
from util.test_logic import api_test_logic as api_utils
from util.threading_logic import pool_logic as pool
from util.neighbor_logic import neighbor_logic as neighbors
from util.response_logic import response_handling as responses
from time import sleep, time

import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
logger = log.getLogger(__name__)

testAddress = static_vals.TEST_ADDRESS

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from aloe import step
from util.test_logic import api_test_logic as api_utils
from util import logger as log

import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
logger = log.getLogger(__name__)


@step(r'A local snapshot was taken on "([^"]+)" at index (\d+)')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import logging
from aloe import world, step
from util.response_logic import response_handling as response_handling
from util.test_logic import api_test_logic as api_utils
from util.test_logic import value_fetch_logic

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
from util import logger as log
logger = log.getLogger(__name__)

world.test_vars = {}

Expand Down
8 changes: 3 additions & 5 deletions python-regression/tests/features/steps/transaction_steps.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
from aloe import world, step
from iota import Transaction
from util import static_vals as static
from util import logger as log
from util.test_logic import api_test_logic as api_utils
from util.transaction_bundle_logic import transaction_logic as transactions
from util.milestone_logic import milestones
from time import sleep

import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

logger = log.getLogger(__name__)

@step(r'a transaction is generated and attached on "([^"]+)" with:')
def generate_transaction_and_attach(step, node):
Expand Down Expand Up @@ -204,7 +202,7 @@ def wait_for_update(index, api):
if node_info['latestSolidSubtangleMilestoneIndex'] == index:
updated = True
break
i += 1;
i += 1
sleep(1)

assert updated is True, "The node was unable to update to index {}".format(index)
5 changes: 5 additions & 0 deletions python-regression/util/logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s: %(message)s')

def getLogger(name):
return logging.getLogger(name)
6 changes: 2 additions & 4 deletions python-regression/util/milestone_logic/milestones.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
from iota import ProposedTransaction, ProposedBundle, Tag, Address, Transaction
from util import conversion as converter
from util import logger as log
from util.transaction_bundle_logic import bundle_logic

import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

logger = log.getLogger(__name__)

def issue_milestone(address, api, index, *reference_transaction):
txn1 = ProposedTransaction(
Expand Down
5 changes: 2 additions & 3 deletions python-regression/util/neighbor_logic/neighbor_logic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
from util import logger as log
logger = log.getLogger(__name__)


def check_if_neighbors(api, neighbors, expected_neighbor):
Expand Down
5 changes: 2 additions & 3 deletions python-regression/util/response_logic/response_handling.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import logging
from util.threading_logic import pool_logic as pool
from util import logger as log

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
logger = log.getLogger(__name__)


def find_in_response(key, response):
Expand Down
5 changes: 2 additions & 3 deletions python-regression/util/test_logic/api_test_logic.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import json
import logging
import urllib3
from aloe import world
from iota import Iota, Address, Tag, TryteString

from . import value_fetch_logic as value_fetch
from util import logger as log

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
logger = log.getLogger(__name__)


def prepare_api_call(node_name, **kwargs):
Expand Down
5 changes: 2 additions & 3 deletions python-regression/util/threading_logic/pool_logic.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from multiprocessing.dummy import Pool
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
from util import logger as log
logger = log.getLogger(__name__)


def start_pool(function, iterations, args):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
from util import static_vals as static
from util.test_logic import api_test_logic as api_utils
from util.test_logic import value_fetch_logic as value_fetch
import logging
from util import logger as log

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
logger = log.getLogger(__name__)


def create_transaction_bundle(address, tag, value):
Expand Down