Skip to content

Commit

Permalink
re-enable test cov
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsasha committed Jan 14, 2019
1 parent fc6d6f2 commit b53695d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
name: run regular tests
command: |
. venv/bin/activate
py.test --cov=irrd irrd --junitxml=test-reports/junit.xml
py.test --cov=irrd irrd --junitxml=test-reports/junit.xml --cov-fail-under=100
- run:
name: run integration tests
Expand Down
3 changes: 2 additions & 1 deletion irrd/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ def config_init(config_path):


def is_config_initialised():
return bool(configuration)
global configuration
return configuration is not None


def get_setting(setting_name: str, default: Any=None) -> Any:
Expand Down
3 changes: 2 additions & 1 deletion irrd/conf/test_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import yaml
from typing import Dict

from . import get_setting, ConfigurationError, config_init
from . import get_setting, ConfigurationError, config_init, is_config_initialised


@pytest.fixture()
Expand Down Expand Up @@ -87,6 +87,7 @@ def test_load_valid_reload_valid_config(self, monkeypatch, save_yaml_config, tmp
}
save_yaml_config(config)
assert list(get_setting('sources_default')) == ['TESTDB2', 'TESTDB']
assert is_config_initialised()

config['irrd']['sources_default'] = ['TESTDB2']
save_yaml_config(config, run_init=False)
Expand Down
4 changes: 4 additions & 0 deletions irrd/integration_tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@


class TestIntegration:
"""
Note that this test will not be included in the default py.test discovery,
this is intentional.
"""
def test_irrd_integration(self, tmpdir):
# IRRD_DATABASE_URL overrides the yaml config, so should be removed
del os.environ['IRRD_DATABASE_URL']
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ omit =
irrd/storage/alembic/*
irrd/scripts/query_qa_comparison.py
irrd/scripts/database_upgrade.py
irrd/integration_tests/*

[tool:pytest]
log_level=INFO

0 comments on commit b53695d

Please sign in to comment.