Skip to content
Snippets Groups Projects
Commit d0f7ac4e authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Bug resolution in unitary testing of Service service

parent f779d7a4
No related branches found
No related tags found
1 merge request!54Release 2.0.0
......@@ -3,12 +3,16 @@
cd $(dirname $0)/src
RCFILE=~/teraflow/controller/coverage/.coveragerc
## Run unitary tests and analyze coverage of code at same time
#coverage run --rcfile=$RCFILE -m pytest --log-level=DEBUG --verbose \
# common/database/tests/test_unitary.py \
# common/database/tests/test_engine_inmemory.py \
# context/tests/test_unitary.py \
# device/tests/test_unitary.py \
# service/tests/test_unitary.py
# Run unitary tests and analyze coverage of code at same time
coverage run --rcfile=$RCFILE -m pytest --log-level=DEBUG --verbose \
common/database/tests/test_unitary.py \
common/database/tests/test_engine_inmemory.py \
context/tests/test_unitary.py \
device/tests/test_unitary.py \
service/tests/test_unitary.py
## Run integration tests and analyze coverage of code at same time
......
......@@ -15,6 +15,7 @@ build integration_tester:
- src/common/**
- src/context/**
- src/device/**
- src/service/**
- src/$IMAGE_NAME/**
- .gitlab-ci.yml
......@@ -35,6 +36,7 @@ test integration_tester:
- src/common/**
- src/context/**
- src/device/**
- src/service/**
- src/$IMAGE_NAME/**
- .gitlab-ci.yml
......@@ -49,6 +51,7 @@ integration_test integration_tester:
- test integration_tester
- deploy context
- deploy device
- deploy service
- dependencies all
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
......
......@@ -58,6 +58,7 @@ SERVICE = {
@pytest.fixture(scope='session')
def database():
_database = get_database(engine=DatabaseEngineEnum.INMEMORY)
populate_example(_database, add_services=False)
return _database
@pytest.fixture(scope='session')
......@@ -74,9 +75,8 @@ def service_client(service_service):
yield _client
_client.close()
def test_get_services_empty(service_client : ServiceClient, database : Database):
def test_get_services_empty(service_client : ServiceClient):
# should work
populate_example(database, add_services=False)
validate_service_list_is_empty(MessageToDict(
service_client.GetServiceList(Empty()),
including_default_value_fields=True, preserving_proto_field_name=True,
......@@ -317,9 +317,8 @@ def test_delete_service(service_client : ServiceClient):
including_default_value_fields=True, preserving_proto_field_name=True,
use_integers_for_enums=False))
def test_get_services_empty_2(service_client : ServiceClient, database : Database):
def test_get_services_empty_2(service_client : ServiceClient):
# should work
populate_example(database, add_services=False)
validate_service_list_is_empty(MessageToDict(
service_client.GetServiceList(Empty()),
including_default_value_fields=True, preserving_proto_field_name=True,
......@@ -335,7 +334,7 @@ def test_create_service_empty_endpoints(service_client : ServiceClient):
including_default_value_fields=True, preserving_proto_field_name=True,
use_integers_for_enums=False))
def test_get_services_full(service_client : ServiceClient, database : Database):
def test_get_services_full(service_client : ServiceClient):
# should work
validate_service_list_is_not_empty(MessageToDict(
service_client.GetServiceList(Empty()),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment