diff options
author | Yuli Shlosberg <ys9693@att.com> | 2017-11-06 16:48:40 +0200 |
---|---|---|
committer | Yuli Shlosberg <ys9693@att.com> | 2017-11-06 16:49:18 +0200 |
commit | d02297bebf518219745592dee3ad0a7e7835a761 (patch) | |
tree | fc18af71e8c5e37e9c1642bd5346cd9a047c701e | |
parent | a070cb63982f50d028889c97db8142a3cf88a42f (diff) |
fix sanity-docker logs and memory issue
Change-Id: Iae73c1e723430ef7253896dd403f728a88057a86
Issue-Id: SDC-611
Signed-off-by: Yuli Shlosberg <ys9693@att.com>
6 files changed, 67 insertions, 65 deletions
diff --git a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/conf/logback.xml b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/conf/logback.xml new file mode 100644 index 0000000000..b41ee12695 --- /dev/null +++ b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/conf/logback.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<configuration scan="true" scanPeriod="5 seconds"> + + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>%d{yyyy-MM-dd HH:mm:ss} | %-5p | [%thread] %logger{5}:%L - %msg%n</pattern> + </encoder> + </appender> + + <appender name="FILE" class="ch.qos.logback.core.FileAppender"> + <file>logFile.log</file> + <append>true</append> + <encoder> + <pattern>%d{yyyy-MM-dd HH:mm:ss} | %-5p | [%thread] %logger{5}:%L - %msg%n</pattern> + </encoder> + </appender> + + <logger name="com.memorynotfound" level="INFO"/> + + <root level="INFO"> + <appender-ref ref="STDOUT" /> + <appender-ref ref="FILE" /> + </root> + +</configuration>
\ No newline at end of file diff --git a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/startTest.sh b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/startTest.sh index 933f9af6e4..76338b2082 100644 --- a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/startTest.sh +++ b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/startTest.sh @@ -93,7 +93,7 @@ if [ ${REMOTE_DEBUG} == "true" ]; then JAVA_OPTION="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${debug_port}" ; fi -cmd="java $JAVA_OPTION -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -Dfilepath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass} $SUITE_FILE &" +cmd="java $JAVA_OPTION -Xms1024m -Xmx1024m -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -Dfilepath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass} $SUITE_FILE &" if [ $DEBUG == "true" ] @@ -108,7 +108,7 @@ if [ ${RERUN} == "true" ]; then echo "Prepare" ${TARGET_DIR}/${fileName} "file to rerun all failed tests ..."; prepareFailedXmlFile ${TARGET_DIR}/${fileName} $SUITE_FILE; SUITE_FILE=${fileName}; - cmd="java $JAVA_OPTION -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -Dfilepath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass} $SUITE_FILE &" + cmd="java $JAVA_OPTION -Xms1024m -Xmx1024m -DdisplayException=true -Dtargetlog=${TARGET_LOG_DIR} -Dfilepath=${FILES_TEST} -Dconfig.resource=${CONF_FILE} -Ddebug=${DEBUG} -Dlog4j.configuration=${LOGS_PROP_FILE} -cp $JAR_FILE ${MainClass} $SUITE_FILE &" $cmd; fi fi diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java index 4803bb5de2..9af3b6bc05 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java @@ -20,25 +20,15 @@ package org.openecomp.sdc.ci.tests.api; -import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertNotNull; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.function.Consumer; -import java.util.stream.Collectors; - +import com.aventstack.extentreports.ExtentTest; +import com.aventstack.extentreports.Status; +import com.thinkaurelius.titan.core.TitanFactory; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.TitanVertex; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.ImmutableTriple; -import org.apache.log4j.Logger; import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.junit.rules.TestName; @@ -47,11 +37,7 @@ import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; -import org.openecomp.sdc.be.model.Component; -import org.openecomp.sdc.be.model.Product; -import org.openecomp.sdc.be.model.Resource; -import org.openecomp.sdc.be.model.Service; -import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.be.model.*; import org.openecomp.sdc.ci.tests.config.Config; import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; @@ -61,37 +47,30 @@ import org.openecomp.sdc.ci.tests.utils.cassandra.CassandraUtils; import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.general.FileHandling; -import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; -import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils; -import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils; -import org.openecomp.sdc.ci.tests.utils.rest.ProductRestUtils; -import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; -import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; -import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils; +import org.openecomp.sdc.ci.tests.utils.rest.*; +import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.ITestContext; import org.testng.ITestResult; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterMethod; -import org.testng.annotations.AfterSuite; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeSuite; -import org.testng.annotations.Test; +import org.testng.annotations.*; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.*; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import static org.testng.AssertJUnit.assertEquals; +import static org.testng.AssertJUnit.assertNotNull; + -import com.aventstack.extentreports.ExtentTest; -import com.aventstack.extentreports.Status; -import com.thinkaurelius.titan.core.TitanFactory; -import com.thinkaurelius.titan.core.TitanGraph; -import com.thinkaurelius.titan.core.TitanVertex; -import ch.qos.logback.classic.Level; -import ch.qos.logback.classic.LoggerContext; public abstract class ComponentBaseTest { // private static Logger logger = LoggerFactory.getLogger(ComponentBaseTest.class.getName()); - - protected static Logger logger= Logger.getLogger(ComponentBaseTest.class); + protected static Logger logger= LoggerFactory.getLogger(ComponentBaseTest.class); // public ComponentBaseTest(TestName testName, String className) { @@ -118,14 +97,15 @@ public abstract class ComponentBaseTest { public ComponentBaseTest(TestName name, String name2) { // TODO Auto-generated constructor stub - LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); - lc.getLogger("com.thinkaurelius").setLevel(Level.INFO); - lc.getLogger("com.datastax").setLevel(Level.INFO); - lc.getLogger("io.netty").setLevel(Level.INFO); - lc.getLogger("c.d").setLevel(Level.INFO); - lc.getLogger("o.a.h").setLevel(Level.INFO); - lc.getLogger("o.o.s.c.t.d.h").setLevel(Level.INFO); - } +// LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); +// lc.getLogger("com.thinkaurelius").setLevel(Level.INFO); +// lc.getLogger("com.datastax").setLevel(Level.INFO); +// lc.getLogger("io.netty").setLevel(Level.INFO); +// lc.getLogger("c.d").setLevel(Level.INFO); +// lc.getLogger("o.a.h").setLevel(Level.INFO); +// lc.getLogger("o.o.s.c.t.d.h").setLevel(Level.INFO); + +} public static String getReportFolder() { return REPORT_FOLDER; diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java index 9bb14d7f50..8bc967c877 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/run/StartTest.java @@ -34,8 +34,9 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.jar.JarEntry; import java.util.jar.JarFile; -import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.openecomp.sdc.ci.tests.config.Config; import org.openecomp.sdc.ci.tests.utils.Utils; //import org.junit.runner.JUnitCore; @@ -94,7 +95,7 @@ public class StartTest { } public StartTest() { - logger = Logger.getLogger(StartTest.class.getName()); + logger = LoggerFactory.getLogger(StartTest.class.getName()); } public static void enableLogger() { diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java index 8764779c02..0f339b811c 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java @@ -21,9 +21,9 @@ package org.openecomp.sdc.ci.tests.sanity; - - - +import com.aventstack.extentreports.Status; +import com.clearspring.analytics.util.Pair; +import fj.data.Either; import org.junit.Rule; import org.junit.rules.TestName; import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum; @@ -52,11 +52,6 @@ import org.testng.annotations.Optional; import org.testng.annotations.Parameters; import org.testng.annotations.Test; -import com.aventstack.extentreports.Status; -import com.clearspring.analytics.util.Pair; - -import fj.data.Either; - import java.io.File; @@ -86,7 +81,8 @@ public class Onboard extends ComponentBaseTest { @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "VNF_List") public void onboardVNFShotFlow(String filepath, String vnfFile) throws Exception, Throwable { setLog(vnfFile); - System.out.println("print - >" + makeDistributionValue); + logger.info("Onboarding - > " + vnfFile); +// System.out.println("Onboarding - > " + vnfFile); runOnboardToDistributionFlow(filepath, vnfFile); } diff --git a/test-apis-ci/src/main/resources/logback.xml b/test-apis-ci/src/main/resources/logback.xml index 4723bc24cb..4b5e23c776 100644 --- a/test-apis-ci/src/main/resources/logback.xml +++ b/test-apis-ci/src/main/resources/logback.xml @@ -15,9 +15,9 @@ </encoder> </appender> - <logger name="com.memorynotfound" level="TRACE"/> + <logger name="com.memorynotfound" level="INFO"/> - <root level="DEBUG"> + <root level="INFO"> <appender-ref ref="STDOUT" /> <appender-ref ref="FILE" /> </root> |