--On Thursday, November 03, 2005 1:05 PM -0800 Dan Black <[EMAIL PROTECTED]>
wrote:
I have installed an instance of the hackystat server and have the junit sensor
installed. However, when I execute the junit tests, the data is saved on the
hackystat
data share without a project association. When I view this data in the daily
diary the
project column is empty. Because of this I have been unable to build reports
for this
data. How do I make sure sensor data is associated (log) as belonging to a
particular
project or group of projects.
Here's the short answer:
(1) Install LOCC and the LOCC sensor, run it over your code based to generate FileMetric
data and send it to an account in the same Hacksytat project as the JUnit data.
(2) Adjust your workspace roots if necessary.
(3) The JUnit data should now show up in your Project reports.
Here's the long answer:
The basic way that Hackystat associates sensor data with a project is by checking three
types of information:
(1) The user sending the data. That user must be a member of the project.
(2) The workspace (i.e. platform-independent file path) associated with the data. The
workspace associated with the sensor data must be listed as associated with the project.
(3) The time interval. The timestamp associated with the data must fall into the time
interval defined for the project.
When we originally implemented the UnitTest sensor data type, we were working with Java,
and we were interested in a development scenario where unit testing referred to the
contents of a .jar file containing the test classes, but the file path associated with
the jar file was arbitrary or irrelevant. As a result, we implemented (what we now
recognize to be a bogus) non-standard approach to processing UnitTest data:
- The UnitTest sensor data provides just the fully qualified class name associated with
the test.
- From FileMetric data, which includes both a fully qualified class name and a file path,
the server builds a "workspace map" that can determine the workspace given a fully
qualified class name.
- To figure out the workspace associated with the UnitTest data, the server consults the
workspace map.
What we really should have done is build a sensor for JUnit data that provides the file
path when it can, and only uses the workspace map mechanism in the special case where the
filepath associated with the test class is uninformative. We are aware of this problem,
and it's a high priority to fix after 7.0 is released.
In the interim, the workaround is to run LOCC and the LOCC sensor over your code base
regularly, so that the server can construct a workspace map that contains all of the
classes and their associated file paths, such that that UnitTest references to fully
qualified class names can be resolved to a file path and thus to a workspace.
By the way, another improvement for post-7.0 is the creation of a sensor for SCLC, a
multi-language code counting tool. This will facilitate the ability to do telemetry on
the size and changes in .java, .jsp, .xml, .cc, etc.
Cheers,
Philip