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

Maintain Gas Estimation Metrics #594

Merged
merged 6 commits into from Dec 16, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions .circleci/config.yml
Expand Up @@ -126,6 +126,16 @@ workflows:
- deployers
- config
- character
- estimate_gas:
context: "NuCypher Tests"
filters:
tags:
only: /.*/
requires:
- actors
- deployers
- config
- character

#
# TODO: Initial Publication Automation
Expand Down Expand Up @@ -421,6 +431,19 @@ jobs:
- store_artifacts:
path: ./mypy_reports

estimate_gas:
<<: *python_36_base
steps:
- checkout
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Estimate Gas
command: |
pipenv run python tests/metrics/estimate_gas.py
- store_artifacts:
path: tests/metrics/results/

test_build:
<<: *python_36_base
steps:
Expand Down
1 change: 1 addition & 0 deletions Pipfile
Expand Up @@ -65,6 +65,7 @@ pytest-mock = "*"

[scripts]
install-solc = "./scripts/install_solc.sh"
estimate-gas = "python3 tests/metrics/estimate_gas.py"
nucypher = "python3 nucypher/cli.py"

[pipenv]
Expand Down
4 changes: 3 additions & 1 deletion nucypher/config/constants.py
Expand Up @@ -16,17 +16,19 @@
"""


import os
from collections import namedtuple
from os.path import abspath, dirname

from appdirs import AppDirs

import nucypher

from nucypher.blockchain.eth import sol

# Base Filepaths
BASE_DIR = abspath(dirname(dirname(nucypher.__file__)))
PROJECT_ROOT = abspath(dirname(nucypher.__file__))
CONTRACT_ROOT = os.path.join(abspath(dirname(sol.__file__)), 'source', 'contracts')

# User Application Filepaths
APP_DIR = AppDirs(nucypher.__title__, nucypher.__author__)
Expand Down
8 changes: 4 additions & 4 deletions nucypher/utilities/logging.py
Expand Up @@ -62,16 +62,16 @@ def _get_or_create_user_log_dir():
return pathlib.Path(USER_LOG_DIR).mkdir(parents=True, exist_ok=True)


def getJsonFileObserver():
def getJsonFileObserver(name="ursula.log.json", path=USER_LOG_DIR): # TODO: More configurable naming here?
_get_or_create_user_log_dir()
logfile = DailyLogFile("ursula.log.json", USER_LOG_DIR)
logfile = DailyLogFile(name, path)
observer = jsonFileLogObserver(outFile=logfile)
return observer


def getTextFileObserver():
def getTextFileObserver(name="ursula.log", path=USER_LOG_DIR):
_get_or_create_user_log_dir()
logfile = DailyLogFile("ursula.log", USER_LOG_DIR)
logfile = DailyLogFile(name, path)
observer = FileLogObserver(formatEvent=formatUrsulaLogEvent, outFile=logfile)
return observer

Expand Down