Commit 46ce0819 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Forecaster component:

- Updated TODO.txt
- Added dump of descriptors to file
parent 8d581e12
Loading
Loading
Loading
Loading
+17
Changes for src/forecaster/service/TODO.txt: 17 added lines, 0 removed lines.
Original line number Original line Diff line number Diff line

Use a smaller network:
INFO     forecaster.tests.Tools:Tools.py:75 Discovering Devices and Links...
INFO     forecaster.tests.Tools:Tools.py:104   Found 22 devices and 462 links...

ERROR    forecaster.service.ForecasterServiceServicerImpl:Decorator.py:233 ForecastTopologyCapacity exception
Traceback (most recent call last):
  File "/home/tfs/tfs-ctrl/src/common/method_wrappers/Decorator.py", line 220, in inner_wrapper
    reply = func(self, request, grpc_context)
  File "/home/tfs/tfs-ctrl/src/forecaster/service/ForecasterServiceServicerImpl.py", line 94, in ForecastTopologyCapacity
    link_capacities[link.link_id] = link.attributes
TypeError: unhashable type: 'LinkId'





test case:
test case:
- instantiate Context and Monitoring
- instantiate Context and Monitoring
- populate topology
- populate topology
+4 −1
Changes for src/forecaster/tests/test_unitary.py: 4 added lines, 1 removed line.
Original line number Original line Diff line number Diff line
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.


import logging, pandas, pytest
import json, logging, pandas, pytest
from typing import Dict, Tuple
from typing import Dict, Tuple
from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME
from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME
from common.proto.context_pb2 import ContextId, TopologyId
from common.proto.context_pb2 import ContextId, TopologyId
@@ -37,11 +37,14 @@ ADMIN_TOPOLOGY_ID = TopologyId(**json_topology_id(DEFAULT_TOPOLOGY_NAME, context


CSV_DATA_FILE = 'forecaster/tests/data/dataset.csv'
CSV_DATA_FILE = 'forecaster/tests/data/dataset.csv'
#CSV_DATA_FILE = 'forecaster/tests/data/dataset2.csv'
#CSV_DATA_FILE = 'forecaster/tests/data/dataset2.csv'
DESC_DATS_FILE = 'forecaster/tests/data/descriptor.json'


@pytest.fixture(scope='session')
@pytest.fixture(scope='session')
def scenario() -> Tuple[pandas.DataFrame, Dict]:
def scenario() -> Tuple[pandas.DataFrame, Dict]:
    df = read_csv(CSV_DATA_FILE)
    df = read_csv(CSV_DATA_FILE)
    descriptors = compose_descriptors(df)
    descriptors = compose_descriptors(df)
    with open(DESC_DATS_FILE, 'w', encoding='UTF-8') as f:
        f.write(json.dumps(descriptors))
    yield df, descriptors
    yield df, descriptors


def test_prepare_environment(
def test_prepare_environment(