Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318444 - Egit core tests: improve test coverage
Summary: Egit core tests: improve test coverage
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 0.9.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.9.0-M3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-30 07:30 EDT by Matthias Sohn CLA
Modified: 2010-08-30 09:01 EDT (History)
3 users (show)

See Also:


Attachments
egit core test coverage (29.21 KB, image/png)
2010-06-30 08:08 EDT, Matthias Sohn CLA
no flags Details
Updated coverage (50.75 KB, image/png)
2010-07-07 03:18 EDT, Mathias Kinzler CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Sohn CLA 2010-06-30 07:30:55 EDT
We need to improve test coverage on egit core.
Comment 1 Matthias Sohn CLA 2010-06-30 07:55:14 EDT
Measured test coverage of org.eclipse.egit.core.test on egit 2d78011a

Element	                                Coverage	Covered Instructions	Total Instructions
plugin org.eclipse.egit.core            23.6 %	        2664	                11296

packages
org.eclipse.egit.core	                29.7 %	        376	                1267
org.eclipse.egit.core.internal	         0.0 %	          0	                 24
org.eclipse.egit.core.internal.storage	33.7 %	        388	               1150
org.eclipse.egit.core.internal.trace	22.5 %	         39	                173
org.eclipse.egit.core.internal.util	48.3 %	        145	                300
org.eclipse.egit.core.op	        14.1 %	        720	               5114
org.eclipse.egit.core.project	        72.7 %	        996	               1370
org.eclipse.egit.core.synchronize	 0.0 %	          0	               1616
org.eclipse.egit.core.synchronize.dto	 0.0 %	          0	                282


Especially egit operations need better test coverage, here current coverage on egit 2d78011a

Element	                        Coverage	Covered Instructions	Total Instructions
org.eclipse.egit.core.op	14.1 %	        720	                5114

AddToIndexOperation.java	0.0 %	          0	                 239
AssumeUnchangedOperation.java	0.0 %	          0	                 255
BranchOperation.java	        69.9 %	        281	                 402
CloneOperation.java	        0.0 %	          0	                 374
CommitOperation.java	        0.0 %	          0	                 630
ConnectProviderOperation.java	66.4 %	        142	                 214
DiscardChangesOperation.java	0.0 %	          0	                 350
DisconnectProviderOperation.java 0.0 %	          0	                 136
ListRemoteOperation.java	0.0 %	          0	                  96
MergeOperation.java	        0.0 %	          0	                 205
PushOperation.java	        0.0 %	          0	                 224
PushOperationResult.java	0.0 %	          0	                 349
PushOperationSpecification.java	0.0 %	          0	                  32
ResetOperation.java	       70.0 %	        297	                 424
TagOperation.java	        0.0 %	          0	                 150
TrackOperation.java	        0.0 %	          0	                 339
UntrackOperation.java	        0.0 %	          0	                 236
UpdateOperation.java	        0.0 %	          0	                 459
Comment 2 Matthias Sohn CLA 2010-06-30 08:08:06 EDT
Created attachment 173080 [details]
egit core test coverage
Comment 3 Mathias Kinzler CLA 2010-07-07 03:16:05 EDT
Code review at 

http://egit.eclipse.org/r/#change,1074

Resulting coverage:

Element	Coverage	Covered Instructions	Total Instructions
org.eclipse.egit.core	50,7 %	5787	11412
src	50,7 %	5787	11412
org.eclipse.egit.core	49,2 %	623	1267
org.eclipse.egit.core.internal	0,0 %	0	24
org.eclipse.egit.core.internal.storage	33,7 %	388	1150
org.eclipse.egit.core.internal.trace	22,5 %	39	173
org.eclipse.egit.core.internal.util	61,3 %	184	300
org.eclipse.egit.core.op	49,4 %	2584	5230
AddToIndexOperation.java	0,0 %	0	239
AssumeUnchangedOperation.java	0,0 %	0	255
BranchOperation.java	69,9 %	281	402
CloneOperation.java	75,9 %	284	374
CommitOperation.java	65,6 %	443	675
ConnectProviderOperation.java	66,4 %	142	214
DiscardChangesOperation.java	70,6 %	247	350
DisconnectProviderOperation.java	63,2 %	86	136
ListRemoteOperation.java	89,6 %	86	96
MergeOperation.java	0,0 %	0	221
PushOperation.java	60,2 %	168	279
PushOperationResult.java	11,2 %	39	349
PushOperationSpecification.java	100,0 %	32	32
ResetOperation.java	70,0 %	297	424
TagOperation.java	81,3 %	122	150
TrackOperation.java	58,4 %	198	339
UntrackOperation.java	67,4 %	159	236
UpdateOperation.java	0,0 %	0	459
org.eclipse.egit.core.project	73,9 %	1013	1370
org.eclipse.egit.core.synchronize	48,8 %	789	1616
org.eclipse.egit.core.synchronize.dto	59,2 %	167	282
Comment 4 Mathias Kinzler CLA 2010-07-07 03:18:53 EDT
Created attachment 173621 [details]
Updated coverage
Comment 5 Robin Rosenberg CLA 2010-07-08 17:42:59 EDT
org.eclipse.egit.core--All-Tests
org.eclipse.egit.core.synchronize.GitSyncInfoTest
shouldReturnResourceFileInSync(org.eclipse.egit.core.synchronize.GitSyncInfoTest)
java.nio.channels.ClosedByInterruptException
	at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:184)
	at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:209)
	at org.eclipse.jgit.lib.GitIndex.write(GitIndex.java:282)
	at org.eclipse.egit.core.synchronize.GitSyncInfoTest.stage(GitSyncInfoTest.java:720)
	at org.eclipse.egit.core.synchronize.GitSyncInfoTest.stageAndCommit(GitSyncInfoTest.java:708)
	at org.eclipse.egit.core.synchronize.GitSyncInfoTest.shouldReturnResourceFileInSync(GitSyncInfoTest.java:94)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication$1.run(UITestApplication.java:116)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3527)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3174)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication.start(UITestApplication.java:47)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

org.eclipse.egit.core.test.op.PushOperationTest
testPush(org.eclipse.egit.core.test.op.PushOperationTest)
java.lang.AssertionError: expected:<OK> but was:<UP_TO_DATE>
	at org.junit.Assert.fail(Assert.java:91)
	at org.junit.Assert.failNotEquals(Assert.java:645)
	at org.junit.Assert.assertEquals(Assert.java:126)
	at org.junit.Assert.assertEquals(Assert.java:145)
	at org.eclipse.egit.core.test.op.PushOperationTest.testPush(PushOperationTest.java:159)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication$1.run(UITestApplication.java:116)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3527)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3174)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication.start(UITestApplication.java:47)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

org.eclipse.egit.core.test.op.TrackUntrackOperationTest
testTrackFiles(org.eclipse.egit.core.test.op.TrackUntrackOperationTest)
java.lang.AssertionError: Wrong cache entry count expected:<0> but was:<2>
	at org.junit.Assert.fail(Assert.java:91)
	at org.junit.Assert.failNotEquals(Assert.java:645)
	at org.junit.Assert.assertEquals(Assert.java:126)
	at org.junit.Assert.assertEquals(Assert.java:470)
	at org.eclipse.egit.core.test.op.TrackUntrackOperationTest.testTrackFiles(TrackUntrackOperationTest.java:95)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication$1.run(UITestApplication.java:116)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3527)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3174)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication.start(UITestApplication.java:47)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

The GitSyncInfoTest failure is probably not attributed to the patch from this bug and it is intermittent.

The other two fail consistently on Eclipse 3.6 when the whole test suite is executed.
Comment 6 Mathias Kinzler CLA 2010-07-09 04:39:53 EDT
Code review at
http://egit.eclipse.org/r/#change,1086
With this, I was able to run the suite successfully (both with and without "clean workspace" flag).
What I still got was some Exceptions saying that some jobs were still running after workbench shutdown, but I think they're not related.
Comment 7 Stefan Lay CLA 2010-08-27 05:44:47 EDT
Coverage was improved.