Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Build/setup_glass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions Build/templates/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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'
6 changes: 3 additions & 3 deletions Python/Tests/GlassTests/PythonTests/PythonEngine.regdef
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down