Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1485 interaction with code coverage lost

pending
nobody
None
5
2013-04-30
2012-03-16
MatsWolpers
No

The following happened on win 7, using eclipse version: Indigo Service Release 2

While writing status quo documenting tests for a legacy application with Pydev (current download), the code coverage view stopped updating.
Open views were package explorer view, PyUnit view and Code Coverage view open.

Part of the work done was a complete replacement of a file in the PyDev project by another file brought in from the outside (file system level copy, project explorer paste). This triggered a few import error reports, and once they had been dealt with, code coverage view was static.

Refresh, reconfiguring the folder-in-view, closing and reopening the project, closing and reopening eclipse all do nothing to alter the situation.

There is a workaround:
Make a new workspace
Create project infrastructure (source folders and views)
for each folder > mark all files in folder, press ctrl+c
in corresponding folder in new workspace, select paste from right-click-mouse menu
draw source folder into the Code Coverage view,
mark the “enable for new launches” button
run the unit tests and
BINGO

May be there is a hint in that.
I have no idea if this is rooted in PyDev or in the code coverge plugin, and i don't know how to drill down any deeper.
My feeling is that somehow the project information gets screwed up by that file import, but that's just a thought.

If there is anything i should try or trace, please let me know (i will need rather detailed descriptions, but i am willing)
thanks,
mats

Discussion

  • MatsWolpers
    MatsWolpers
    2012-03-17

    update:
    i found this in workspace>/.log:

    !ENTRY org.python.pydev.core 4 4 2012-03-17 10:21:20.015
    !MESSAGE Error: coverage module could not be imported
    Please make sure that the coverage module (http://nedbatchelder.com/code/coverage/)
    is properly installed in your interpreter: C:\Python27\python.exe
    Traceback (most recent call last):
    File "C:\eclipse\plugins\org.python.pydev.debug_2.4.0.2012020116\pysrc\pydev_coverage.py", line 34, in execute
    import coverage #@UnresolvedImport
    ImportError: No module named coverage
    !STACK 0
    java.lang.RuntimeException: Error: coverage module could not be imported
    Please make sure that the coverage module (http://nedbatchelder.com/code/coverage/)
    is properly installed in your interpreter: C:\Python27\python.exe
    Traceback (most recent call last):
    File "C:\eclipse\plugins\org.python.pydev.debug_2.4.0.2012020116\pysrc\pydev_coverage.py", line 34, in execute
    import coverage #@UnresolvedImport
    ImportError: No module named coverage
    at org.python.pydev.core.log.Log.log(Log.java:99)
    at org.python.pydev.debug.codecoverage.PyCoverage.refreshCoverageInfo(PyCoverage.java:203)
    at org.python.pydev.debug.codecoverage.PyCodeCoverageView.executeRefreshAction(PyCodeCoverageView.java:243)
    at org.python.pydev.debug.codecoverage.PyCodeCoverageView$RefreshAction.run(PyCodeCoverageView.java:220)
    at org.python.pydev.utils.ProgressOperation.execute(ProgressOperation.java:48)
    at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
    at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
    at org.python.pydev.utils.ProgressOperation.startAction(ProgressOperation.java:67)
    at org.python.pydev.debug.codecoverage.PyCodeCoverageView.setSelectedContainer(PyCodeCoverageView.java:457)
    at org.python.pydev.debug.codecoverage.PyCodeCoverageView$9.drop(PyCodeCoverageView.java:801)
    at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:90)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:774)
    at org.eclipse.swt.dnd.DropTarget.Drop(DropTarget.java:456)
    at org.eclipse.swt.dnd.DropTarget$3.method6(DropTarget.java:258)
    at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:119)
    at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method)
    at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:363)
    at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:289)
    at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:172)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    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:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

    !ENTRY org.python.pydev.core 4 4 2012-03-17 10:21:28.125
    !MESSAGE No message gotten (null message).
    !STACK 0
    java.lang.NullPointerException
    at org.python.pydev.debug.codecoverage.PyCodeCoverageView.executeRefreshAction(PyCodeCoverageView.java:246)
    at org.python.pydev.debug.codecoverage.PyCodeCoverageView$RefreshAction.run(PyCodeCoverageView.java:220)
    at org.python.pydev.utils.ProgressOperation.execute(ProgressOperation.java:48)
    at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
    at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
    at org.python.pydev.utils.ProgressOperation.startAction(ProgressOperation.java:67)
    at org.python.pydev.debug.codecoverage.PyCodeCoverageView$7$1$1.run(PyCodeCoverageView.java:667)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    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:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

    that looks like it might help.

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2012-03-27

    • status: open --> pending
     
  • Fabio Zadrozny
    Fabio Zadrozny
    2012-03-27

    I've just uploaded a nightly version that fixes the NullPointerException... so, please grab it (that's one of the errors in the error log) -- this would happen whenever you closed/reopened a code-coverage view.

    Now, the other issue you have seems to be because you added the code-coverage module and didn't refresh the interpreter which contained it, so, you can simply remove/re-add your interpreter and it should work again.

    Please let me know if it worked for you.

     
  • MatsWolpers
    MatsWolpers
    2013-04-30

    Apologies for being late to reply, i was, er, severely distracted.
    we never got round to trying your nightly build, but we did upgrade to version 2.5 eventually and never observed this phenomenon again.
    i therefore conclude that the fix works and this ticket may be closed.
    once again, sorry to keep you waiting.
    mats