make test-results location configurable in a propoerties file
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1229478 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -847,12 +847,13 @@ under the License.
|
||||
<arg value="test"/>
|
||||
<env key="LC_ALL" value="C"/>
|
||||
</java>
|
||||
<mkdir dir="runtime/logs/test-results/html"/>
|
||||
<junitreport todir="runtime/logs/test-results">
|
||||
<fileset dir="runtime/logs/test-results/">
|
||||
<property file="${basedir}/framework/testtools/config/TestToolsConfig.properties"/>
|
||||
<mkdir dir="${testtools.test-results-dir}html"/>
|
||||
<junitreport todir="${testtools.test-results-dir}">
|
||||
<fileset dir="${testtools.test-results-dir}">
|
||||
<include name="*.xml"/>
|
||||
</fileset>
|
||||
<report format="frames" todir="runtime/logs/test-results/html"/>
|
||||
<report format="frames" todir="${testtools.test-results-dir}html"/>
|
||||
</junitreport>
|
||||
<fail message="Test run was unsuccessful">
|
||||
<condition>
|
||||
@@ -891,10 +892,11 @@ under the License.
|
||||
<arg value="-case=${test.case}"/>
|
||||
<env key="LC_ALL" value="C"/>
|
||||
</java>
|
||||
<delete dir="runtime/logs/test-results/${test.component}-${test.case}"/>
|
||||
<mkdir dir="runtime/logs/test-results/${test.component}-${test.case}"/>
|
||||
<move todir="runtime/logs/test-results/${test.component}-${test.case}">
|
||||
<fileset dir="runtime/logs/test-results" includes="*.xml"/>
|
||||
<property file="${basedir}/framework/testtools/config/TestToolsConfig.properties"/>
|
||||
<delete dir="${testtools.test-results-dir}${test.component}-${test.case}"/>
|
||||
<mkdir dir="${testtools.test-results-dir}${test.component}-${test.case}"/>
|
||||
<move todir="${testtools.test-results-dir}${test.component}-${test.case}">
|
||||
<fileset dir="${testtools.test-results-dir}" includes="*.xml"/>
|
||||
</move>
|
||||
<fail message="Test run was unsuccessful">
|
||||
<condition>
|
||||
@@ -925,7 +927,7 @@ under the License.
|
||||
</target>
|
||||
<target name="run-test-list" depends="_setup-separated-test-run"
|
||||
description="Run all configured tests, stopping/starting ofbiz between each test">
|
||||
<delete dir="runtime/logs/test-results"/>
|
||||
<delete dir="${testtools.test-results-dir}"/>
|
||||
<ant antfile="runtime/test-list-build.xml" target="all-tests"/>
|
||||
</target>
|
||||
|
||||
|
||||
+2
-2
@@ -49,7 +49,6 @@ under the License.
|
||||
<mkdir dir="../runtime"/>
|
||||
<mkdir dir="../runtime/output"/>
|
||||
<mkdir dir="../runtime/logs"/>
|
||||
<mkdir dir="../runtime/logs/test-results"/>
|
||||
<mkdir dir="../runtime/data"/>
|
||||
<mkdir dir="../runtime/data/derby"/>
|
||||
<mkdir dir="../runtime/data/hsql"/>
|
||||
@@ -92,7 +91,8 @@ under the License.
|
||||
</target>
|
||||
|
||||
<target name="clean-logs">
|
||||
<delete verbose="on" dir="../runtime/logs/test-results"/>
|
||||
<property file="${basedir}/framework/testtools/config/TestTools.properties"/>
|
||||
<delete verbose="on" dir="../${testtools.test-results-dir}"/>
|
||||
<delete dir="../runtime/logs/cobertura-report"/>
|
||||
<delete verbose="on">
|
||||
<fileset dir="../runtime/logs" includes="*">
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
###############################################################################
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
###############################################################################
|
||||
|
||||
# define the test results directory
|
||||
testtools.test-results-dir=runtime/logs/test-results/
|
||||
|
||||
@@ -40,6 +40,7 @@ import org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter;
|
||||
import org.ofbiz.base.container.Container;
|
||||
import org.ofbiz.base.container.ContainerException;
|
||||
import org.ofbiz.base.util.Debug;
|
||||
import org.ofbiz.base.util.UtilProperties;
|
||||
import org.ofbiz.entity.Delegator;
|
||||
|
||||
/**
|
||||
@@ -48,7 +49,6 @@ import org.ofbiz.entity.Delegator;
|
||||
public class TestRunContainer implements Container {
|
||||
|
||||
public static final String module = TestRunContainer.class.getName();
|
||||
public static final String logDir = "runtime/logs/test-results/";
|
||||
|
||||
protected String configFile = null;
|
||||
protected String component = null;
|
||||
@@ -93,7 +93,7 @@ public class TestRunContainer implements Container {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String logDir = UtilProperties.getPropertyValue("TestToolsConfig", "test-results-dir");
|
||||
// make sure the log dir exists
|
||||
File dir = new File(logDir);
|
||||
if (!dir.exists())
|
||||
@@ -120,6 +120,9 @@ public class TestRunContainer implements Container {
|
||||
throw new ContainerException("No tests found (" + component + " / " + suiteName + " / " + testCase + ")");
|
||||
}
|
||||
|
||||
// get logdir
|
||||
String logDir = UtilProperties.getPropertyValue("TestToolsConfig", "test-results-dir");
|
||||
|
||||
boolean failedRun = false;
|
||||
for (ModelTestSuite modelSuite: jsWrapper.getModelTestSuites()) {
|
||||
Delegator testDelegator = modelSuite.getDelegator();
|
||||
|
||||
Reference in New Issue
Block a user