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

Bug 274729

Summary: [tests] [misc] Fix and re-enable failing tests from test plug-ins
Product: [WebTools] JSDT Reporter: David Carver <d_a_carver>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: CLOSED WONTFIX QA Contact: Chris Jaun <cmjaun>
Severity: normal    
Priority: P3 CC: cmjaun, Konstantin.Scheglov, peter.liu, remy.suen, vrubezhny, zulus
Version: 3.1Keywords: helpwanted
Target Milestone: Future   
Hardware: PC   
OS: All   
Whiteboard:

Description David Carver CLA 2009-05-02 11:38:33 EDT
A recent newsgroup entry [1] brought up that it isn't clear what tests are valid and which tests are either invalid or just plain extraneous.   I suspect many of the tests that aren't run are hold overs from JDT.   It would help the user community if we could do the following:

1. Clean out any tests that aren't JSDT specific.

2. Address JSDT tests that are failing but aren't included in the test suite.

3. Add additional tests where needed to help complete the code coverage.

[1] http://www.eclipse.org/newsportal/article.php?id=18662&group=eclipse.webtools#18662
Comment 1 Konstantin Scheglov CLA 2009-05-02 11:54:39 EDT
I want to use JSDT DOM, so I tried to run org.eclipse.wst.jsdt.core.tests.RunDOMTests

Tests: 2600, Errors: 662, Failures 1042

Eclipse package: eclipse-jee-ganymede-SR2-win32.zip 
Version: 3.4.2
Build id: M20090211-1700

I see no compilation error in org.eclipse.wst.jsdt.core, so probably it can be used with Eclipse 3.4.2. No?

I use JSDT from CVS.
Should I get it from SVN?
I've tried, but can not do this.
Comment 2 David Carver CLA 2009-05-02 12:05:14 EDT
All code is in CVS, WTP doesn't use SVN.
Comment 3 Peter Liu CLA 2009-05-04 16:45:20 EDT
I will be glad to help out. But I'm 100% green in running unit tests
on WTP. Could you please direct me to the procedure of running the tests?
I've downloaded Eclipse Test Framework and the Automated Test zip
under 3.1M6 Stable Build. I will appreciate it very much if you may
direct me to the next step. Thanks.
Comment 4 David Carver CLA 2009-05-04 21:06:01 EDT
(In reply to comment #3)
> I will be glad to help out. But I'm 100% green in running unit tests
> on WTP. Could you please direct me to the procedure of running the tests?
> I've downloaded Eclipse Test Framework and the Automated Test zip
> under 3.1M6 Stable Build. I will appreciate it very much if you may
> direct me to the next step. Thanks.
> 

Peter, it's fairly simple to run the tests.   Check out the JSDT test plugins from the sourceediting/tests module in CVS.   The tests are going to be located under the SRC folder, in the various packages under there.

The tests usually have the word Test in the class name.   These all need to be run as Plugin tests.  So select the Test class you want to run, right click on it and select Run As->Junit Plugin Test

This will launch a separate instance of eclipse and start running the tests.  The tests will show up in the Junit View of the eclipse application that launched the tests. 

Hope this helps get you started.  Post back here if you run into problems running the tests.
Comment 5 Peter Liu CLA 2009-05-05 13:38:54 EDT
Dave, Thanks for your help. I've got it running on the WTP development platform.
I ran RunFormatterTests.java. The JUnit view shows 566 Failures and 4 Errors out of 738 Runs. Do you have any suggestions how we may proceed toward the goals that you've stated in this Bug Report? 

Peter.
Comment 6 David Carver CLA 2009-05-05 13:48:43 EDT
I'm not the JSDT expert I leave that to Nitin's area.  But I'd start be determining why those tests are failing, and why only 4 are passing.   Post findings here, and we may need additional bugs opened.

Comment 7 Nitin Dahyabhai CLA 2009-05-05 14:17:04 EDT
The suite dictated by the test.xml is the one that gets run with the build; I don't think we ever just right-click on a project and run all of the tests in it.

I suspect that in the formatting tests weren't included in the suite referenced by the test.xml file when it was created, and I've just never gone back and updated them.  It's questionable whether they were updated for the JavaScript syntax at all versus Java's, but the best outcome would be to eventually correct every last one of them and have them as valid tests going forward.  I'd rather they be there and failing when run this way, for now, than removed and forgotten.

Not that I'm volunteering anyone else to do so, as help would be appreciated.
Comment 8 Dawid Pakula CLA 2013-10-28 15:26:48 EDT
Is there any plan to clean up tests?

If they will be fixed, is this possible to move it into central repo, for easier patch creation?

If none plan fix this, I can take care of it in next month ;)
Comment 9 Chris Jaun CLA 2013-10-28 15:50:30 EDT
There are no plans to re-enable any additional tests. If there are ones you'd like to do, or add, please feel free.

All the test plugins are in the git repositories just like the rest of JSDT.
Comment 10 Victor Rubezhny CLA 2016-09-19 18:14:27 EDT
Closed as outdated