I don't understand how the plugin would work in parallel mode, though?
Wouldn't you need to have a number of nose invocations running at once?
Each would produce its own data file, right? But with this code, each
would also try to combine the data files? I must be missing something.
My model of parallel mode is that there are two phases: phase 1 is
collecting the data in many processes, each producing one data file.
Phase 2 is combining the files and reporting, and phase 2 can only
happen once all of the phase 1 work is done.
Where have I gone wrong?
--Ned.
Arve, first of all, thanks so much for diving in to make the plugin great. I really appreciate it.
I don't understand how the plugin would work in parallel mode, though? Wouldn't you need to have a number of nose invocations running at once? Each would produce its own data file, right? But with this code, each would also try to combine the data files? I must be missing something. My model of parallel mode is that there are two phases: phase 1 is collecting the data in many processes, each producing one data file. Phase 2 is combining the files and reporting, and phase 2 can only happen once all of the phase 1 work is done.
On Fri, Jun 11, 2010 at 4:09 AM, Ned Batchelder <n...@nedbatchelder.com> wrote:
Arve, first of all, thanks so much for diving in to make the plugin great. I really appreciate it.
I'm the one who should be thanking you for making such a useful tool :)I don't understand how the plugin would work in parallel mode, though? Wouldn't you need to have a number of nose invocations running at once? Each would produce its own data file, right? But with this code, each would also try to combine the data files? I must be missing something. My model of parallel mode is that there are two phases: phase 1 is collecting the data in many processes, each producing one data file. Phase 2 is combining the files and reporting, and phase 2 can only happen once all of the phase 1 work is done.
I think you misunderstand me. It is Coverage.py that is in parallel mode (as controlled by the --cover-parallel-mode option to the plugin), not Nose. In tests, I am spawning child processes that also perform coverage analysis (in parallel mode). It just seems to me the parallel mode of Coverage's test plugin doesn't go all the way, in that it doesn't combine files in phase 2.
Actually, as I was thinking about this, why not have the nose plugin always operate in parallel mode? There's no harm in using it even if you aren't multi-process, it just means the data will get written to an oddly-named file before it is "combined" to .coverage. And it will mean that you don't have to learn about parallel mode if your test suite uses processes, it will just work. There will be a small time penalty when combining the one data file, but that doesn't take long and could even be optimized away.
Am I missing something?