diff --git a/Build/setup_glass.py b/Build/setup_glass.py index a272e43748..d545b9be83 100644 --- a/Build/setup_glass.py +++ b/Build/setup_glass.py @@ -146,6 +146,16 @@ def get_test_console_app(): print(f"Error: Test console app not found at {test_console_app}") exit(1) +def restore_glass_newtonsoft_json(): + source = os.path.join(glass_debugger_dir, "Newtonsoft.Json.dll") + target = os.path.join(glass_dir, "Newtonsoft.Json.dll") + + if not os.path.exists(source): + print(f"Error: Glass-compatible Newtonsoft.Json.dll not found at {source}") + exit(1) + + shutil.copy(source, target) + def copy_ptvs_output(build_output_dir: str | None = None): # Copy the PythonTests folder into the glass directory print(f"Copying PythonTests from {python_tests_source_dir} to {python_tests_target_dir}") @@ -174,6 +184,10 @@ def copy_ptvs_output(build_output_dir: str | None = None): print(f) exit(1) + # VSIX extraction can overwrite the runner root with an older Newtonsoft.Json. + # Glass.TestAdapter.dll is compiled against the copy from the Glass drop. + restore_glass_newtonsoft_json() + # Whenever we copy new bits, we have to regenerate the Python.GlassTestGroup file generate_python_version_props(build_output_dir) @@ -306,7 +320,9 @@ def generate_python_version_props(build_output_dir: str | None): def main(build_output_dir: str | None = None): get_drop_exe() get_glass() + get_test_console_app() + copy_ptvs_output(build_output_dir) generate_python_version_props(build_output_dir) verify_listing() diff --git a/Build/templates/run_tests.yml b/Build/templates/run_tests.yml index 860881b0ea..17ca41f443 100644 --- a/Build/templates/run_tests.yml +++ b/Build/templates/run_tests.yml @@ -63,11 +63,11 @@ steps: Copy-Item -Path "$source\*" -Destination $dest -Recurse -Force displayName: 'Copy binaries to expected location' - - task: CacheBeta@2 + - task: Cache@2 displayName: 'Restore glass binaries from cache' condition: eq('${{ parameters.skipGlassCache }}', 'false') inputs: - key: 'glass' + key: 'glass | Build/setup_glass.py' path: '$(Build.SourcesDirectory)\GlassTests' cacheHitVar: 'CACHE_RESTORED' @@ -121,9 +121,9 @@ steps: testResultsFormat: 'VSTest' failTaskOnFailedTests: true - - task: CacheBeta@2 + - task: Cache@2 displayName: 'Cache glass binaries' condition: and(succeeded(), or(eq(variables['CACHE_RESTORED'], 'false'), eq('${{ parameters.skipGlassCache }}', 'true'))) inputs: - key: 'glass' + key: 'glass | Build/setup_glass.py' path: '$(Build.SourcesDirectory)\GlassTests' diff --git a/Python/Tests/GlassTests/PythonTests/PythonEngine.regdef b/Python/Tests/GlassTests/PythonTests/PythonEngine.regdef index 944d2b7679..63c38caef7 100644 --- a/Python/Tests/GlassTests/PythonTests/PythonEngine.regdef +++ b/Python/Tests/GlassTests/PythonTests/PythonEngine.regdef @@ -16,20 +16,20 @@ Windows Registry Editor Version 5.00 "HitCountBP"=dword:00000000 "JustMyCodeStepping"=dword:00000001 "EngineClass"="Microsoft.PythonTools.Debugger.DebugEngine.AD7Engine" -"EngineAssembly"="Microsoft.PythonTools.Debugger, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"EngineAssembly"="Microsoft.PythonTools.Debugger, Version=18.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "LoadProgramProviderUnderWOW64"=dword:00000001 "AlwaysLoadProgramProviderLocal"=dword:00000001 "LoadUnderWOW64"=dword:00000001 [$RootKey$\CLSID\{0DA53AFE-069E-47A3-AE34-32610A8253A3}] -"Assembly"="Microsoft.PythonTools.Debugger, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="Microsoft.PythonTools.Debugger, Version=18.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "Class"="Microsoft.PythonTools.Debugger.DebugEngine.AD7Engine" "InprocServer32"="C:\\windows\\SYSTEM32\\MSCOREE.DLL" "CodeBase"="$GlassInstallDir$\\Microsoft.PythonTools.Debugger.dll" "ThreadingModel"="Free" [$RootKey$\CLSID\{FA452F5D-539E-4B55-BCC6-5DE7E342BC44}] -"Assembly"="Microsoft.PythonTools.Debugger, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="Microsoft.PythonTools.Debugger, Version=18.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "Class"="Microsoft.PythonTools.Debugger.DebugEngine.AD7ProgramProvider" "InprocServer32"="C:\\windows\\SYSTEM32\\MSCOREE.DLL" "CodeBase"="$GlassInstallDir$\\Microsoft.PythonTools.Debugger.dll"