Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 430938

Summary: Need to clarify how some tests are desired to be ran
Product: [Eclipse Project] Platform Reporter: David Williams <david_williams>
Component: RelengAssignee: David Williams <david_williams>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P2 CC: curtis.windatt.public, jarthana, manoj.palat, Michael_Rennie
Version: 4.4   
Target Milestone: 4.6   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on: 437069    
Bug Blocks:    

Description David Williams CLA 2014-03-22 14:18:09 EDT
I am fixing (at least, what I think is fixing) some of the overall "test.xml" variables, and how they handle running tests when various, specific VMs are available. 

And, I'm assuming some of the comments or logic in test.xml are either wrong, or unclear. So, this bug is to clarify what is desired and then I can fix documentation or logic depending on the answers. 

The question applies to these test bundles: 

org.eclipse.jdt.apt.tests
org.eclipse.jdt.apt.pluggable.tests
org.eclipse.jdt.compiler.tool.tests
org.eclipse.jdt.compiler.apt.tests
org.eclipse.pde.api.tools.tests

Since most apply to "jdt", that's where I will open the bug ... but the last one is a "PDE Question", I assume.

BTW, it may make it easier to answer if you know that my "fix" is to "assign" the variables such as J2SE-5.0 if there is a Java 5 VM, _or higher_ (previously, in some use cases, J2SE-5.0 would only be assigned if someone "externally" set J2SE-5.0. This means, basically, that we now (and, I think for some time) have been running all the tests with the same VM ... but some of the comments imply a test should be ran only if one specific level is available and defined.  I could "fix" things, so that multiple VMs could be defined and different levels used to run different tests, and if a test did not say, it'd simply be ran with the "default" (highest) VM defined -- but, I need to know what's desired, first.  

So, again, point is simply to clarify what's desired, then I can fix comments (or logic, if intent is to really run tests with different, specific VM levels) or to skip them, if that specific level is not defined. In intuition is that a lot of this is "left over" and "hacked up beyond recognition" once we started to move from Java 4 to Java 5 ... but, not sure. It is also possible something was lost in the transition from Kim to me, and in the transition of running on IBM machines, to running on "build.eclipse.org". 

In any case, pretty sure some will need to have logic "fixed" due to their "not defined" logic with their list of "or conditions" ... and in any case, a good time to better document what's desired. 

Case 1: 

  <target
    name="jdtapt"
    depends="setJVMProperties">
    <property
      name="jvm"
      value="${J2SE-5.0}" />
    <!--only run test if J2SE-5.0 property  set-->
    <condition property="skip.test">
      <not>
        <isset property="J2SE-5.0" />
      </not>
    </condition>
    <runTests testPlugin="org.eclipse.jdt.apt.tests" />
  </target>
  
*  I'm assuming this means to run the tests, if Java 6 or higher is available? And comment needs to be fixed?

Case 2: 

  <target
    name="jdtaptpluggable"
    depends="setJVMProperties">
    <property
      name="jvm"
      value="${J2SE-6.0}" />
    <!--only run test if J2SE-5.0 property  set-->
    <condition property="skip.test">
      <not>
        <or>
          <isset property="J2SE-6.0" />
          <isset property="J2SE-7.0" />
          <isset property="J2SE-8.0" />
        </or>
      </not>
    </condition>
    <runTests testPlugin="org.eclipse.jdt.apt.pluggable.tests" />
  </target>
  
*  I'm not sure what this means ... the "logic" of it is to literally run tests only if J2SE-6.0, but that contradicts comment, and the "skip.test" logic. 

Case 3: 

  <target
    name="jdtcompilertool"
    depends="setJVMProperties">
    <property
      name="jvm"
      value="${J2SE-6.0}" />
    <!--only run test if J2SE-6.0 property or greater is set-->
    <condition property="skip.test">
      <not>
        <or>
          <isset property="J2SE-6.0" />
          <isset property="J2SE-7.0" />
          <isset property="J2SE-8.0" />
        </or>
      </not>
    </condition>
    <runTests testPlugin="org.eclipse.jdt.compiler.tool.tests" />
  </target>


* Similar to case 2. 

Case 4:

  <target
    name="jdtcompilerapt"
    depends="setJVMProperties">
    <property
      name="jvm"
      value="${J2SE-6.0}" />
    <!--only run test if J2SE-6.0 property or greater is set-->
    <condition property="skip.test">
      <not>
        <or>
          <isset property="J2SE-6.0" />
          <isset property="J2SE-7.0" />
          <isset property="J2SE-8.0" />
        </or>
      </not>
    </condition>
    <runTests testPlugin="org.eclipse.jdt.compiler.apt.tests" />
  </target>

* Similar to case 3 and 2. 


Case 5: 

  <target
    name="pdeapitooling"
    depends="setJVMProperties">
    <property
      name="jvm"
      value="${J2SE-5.0}" />
    <!--only run test if J2SE-5.0 property  set-->
    <condition property="skip.test">
      <not>
        <isset property="J2SE-5.0" />
      </not>
    </condition>
    <runTests testPlugin="org.eclipse.pde.api.tools.tests" />
  </target>

* Similar to case 1 -- I assume means run the tests if Java 5 or higher is available?
Comment 1 David Williams CLA 2014-03-22 14:19:05 EDT
Adding Curtis and Michael for the PDE case.
Comment 2 Curtis Windatt CLA 2014-03-25 14:40:30 EDT
The API Tools test suite has Java 5 specific tests, Java 7 specific tests and Java 8 specific tests.  The Java 5 and Java 7 usage test suite checks what VM is running and will exclude tests that cannot be run on that VM.

API Tools should be run on highest available.
Comment 3 Manoj N Palat CLA 2014-03-26 04:40:22 EDT
case 2, 3 and 4: This should be run at a level greater than or equal to 1.6
Jay: Any more comments?
Comment 4 Jay Arthanareeswaran CLA 2014-03-26 06:43:52 EDT
For case 1, the logic should be "when Java 5 or above is available".
Comment 5 Manoj N Palat CLA 2014-07-17 07:09:49 EDT
since the queries for jdt have been answered, and the remaining one is for PDE, moving this to PDE for comments
Comment 6 David Williams CLA 2014-07-17 10:03:33 EDT
Since Curtis answered PDE question in comment 2, I'll move back to "releng" to see where this stands ... comes at a good time, since I'm doing other "cleanup" there.
Comment 7 David Williams CLA 2014-07-17 10:05:16 EDT
Will put changes into Mars stream first, but probably will want to backport this, to keep this level of our infrastructure the same between streams.
Comment 8 David Williams CLA 2014-10-26 17:43:22 EDT
Enough other issues with tests ... I'll postpone this once again.
Comment 9 David Williams CLA 2014-12-02 11:33:31 EST
Still too focused on other issues to give this attention, so deferring.
Comment 10 David Williams CLA 2016-05-07 23:43:24 EDT
Marking as "won't fix", since no real changes took place. This bug, in general, has become increasing irrelevant, as Java 8 is required for nearly all tests. 

I will not actively remove the mechanism to have different levels of Java used, but if/when that is desired, it may or may not work (simply since has not been used for a long time, so some things may have been "broken" by accident).