@@ -183,12 +183,16 @@ public void RunTests(IEnumerable<TestCase> tests, IRunContext runContext, IFrame
183183 }
184184 }
185185
186- private void LogTelemetry ( int testCount , bool isDebugging )
186+ private void LogTelemetry ( int testCount , Version nodeVersion , bool isDebugging )
187187 {
188188 var userTask = new UserTaskEvent ( "VS/NodejsTools/UnitTestsExecuted" , TelemetryResult . Success ) ;
189189 userTask . Properties [ "VS.NodejsTools.TestCount" ] = testCount ;
190+ // This is safe, since changes to the ToString method are very unlikely, as the current output is widely documented.
191+ userTask . Properties [ "VS.NodejsTools.NodeVersion" ] = nodeVersion . ToString ( ) ;
190192 userTask . Properties [ "VS.NodejsTools.IsDebugging" ] = isDebugging ;
191193
194+ //todo: when we have support for the Node 8 debugger log which version of the debugger people are actually using
195+
192196 var defaultSession = TelemetryService . DefaultSession ;
193197 defaultSession . PostEvent ( userTask ) ;
194198 }
@@ -221,12 +225,14 @@ private void RunTestCases(IEnumerable<TestCase> tests, IRunContext runContext, I
221225 var testInfo = new NodejsTestInfo ( tests . First ( ) . FullyQualifiedName ) ;
222226 var workingDir = Path . GetDirectoryName ( CommonUtils . GetAbsoluteFilePath ( settings . WorkingDir , testInfo . ModulePath ) ) ;
223227
224- // we can only log telemetry when we're running in VS,
225- // the required assemblies are not on disk, so we have to keep the call in a separate method
226- // this way the .NET framework only loads the assemblies when we actually need them.
228+ var nodeVersion = Nodejs . GetNodeVersion ( settings . NodeExePath ) ;
229+
230+ // We can only log telemetry when we're running in VS.
231+ // Since the required assemblies are not on disk if we're not running in VS, we have to reference them in a separate method
232+ // this way the .NET framework only tries to load the assemblies when we actually need them.
227233 if ( app != null )
228234 {
229- LogTelemetry ( tests . Count ( ) , runContext . IsBeingDebugged ) ;
235+ LogTelemetry ( tests . Count ( ) , nodeVersion , runContext . IsBeingDebugged ) ;
230236 }
231237
232238 foreach ( var test in tests )
0 commit comments