glass-tests
Skill2.6k starsChanged 6 months agoApache-2.0View on GitHub
Use when working with PTVS Glass tests: setup_glass.py, run_glass.py, Glass.TestAdapter, Newtonsoft.Json assembly mismatches, Azure Pipelines Glass cache, TestScript.xml, glass2.exe, and mixed-mode Python debugger tests.
Trending
Quiet this year.about the whole repository
Who's talking about microsoft/PTVS
- A Hacker News story“Python Tools for Visual Studio Now on GitHub”Hacker News · May 17, 2015 · 48 points
- microsoft/python-language-server“Implement detection and reporting of unused imports”GitHub · Aug 31, 2018 · 8 reactions
- microsoft/python-language-server“Support PEP comment type hints”GitHub · Aug 31, 2018 · 5 reactions
- UCE-group/fortnightly-plan“【FP】2017年暑期-第1-2周-杨磊”GitHub · Jul 22, 2017 · 4 reactions
- pypa/pip“Upgrading pip fails on Windows when install path is too long”GitHub · Aug 24, 2015 · 3 reactions
The biggest 5 of 17 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 17
Talked about on GitHub and Hacker News (17 times).
On GitHub · 15
- Aug 31, 2018Implement detection and reporting of unused imports — microsoft/python-language-server8 reactions · 7 comments
- Aug 31, 2018Support PEP comment type hints — microsoft/python-language-server5 reactions · 5 comments
- Jul 22, 2017【FP】2017年暑期-第1-2周-杨磊 — UCE-group/fortnightly-plan4 reactions · 1 comment
- Aug 24, 2015Upgrading pip fails on Windows when install path is too long — pypa/pip3 reactions · 39 comments
- Jul 12, 2019Investigate: Unable to find threadStateIndex for the current thread. curPyThread: 0x7fd48ec095c0 — microsoft/ptvsd2 reactions · 12 comments
10 more on GitHub
- Aug 31, 2018Support completion in { } in f-strings — microsoft/python-language-server2 reactions · 4 comments
- Nov 2, 2022Allow pasting Excel cells into Python as lists — microsoft/vscode-python1 reaction · 2 comments
- Dec 2, 2021PublishSymbols@2 task is failing with authentication errors — microsoft/azure-pipelines-tasks1 reaction · 1 comment
- Oct 15, 2021Error in Visual Studio when formatting with no newline at end of file — psf/black1 reaction · 5 comments
- Feb 28, 2019Handle beginning of list in span list search — microsoft/nodejstools1 reaction · 1 comment
- Dec 2, 2018Code lenses disappear when debugging tests with sys.exit(0) — microsoft/vscode-python1 reaction · 3 comments
- Nov 16, 2018sys.stdin not None and missing encoding attribute when running with pythonw.exe — microsoft/ptvsd1 reaction
- Nov 14, 2018Don't modify the DDG scope when analyzing the comprehension — microsoft/python-language-server1 reaction · 2 comments
- Aug 31, 2018No completions on namedtuple — microsoft/python-language-server1 reaction · 1 comment
- Jun 21, 2018Add typeshed submodule and handle it for the LS — DonJayamanne/pythonVSCode1 reaction · 1 comment
On Hacker News · 2
- May 17, 2015Python Tools for Visual Studio Now on GitHub48 points · 18 comments
- Apr 16, 2015Microsoft python tools for visual studio on GitHub2 points
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Use this skill when setting up, running, debugging, or investigating CI failures for PTVS Glass tests.
- Distinctive: line 27
Prefer passing the build output explicitly, especially for VS 18 builds:
- Distinctive: line 33
If setup needs internal drop access, provide an auth token environment variable or allow the interactive credential flow:
- Distinctive: line 45
Run all tests or a single test:
- Very specific: line 54
Start with the PR log and TestResults/PythonTests.trx.
- Very specific: line 59
Check Build/templates/run_tests.yml to see whether GlassTests came from cache.
- Very specific: line 61
Do not assume a PTVS NuGet restore or package update will fix Glass runner dependency conflicts.
- Very specific: line 68
Look for generated logs, dumps, and copied debuggee files under the runtime GlassTests\PythonTests\...\obj\<configuration>\ and …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PTVS Glass Tests
When to Use
Use this skill when setting up, running, debugging, or investigating CI failures for PTVS Glass tests. Glass tests exercise Visual Studio debugger behavior, including mixed-mode Python/native scenarios, and require Microsoft-internal drops for the Glass runner.
Link to existing human-facing documentation instead of duplicating it. Start with Python/Tests/GlassTests/readme.txt, which links the internal Concord Glass docs and presentation.
Key Files
- Build/setup_glass.py: downloads
drop.exe, Glass, NuGet tools, and vstest drops; extracts VSIX payloads; copies PTVS debugger bits; discovers installed Python versions; generates.GlassTestPropsfiles; verifies the test listing. - Build/run_glass.py: calls
copy_ptvs_output(), verifies the runtime test root, and invokesvstest.console.exewith/Paralleland TRX logging. - Build/templates/run_tests.yml: installs Python versions, restores or populates the
GlassTestscache, acquires the Azure DevOps token, runs setup, runs tests, and publishes TRX results. - Python/Tests/GlassTests/PythonTests/PythonConcord.GlassTestRoot: root Glass test configuration.
Python/Tests/GlassTests/PythonTests/**/TestScript.xml: individual debugger test scripts with commands, expected events, breakpoints, and source expectations.GlassTests/: generated/runtime directory for downloaded Glass bits and copied tests; do not treat it as the source of truth for test definitions.
Local Workflow
- Build PTVS first so the chosen build output contains
EnvironmentDiscover.exe,Microsoft.Python*, andDkmDebu*files. Prefer passing the build output explicitly, especially for VS 18 builds:
python Build\setup_glass.py --buildOutput BuildOutput\Debug18.0\raw\binariesIf setup needs internal drop access, provide an auth token environment variable or allow the interactive credential flow:
python Build\setup_glass.py --authTokenVariable SYSTEM_ACCESSTOKEN --buildOutput <path-to-raw-binaries>List discovered tests after setup:
python Build\setup_glass.py --verifyListingRun all tests or a single test:
python Build\run_glass.py --buildOutput BuildOutput\Debug18.0\raw\binaries python Build\run_glass.py --buildOutput BuildOutput\Debug18.0\raw\binaries Repr_Bytes-311-64
CI Failure Workflow
- Start with the PR log and
TestResults/PythonTests.trx. - Classify the failure:
- Setup/drop/auth failure before
vstest.console.exestarts. - Discovery/adapter failure after
vstest.console.exestarts but before individual tests run. glass2.exeorTestScript.xmlfailure inside a specific test case.
- Setup/drop/auth failure before
- Check Build/templates/run_tests.yml to see whether
GlassTestscame from cache. Cache hits skipsetup_glass.py, butrun_glass.pystill callscopy_ptvs_output(). - For assembly binding errors, inspect every
Newtonsoft.Json.dllunderGlassTestsand compare assembly versions.Glass.TestAdapter.dllexpectsNewtonsoft.Json, Version=13.0.0.0; NuGet/vstest VSIX extraction can place older 9.x or 10.x copies in the runner tree. The compatible copy usually comes fromGlassTests\Glass\Newtonsoft.Json.dll. - Do not assume a PTVS NuGet restore or package update will fix Glass runner dependency conflicts. The failing assembly may come from downloaded Glass/NuGet/vstest VSIX payloads, not from
packages/.
Debugging TestScript Failures
- Reproduce one test at a time with
python Build\run_glass.py --buildOutput <path> <test-name>. - Inspect the failing test's
TestScript.xmland source files underPython/Tests/GlassTests/PythonTests/. - Compare the error log against expected events, source file names, line numbers, breakpoints, and function names in the script.
- Look for generated logs, dumps, and copied debuggee files under the runtime
GlassTests\PythonTests\...\obj\<configuration>\andbin\<configuration>\paths. - To debug Glass itself, set
GLASS_DEBUG=1, rerun one test, attach Visual Studio toglass2.exe, and check assertions or event handling. - To debug with the real product, follow Python/Tests/GlassTests/readme.txt: run PTVS under the debugger, open the generated test folder, mirror the
TestScript.xmlbreakpoints, and uselaunch.vs.jsonwith the intended interpreter.
Common Pitfalls
- Full setup is Microsoft-internal because
drop.exedownloads from internal DevDiv artifact drops. run_glass.pywithout--buildOutputhistorically probes 17.0 build output paths; pass--buildOutputfor local VS 18 builds.EnvironmentDiscover.exe not foundusually means the build output path is wrong or stale.PythonConcord.GlassTestRootorPythonEngine.regdefmissing means the runtime test copy is incomplete or setup did not run successfully.- Cache hits can preserve stale
GlassTestscontents. Fixes that must run before test execution should be in therun_glass.pypath, usually viacopy_ptvs_output(). - Runtime files under
GlassTests/are generated and cacheable; source test changes belong underPython/Tests/GlassTests/.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

