Fix SharedCodeCompletionProviderTests assembly loading for completion data tests#16889
Fix SharedCodeCompletionProviderTests assembly loading for completion data tests#16889Copilot wants to merge 4 commits intomove_python_targetfrom
Conversation
Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com>
|
@copilot The target test is still failing with the same error message |
Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com>
Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com>
The issue was that the DSPythonNet3 assembly wasn't being loaded before SharedCompletionProvider tried to find IExternalCodeCompletionProviderCore implementations. Fixed in 7e49d69 by directly referencing the type ( |
|
|
Re-running the self serve in https://master-5.jenkins.autodesk.com/job/Dynamo/job/DynamoSelfServe/job/pullRequestValidation/19232/ |
|
@copilot Rebase |
Rebase completed successfully onto master (fee9456). The branch has been rebased with all commits preserved:
Unable to force push due to permissions. Please manually force push the branch or grant push permissions. |



The test
SharedCoreCanReturnCLRCompletionDatawas failing withArgumentNullException: Value cannot be null. (Parameter 'source')due to assembly loading issues that preventedSharedCompletionProvider.GetCompletionData()from finding the required implementation.Changes
[SetUp]attribute toSharedCodeCompletionProviderTests.Setup()method to ensure NUnit executes the setup codeDSPythonNet3CodeCompletionProviderCoretype instead of path-based loadingGetCompletionData()result with descriptive error messageRoot Cause
The
SharedCompletionProvideruses reflection to find types implementingIExternalCodeCompletionProviderCorein loaded assemblies. The original code attempted to load the assembly from a file path usingPathManager.BuiltinPackagesDirectory, which doesn't exist or isn't properly configured during test execution. Without the assembly loaded in the AppDomain, the provider couldn't find the implementation and returned null.Solution
By referencing the type directly, the CLR loads the assembly since the test file already imports it with
using DSPythonNet3;. This approach is more reliable than path-based loading because:💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.