Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 210289 - Results property is not consistent.
Summary: Results property is not consistent.
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Paul Slauenwhite CLA
QA Contact: Kathy Chan CLA
URL:
Whiteboard: bvt
Keywords:
Depends on:
Blocks: 211751 296286 299032
  Show dependency tree
 
Reported: 2007-11-19 14:32 EST by Joel Cayne CLA
Modified: 2016-05-05 10:50 EDT (History)
3 users (show)

See Also:


Attachments
Patch. (11.41 KB, patch)
2010-01-06 13:12 EST, Paul Slauenwhite CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Cayne CLA 2007-11-19 14:32:18 EST
Setting the ANT tptp.test.results property requires adding a trailing / to the property in order for the result to be stored with a specific name in a folder. For example, the results should be stored in the folder junit_results/Windows_IA32 with the file name AllTests.execution.

I tried the following to set a results property
1. Create the results property using <property name="tptp.test.results" value="junit_results/Windows_IA32/AllTests" />. The resulting file will be AllTests.execution located in the project's root directory.
2. Create the results property using <property name="tptp.test.results" value="junit_results/Windows_IA32/" />. This results in a WIN_IA32.execution file in the project/junit_results directory. 
3. Create the results property with a trailing slash <property name="tptp.test.results" value="junit_results/Windows_IA32/AllTests/" />. The result is an AllTests.execution file in the project/junit_results/Windows_IA32 directory.

Sample usage of the results property in the execution task:
<tptp:execution resultsrefid="tptp.test.results">
    <fileset dir="${project.dir}">
       <include name="**/junit/*${testSuite}.testsuite" />
    </fileset>
</tptp:execution>

Using the third method I was able to interrogate it and get the results, but it would also throw an exception trying to find a .execution file in project/junit_results/Windows_IA32/AllTests/.

<tptp:interrogation verdictproperty="tptp.test.verdict">
    <filelist refid="tptp.test.results"/>
</tptp:interrogation>


This throws the exception:
[condition] org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.core.internal.resources.ResourceException: Resource '/project/junit_results/Windows_IA32/AllTests/.execution' does not exist.
[condition] 	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:316)
[condition] 	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:275)
[condition] 	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:398)
[condition] 	at org.eclipse.hyades.test.core.services.AbstractTestResultsInterrogationService.interrogate(AbstractTestResultsInterrogationService.java:197)
[condition] 	at org.eclipse.hyades.test.core.services.AbstractTestResultsInterrogationService.execute(AbstractTestResultsInterrogationService.java:101)
[condition] 	at org.eclipse.hyades.automation.server.AbstractService.execute(AbstractService.java:43)
[condition] 	at org.eclipse.hyades.automation.server.ServiceProxy$1.run(ServiceProxy.java:141)
[condition] 	at org.eclipse.hyades.automation.core.utils.ReusableThread.run(ReusableThread.java:131)
[condition] 	at java.lang.Thread.run(Unknown Source)
[condition] Caused by: org.eclipse.core.internal.resources.ResourceException: Resource '/project/junit_results/Windows_IA32/AllTests/.execution' does not exist.
[condition] 	at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:310)
[condition] 	at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:193)
[condition] 	at org.eclipse.core.internal.resources.File.getContents(File.java:285)
[condition] 	at org.eclipse.core.internal.resources.File.getContents(File.java:276)
[condition] 	at org.eclipse.hyades.models.hierarchy.util.HierarchyURIConverterImpl$WorkbenchHelper.createPlatformResourceInputStream(HierarchyURIConverterImpl.java:290)
[condition] 	at org.eclipse.hyades.models.hierarchy.util.HierarchyURIConverterImpl.createPlatformResourceInputStream(HierarchyURIConverterImpl.java:368)
[condition] 	at org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createInputStream(URIConverterImpl.java:538)
[condition] 	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1152)
[condition] 	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:256)
[condition] 	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:271)
[condition] 	... 7 more
Comment 1 Paul Slauenwhite CLA 2007-11-19 14:52:39 EST
Duwayne, we need this defect for the Test Automation Initiative.  Please provide a sizing and resolve early in I4.  Thanks.
Comment 2 Paul Slauenwhite CLA 2007-11-26 10:21:55 EST
This defect is able to worked around.  Retargetting.
Comment 3 Paul Slauenwhite CLA 2008-05-21 14:18:34 EDT
Deferring to future as approved by the TPTP PMC (http://dev.eclipse.org/mhonarc/lists/tptp-pmc/msg04926.html).
Comment 4 Paul Slauenwhite CLA 2009-05-18 19:40:31 EDT
Josh, this defect is blocking you adding the BVT test results to the test pass reports.
Comment 5 Paul Slauenwhite CLA 2009-06-01 07:57:20 EDT
After testing the results property with the tptp:test and tptp:execution tasks, it is working as designed.  However, the documentation requires refactoring to clarify the intent, requirements, and valid values for this property:

-The directory containing the results must exist on the local file system.

-Absolute (e.g. d:\myworkspace\myproject\myfolder\myresults\myresult[.execution]) or project-relative (e.g. myfolder\myresults\myresult[.execution]) path to the result file (with or without the .execution file extension).  When the tptp:execution task is used and multiple test suites are executed, each test suite is saved to the same result file.  If the overwrites property is false, new result files are created with the same result file name appended with the current time stamp (milliseconds) for each test suite.

-Absolute (e.g. d:\myworkspace\myproject\myfolder\myresults\) or project-relative (e.g. myfolder\myresults\) path to the result file directory.

We will use defect to refactor the documentation.  In addition, the other properties (see org.eclipse.hyades.test.doc.user/ref/rsupported-test-execution-service-properties.htm) should be refactored to clarify the intent, requirements, and valid values (e.g. only absolute and project-relative paths) for these properties (see defect https://bugs.eclipse.org/bugs/show_bug.cgi?id=200586).

The test cases (/org.eclipse.hyades.test.core.services.tests/resources/Ant/build.xml) also need to be refactored to test each of these requirements and valid values for this property. 

Josh, can you please refactor the BVT Ant file to use the results property to save the BVT test results in \org.eclipse.hyades.tests\BVT_results (see /org.eclipse.hyades.test.core.services.tests/resources/Ant/build.xml for an example).
Comment 6 Paul Slauenwhite CLA 2009-06-11 07:48:54 EDT
(In reply to comment #5)
> After testing the results property with the tptp:test and tptp:execution tasks,
> it is working as designed.  However, the documentation requires refactoring to
> clarify the intent, requirements, and valid values for this property:
> 
> -The directory containing the results must exist on the local file system.
> 
> -Absolute (e.g.
> d:\myworkspace\myproject\myfolder\myresults\myresult[.execution]) or
> project-relative (e.g. myfolder\myresults\myresult[.execution]) path to the
> result file (with or without the .execution file extension).  When the
> tptp:execution task is used and multiple test suites are executed, each test
> suite is saved to the same result file.  If the overwrites property is false,
> new result files are created with the same result file name appended with the
> current time stamp (milliseconds) for each test suite.
> 
> -Absolute (e.g. d:\myworkspace\myproject\myfolder\myresults\) or
> project-relative (e.g. myfolder\myresults\) path to the result file directory.
> 
> We will use defect to refactor the documentation.  In addition, the other
> properties (see
> org.eclipse.hyades.test.doc.user/ref/rsupported-test-execution-service-properties.htm)
> should be refactored to clarify the intent, requirements, and valid values
> (e.g. only absolute and project-relative paths) for these properties (see
> defect https://bugs.eclipse.org/bugs/show_bug.cgi?id=200586).
> 
> The test cases
> (/org.eclipse.hyades.test.core.services.tests/resources/Ant/build.xml) also
> need to be refactored to test each of these requirements and valid values for
> this property. 
> 
> Josh, can you please refactor the BVT Ant file to use the results property to
> save the BVT test results in \org.eclipse.hyades.tests\BVT_results (see
> /org.eclipse.hyades.test.core.services.tests/resources/Ant/build.xml for an
> example).
> 

After testing the results property with the tptp:test and tptp:execution tasks using the TPTP-4.6.0-200906041936 build, I am getting mixed results.  As such, we need to reevaluate the org.eclipse.hyades.test.core.services.AbstractTestExecutionService.beforeLaunch(String) method.

Josh, please use the following for now, which appears to create the execution results in the correct directory but without a name (e.g. .execution):

results="BVT_results\"
overwrite="false"

Also, please change the tptp.test.results used in resultsrefid/refid to test_results_reference_ID since tptp.test.results is a reserved property name.
Comment 7 Joshua Bowles CLA 2009-06-11 10:53:20 EDT
Done and done, I'm assuming that your choice of slash direction for results "\" is environment dependent.
Comment 8 Paul Slauenwhite CLA 2009-06-11 13:23:07 EDT
(In reply to comment #7)
> Done and done, I'm assuming that your choice of slash direction for results "\"
> is environment dependent.
> 

No, since the paths are handled as URIs.  However, we will need clarification in then documentation.
Comment 9 Joshua Bowles CLA 2009-06-11 16:33:55 EDT
I got the results to generate with a named execution using results="BVT_results\${testSuite}_${targetJRE}", so that does still work it seems.
Comment 10 Paul Slauenwhite CLA 2009-11-26 14:20:37 EST
This is blocking the TPTP BVTs.
Comment 11 Paul Slauenwhite CLA 2009-11-26 14:55:47 EST
Defect 296286 will cover documentation updates to the results property.  This defect will address the inconsistencies with the results property.
Comment 12 Paul Slauenwhite CLA 2009-11-27 08:56:18 EST
(In reply to comment #6)
> (In reply to comment #5)
> > After testing the results property with the tptp:test and tptp:execution tasks,
> > it is working as designed.  However, the documentation requires refactoring to
> > clarify the intent, requirements, and valid values for this property:
> > 
> > -The directory containing the results must exist on the local file system.
> > 
> > -Absolute (e.g.
> > d:\myworkspace\myproject\myfolder\myresults\myresult[.execution]) or
> > project-relative (e.g. myfolder\myresults\myresult[.execution]) path to the
> > result file (with or without the .execution file extension).  When the
> > tptp:execution task is used and multiple test suites are executed, each test
> > suite is saved to the same result file.  If the overwrites property is false,
> > new result files are created with the same result file name appended with the
> > current time stamp (milliseconds) for each test suite.
> > 
> > -Absolute (e.g. d:\myworkspace\myproject\myfolder\myresults\) or
> > project-relative (e.g. myfolder\myresults\) path to the result file directory.
> > 
> > We will use defect to refactor the documentation.  In addition, the other
> > properties (see
> > org.eclipse.hyades.test.doc.user/ref/rsupported-test-execution-service-properties.htm)
> > should be refactored to clarify the intent, requirements, and valid values
> > (e.g. only absolute and project-relative paths) for these properties (see
> > defect https://bugs.eclipse.org/bugs/show_bug.cgi?id=200586).
> > 
> > The test cases
> > (/org.eclipse.hyades.test.core.services.tests/resources/Ant/build.xml) also
> > need to be refactored to test each of these requirements and valid values for
> > this property. 
> > 
> > Josh, can you please refactor the BVT Ant file to use the results property to
> > save the BVT test results in \org.eclipse.hyades.tests\BVT_results (see
> > /org.eclipse.hyades.test.core.services.tests/resources/Ant/build.xml for an
> > example).
> > 
> 
> After testing the results property with the tptp:test and tptp:execution tasks
> using the TPTP-4.6.0-200906041936 build, I am getting mixed results.  As such,
> we need to reevaluate the
> org.eclipse.hyades.test.core.services.AbstractTestExecutionService.beforeLaunch(String)
> method.
> 
> Josh, please use the following for now, which appears to create the execution
> results in the correct directory but without a name (e.g. .execution):
> 
> results="BVT_results\"
> overwrite="false"
> 
> Also, please change the tptp.test.results used in resultsrefid/refid to
> test_results_reference_ID since tptp.test.results is a reserved property name.

When the results property contains only one slash character (e.g. BVT_results/), the org.eclipse.hyades.test.core.services.AbstractTestExecutionService.beforeLaunch(String) method strips off the last slash character and incorrectly interprets as the execution result file name without the file extension (BVT_results/.execution).
Comment 13 Paul Slauenwhite CLA 2009-11-27 18:32:51 EST
The 'results' property have the following meaning (see org.eclipse.hyades.test.core.services.AbstractTestExecutionService.resultsSpecifier):

Optional results property representing the workspace-relative (prefixed with the project name) or project-relative path to the execution histories. Possible path values include:

Directory: 
Directory or path to a directory with a trailing path separator character representing the execution history location. Execution histories are named using the default execution history name (see ExecutionHistoryLaunchConfigurationFacade.getDefaultExecutionHistoryName(ILaunchConfiguration)) for all test executions. For example: 
[\]<directory>\ 
[\][<project name>]\<directory>\ 

File: 
File name or path to a file name with an optional .execution file extension (no trailing path separator character) representing the execution history location and execution history name for all test executions. For example: 
[\]<execution history name>[.execution] 
[\]<directory>\<execution history name>[.execution] 
[\][<project name>]\<directory>\<execution history name>[.execution] 

Notes:

1. The directory structure must exist on the local file system. 
2. Path separator characters are platform-independent (slash ('/') or backslash ('\') characters are interchangeable). 
3. The path may contain an optional leading path separator character. 

Note, the results property does NOT support absolute paths.

The attached patch resolves this defect's symptom and provides a utility class (org.eclipse.hyades.test.core.services.internal.util.ServiceUtil) for resolving containers and file names from service properties.  If the container/directory referenced by the results property does not exist on the local file system, an error is logged and test execution is halted.

Added new JUnit Plug-in test suite (/org.eclipse.hyades.test.core.services.tests/junit_plugin/Test.Execution.ServiceUtilTest.testsuite) for org.eclipse.hyades.test.core.services.internal.util.ServiceUtil (and added to http://wiki.eclipse.org/TPTP_Test_Tools_Project_Tests) and updated /org.eclipse.hyades.test.core.services.tests/manual/Test.Execution.Services.testsuite to test various combinations of the results property.  

The attached patch and test cases checked in to CVS (HEAD).
Comment 14 Paul Slauenwhite CLA 2010-01-06 13:06:32 EST
The fix does not handle file names in the results property.
Comment 15 Paul Slauenwhite CLA 2010-01-06 13:08:51 EST
(In reply to comment #13)
> The 'results' property have the following meaning (see
> org.eclipse.hyades.test.core.services.AbstractTestExecutionService.resultsSpecifier):
> 
> Optional results property representing the workspace-relative (prefixed with
> the project name) or project-relative path to the execution histories. Possible
> path values include:
> 
> Directory: 
> Directory or path to a directory with a trailing path separator character
> representing the execution history location. Execution histories are named
> using the default execution history name (see
> ExecutionHistoryLaunchConfigurationFacade.getDefaultExecutionHistoryName(ILaunchConfiguration))
> for all test executions. For example: 
> [\]<directory>\ 
> [\][<project name>]\<directory>\ 
> 
> File: 
> File name or path to a file name with an optional .execution file extension (no
> trailing path separator character) representing the execution history location
> and execution history name for all test executions. For example: 
> [\]<execution history name>[.execution] 
> [\]<directory>\<execution history name>[.execution] 
> [\][<project name>]\<directory>\<execution history name>[.execution] 
> 
> Notes:
> 
> 1. The directory structure must exist on the local file system. 
> 2. Path separator characters are platform-independent (slash ('/') or backslash
> ('\') characters are interchangeable). 
> 3. The path may contain an optional leading path separator character. 
> 
> Note, the results property does NOT support absolute paths.
> 

Instead, see the variable JavaDoc comment for
org.eclipse.hyades.test.core.services.AbstractTestExecutionService.resultsSpecifier.
Comment 16 Paul Slauenwhite CLA 2010-01-06 13:12:44 EST
Created attachment 155434 [details]
Patch.
Comment 17 Paul Slauenwhite CLA 2010-01-06 13:13:14 EST
Updated the following test suites to include all possible values for the results property:

/org.eclipse.hyades.test.core.services.tests/junit_plugin/Test.Execution.ServiceUtilTest.testsuite

/org.eclipse.hyades.test.core.services.tests/manual/Test.Execution.Services.testsuite

The attached patch checked in to CVS (HEAD).
Comment 18 Paul Slauenwhite CLA 2010-01-06 13:22:23 EST
(In reply to comment #13)
> The attached patch resolves this defect's symptom and provides a utility class
> (org.eclipse.hyades.test.core.services.internal.util.ServiceUtil) for resolving
> containers and file names from service properties.  If the container/directory
> referenced by the results property does not exist on the local file system, an
> error is logged and test execution is halted.

Changed files include:

/org.eclipse.hyades.test.core/src/org/eclipse/hyades/test/core/services/internal/util/ServiceUtil.java (1.1)

/org.eclipse.hyades.test.core/src/org/eclipse/hyades/test/core/services/AbstractTestExecutionService.java (1.36)
Comment 19 Joel Cayne CLA 2010-03-10 14:18:23 EST
Closing.