Failure of Sonar job 82/8782/3
authorsahilkoli <sahil.koli@xoriant.com>
Tue, 19 Jul 2022 11:25:49 +0000 (16:55 +0530)
committersantanu de <santanu.de@xoriant.com>
Thu, 21 Jul 2022 09:39:38 +0000 (09:39 +0000)
SMO-74

Signed-off-by: sahilkoli <sahil.koli@xoriant.com>
Change-Id: I89c8c16330b3c54e0c991cbe6903636a7ad7770b
Signed-off-by: sahilkoli <sahil.koli@xoriant.com>
tests/collector/__init__.py
tests/collector/test_monitor.py
tests/dmaap_adaptor/__init__.py
tests/dmaap_adaptor/test_appConfig.py
tests/influxdb_connector/__init__.py

index 571a0b4..2570bf5 100755 (executable)
@@ -44,10 +44,9 @@ import sys
 import configparser
 
 PROJECT_PATH = os.getcwd()
-configfile_name = PROJECT_PATH+'ves/tests/test_collector/test_collector.conf'
-PROJECT_PATH = PROJECT_PATH[:PROJECT_PATH.rfind('/')]
+configfile_name = PROJECT_PATH+'tests/test_collector/test_collector.conf'
 schema_file_path = os.path.join(
-    PROJECT_PATH,"ves/collector/evel-test-collector/docs/att_interface_definition/CommonEventFormat-v7-2-2.json")
+    PROJECT_PATH,"collector/evel-test-collector/docs/att_interface_definition/CommonEventFormat-v7-2-2.json")
 if  os.path.isfile(configfile_name):
     # Create the configuration file as it doesn't exist yet
     cfgfile = open(configfile_name, "w")
@@ -70,6 +69,6 @@ if  os.path.isfile(configfile_name):
     Config.write(cfgfile)
     cfgfile.close()
 SOURCE_PATH = os.path.join(
-    PROJECT_PATH,"ves/collector/evel-test-collector/code/collector")
-print(SOURCE_PATH, PROJECT_PATH,schema_file_path)
+    PROJECT_PATH,"collector/evel-test-collector/code/collector")
+print(SOURCE_PATH, PROJECT_PATH,schema_file_path, configfile_name )
 sys.path.append(SOURCE_PATH)
index 953af13..e6ff8c5 100644 (file)
@@ -34,19 +34,18 @@ from kafka import KafkaProducer
 
 def get_path():
     project_path = os.getcwd()
-    project_path = project_path[:project_path.rfind('/')]
     return project_path
 
 def get_config_path():
     project_path=get_path()
     config_path = os.path.join(
-        project_path,"ves/tests/collector/test_collector.conf")
+        project_path,"tests/collector/test_collector.conf")
     return config_path
 
 def get_schema_path():
     project_path=get_path()
     schema_path = os.path.join(
-    project_path,"ves/collector/evel-test-collector/docs/att_interface_definition/CommonEventFormat-v7-2-2.json")
+    project_path,"collector/evel-test-collector/docs/att_interface_definition/CommonEventFormat-v7-2-2.json")
     return schema_path
 
 @pytest.fixture
index 6029002..ebb6f30 100644 (file)
@@ -17,8 +17,7 @@ import os
 import sys
 
 PROJECT_PATH = os.getcwd()
-PROJECT_PATH = PROJECT_PATH[:PROJECT_PATH.rfind('/')]
 SOURCE_PATH = os.path.join(
-    PROJECT_PATH,"ves/dmaapadapter/adapter/code"
+    PROJECT_PATH,"dmaapadapter/adapter/code"
 )
 sys.path.append(SOURCE_PATH)
\ No newline at end of file
index e3cd1fa..c3deb11 100644 (file)
@@ -27,13 +27,12 @@ import pytest
 
 def get_path():
     project_path = os.getcwd()
-    project_path = project_path[:project_path.rfind('/')]
     return project_path
 
 def get_config_path():
     project_path=get_path()
     config_path = os.path.join(
-    project_path,"ves/dmaapadapter/adapter/config/adapter.conf")
+    project_path,"dmaapadapter/adapter/config/adapter.conf")
     return config_path
 
 @pytest.fixture
index cfff36f..fe8c9af 100644 (file)
@@ -17,8 +17,7 @@ import os
 import sys
 
 PROJECT_PATH = os.getcwd()
-PROJECT_PATH = PROJECT_PATH[:PROJECT_PATH.rfind('/')]
 SOURCE_PATH = os.path.join(
-    PROJECT_PATH,"ves/influxdb-connector/influxdb-connector/code"
+    PROJECT_PATH,"influxdb-connector/influxdb-connector/code"
 )
 sys.path.append(SOURCE_PATH)
\ No newline at end of file