diff --git a/src/DynamoCore/Configuration/ExecutionSession.cs b/src/DynamoCore/Configuration/ExecutionSession.cs index 3848d83cbe3..1231a817d3c 100644 --- a/src/DynamoCore/Configuration/ExecutionSession.cs +++ b/src/DynamoCore/Configuration/ExecutionSession.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using Dynamo.Interfaces; @@ -26,6 +26,7 @@ public ExecutionSession(Scheduler.UpdateGraphAsyncTask updateTask, DynamoModel m parameters[ParameterKeys.LastExecutionDuration] = new TimeSpan(updateTask.ExecutionEndTime.TickCount - updateTask.ExecutionStartTime.TickCount); parameters[ParameterKeys.PackagePaths] = pathManager.PackagesDirectories; parameters[ParameterKeys.Logger] = model.Logger; + parameters[ParameterKeys.PreferenceFilePath] = pathManager.PreferenceFilePath; } /// diff --git a/src/NodeServices/ExecutionSession.cs b/src/NodeServices/ExecutionSession.cs index 9013a50d2c8..363951ec445 100644 --- a/src/NodeServices/ExecutionSession.cs +++ b/src/NodeServices/ExecutionSession.cs @@ -81,6 +81,10 @@ public class ParameterKeys /// The return value is an ILogger /// public static readonly string Logger = nameof(Logger); - + + /// + /// The path to the preference file that is being used by Dynamo. + /// + public static readonly string PreferenceFilePath = nameof(PreferenceFilePath); } } diff --git a/test/DynamoCoreTests/Configuration/ExecutionSessionTests.cs b/test/DynamoCoreTests/Configuration/ExecutionSessionTests.cs index e968f919e73..d7edbffd5c6 100644 --- a/test/DynamoCoreTests/Configuration/ExecutionSessionTests.cs +++ b/test/DynamoCoreTests/Configuration/ExecutionSessionTests.cs @@ -10,6 +10,7 @@ class ExecutionSessionTests : DynamoModelTestBase { private TimeSpan lastExecutionDuration = new TimeSpan(); private IEnumerable packagePaths; + private string preferenceFilePath; protected override void GetLibrariesToPreload(List libraries) { @@ -38,18 +39,19 @@ public void TestExecutionSession() [Test] [Category("UnitTests")] - public void TestExecutionSessionPackagePaths() + public void TestExecutionSessionPaths() { ExecutionEvents.GraphPreExecution += ExecutionEvents_GraphPreExecution; RunModel(@"core\HomogeneousList\HomogeneousInputsValid.dyn"); - Assert.IsNotEmpty(packagePaths, "packgePaths was empty"); + Assert.IsNotEmpty(packagePaths, "packagePaths was empty"); + Assert.IsNotEmpty(preferenceFilePath, "preferenceFilePath was empty"); ExecutionEvents.GraphPreExecution -= ExecutionEvents_GraphPreExecution; } private void ExecutionEvents_GraphPreExecution(Session.IExecutionSession session) { packagePaths = ExecutionEvents.ActiveSession.GetParameterValue(Session.ParameterKeys.PackagePaths) as IEnumerable; - + preferenceFilePath = ExecutionEvents.ActiveSession.GetParameterValue(Session.ParameterKeys.PreferenceFilePath) as string; } [OneTimeTearDown]