Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for re-attaching the debugger for remote debugging #1270

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b43ae94
split compilation for faster compilation on windows
DonJayamanne Mar 27, 2018
feda0dd
:memo: update docs and change log
DonJayamanne Mar 27, 2018
09add7a
:sparkles: experimental debugger attach
DonJayamanne Mar 28, 2018
459f842
:hammer: refactor
DonJayamanne Mar 29, 2018
394bd96
:white_check_mark: tests for experimental debugger attach
DonJayamanne Mar 29, 2018
22f6342
:hammer: increase timeout of this test
DonJayamanne Mar 29, 2018
bba9901
:memo: change log [skip ci]
DonJayamanne Mar 29, 2018
0205163
increase timeout for tests
DonJayamanne Mar 29, 2018
e488c7c
add templates for attaching
DonJayamanne Mar 30, 2018
903b205
change label [skip ci]
DonJayamanne Mar 30, 2018
7cce312
chane type [skip ci]
DonJayamanne Mar 30, 2018
673ef14
improvements tests (temporary workaround due to PTVSD issues)
DonJayamanne Mar 30, 2018
5d2c59a
Fix spacing of general (non-specific) tokens + tests (#1222)
Mar 28, 2018
c0d254e
RC update (#1220)
brettcannon Mar 28, 2018
0ac5101
2018.3.0 release details (#1227)
brettcannon Mar 29, 2018
ba4375f
Bump version to 2018.4.0-alpha
brettcannon Mar 29, 2018
9eb8868
Update on the removal of `closed` labels
brettcannon Mar 29, 2018
24989f3
Fixes issue that causes linter to fail when file path contains spaces…
brettcannon Mar 30, 2018
70600f6
Use an existing method to identify the active interpreter (#1215)
DonJayamanne Mar 30, 2018
915d495
Improved extension development experience on Windows (#1217)
DonJayamanne Mar 30, 2018
4aff36b
VS Python analysis engine integration (#1231)
Mar 30, 2018
f3e1a0e
:sparkles: experimental debugger attach
DonJayamanne Mar 28, 2018
804a059
:white_check_mark: reattach tests
DonJayamanne Apr 3, 2018
534ea19
remove unwanted code and add delay for socket server to start
DonJayamanne Apr 3, 2018
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ coverage/
pythonFiles/experimental/ptvsd/**
debug_coverage*/**
analysis/**
bin/**
obj/**
22 changes: 21 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,26 @@
],
"preLaunchTask": "Compile"
},
{
"name": "Launch Analysis Engine Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceFolder}/src/test",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "Compile",
"env": {
"VSC_PYTHON_ANALYSIS": "1"
}
},
{
"name": "Launch Tests (with code coverage)",
"type": "extensionHost",
Expand Down Expand Up @@ -114,4 +134,4 @@
]
}
]
}
}
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"coverage": true
},
"typescript.tsdk": "./node_modules/typescript/lib", // we want to use the TS server from our node_modules folder to control its version
"tslint.enable": true,
"tslint.enable": false, // We will run our own linting in gulp (& git commit hooks), else tslint extension just complains about unmodified files
"python.linting.enabled": false,
"python.unitTest.promptToConfigure": false,
"python.workspaceSymbols.enabled": false,
"python.formatting.provider": "none"
}
}
37 changes: 36 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@
"tasks": [
{
"label": "Compile",
"type": "npm",
"script": "compile",
"isBackground": true,
"problemMatcher": [
"$tsc-watch",
{
"base": "$tslint5",
"fileLocation": "relative"
}
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Hygiene",
"type": "gulp",
"task": "watch",
"isBackground": true,
Expand All @@ -18,6 +35,24 @@
"focus": false,
"panel": "dedicated"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
// Use this to run hygiene and display errors in problems window (very slow on Windows)
"label": "Hygiene (Problems Window)",
"type": "gulp",
"task": "watchProblems",
"isBackground": true,
"presentation": {
"echo": true,
"reveal": "never",
"focus": false,
"panel": "dedicated"
},
"problemMatcher": [
{
"applyTo": "allDocuments",
Expand Down Expand Up @@ -70,4 +105,4 @@
}
}
]
}
}
6 changes: 6 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ CODING_STANDARDS.md
CONTRIBUTING.md
news/**
debug_coverage*/**
analysis/publish*.*
vscode-python-signing.*
packageExtension.cmd
bin/**
obj/**
BuildOutput/**
53 changes: 48 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog

## 2018.3.0-beta (19 Mar 2018)
## 2018.3.1 (29 Mar 2018)

### Fixes

1. Fixes issue that causes linter to fail when file path contains spaces.
([#1239](https://github.com/Microsoft/vscode-python/issues/1239))

## 2018.3.0 (28 Mar 2018)

### Enhancements

Expand All @@ -12,26 +19,48 @@
([#1031](https://github.com/Microsoft/vscode-python/issues/1031))
1. Add a Scrapy debug configuration for the experimental debugger.
([#1032](https://github.com/Microsoft/vscode-python/issues/1032))
1. When using pipenv, install packages (such as linters, test frameworks) in dev-packages.
([#1110](https://github.com/Microsoft/vscode-python/issues/1110))
1. Added commands translation for italian locale.
(thanks [Dotpys](https://github.com/Dotpys/)) ([#1152](https://github.com/Microsoft/vscode-python/issues/1152))
1. Add support for Django Template debugging in experimental debugger.
([#1189](https://github.com/Microsoft/vscode-python/issues/1189))
1. Add support for Flask Template debugging in experimental debugger.
([#1190](https://github.com/Microsoft/vscode-python/issues/1190))
1. Add support for Jinja template debugging. ([#1210](https://github.com/Microsoft/vscode-python/issues/1210))
1. When debugging, use `Integrated Terminal` as the default console.
([#526](https://github.com/Microsoft/vscode-python/issues/526))
1. Disable the display of errors messages when rediscovering of tests fail in response to changes to files, e.g. don't show a message if there's a syntax error in the test code.
([#704](https://github.com/Microsoft/vscode-python/issues/704))
1. Bundle python depedencies (PTVSD package) in the extension for the experimental debugger.
([#741](https://github.com/Microsoft/vscode-python/issues/741))
1. Add support for expermental debugger when debugging Python Unit Tests.
([#906](https://github.com/Microsoft/vscode-python/issues/906))
1. Support `Debug Console` as a `console` option for the Experimental Debugger.
([#950](https://github.com/Microsoft/vscode-python/issues/950))
1. Enable syntax highlighting for `requirements.in` files as used by
e.g. [pip-tools](https://github.com/jazzband/pip-tools).
e.g. [pip-tools](https://github.com/jazzband/pip-tools)
(thanks [Lorenzo Villani](https://github.com/lvillani))
([#961](https://github.com/Microsoft/vscode-python/issues/961))
1. Add support to read name of Pipfile from environment variable.
([#999](https://github.com/Microsoft/vscode-python/issues/999))

### Fixes

1. Fixes issue that causes debugging of unit tests to hang indefinitely. ([#1009](https://github.com/Microsoft/vscode-python/issues/1009))
1. Add ability to disable the check on memory usage of language server (Jedi) process.
To turn off this check, add `"python.jediMemoryLimit": -1` to your user or workspace settings (`settings.json`) file.
([#1036](https://github.com/Microsoft/vscode-python/issues/1036))
1. Ignore test results when debugging unit tests.
([#1043](https://github.com/Microsoft/vscode-python/issues/1043))
1. Fixes auto formatting of conditional statements containing expressions with `<=` symbols.
([#1096](https://github.com/Microsoft/vscode-python/issues/1096))
1. Resolve debug configuration information in `launch.json` when debugging without opening a python file.
([#1098](https://github.com/Microsoft/vscode-python/issues/1098))
1. Disables auto completion when editing text at the end of a comment string.
([#1123](https://github.com/Microsoft/vscode-python/issues/1123))
1. Ensures file paths are properly encoded when passing them as arguments to linters.
([#199](https://github.com/Microsoft/vscode-python/issues/199))
1. Fix occasionally having unverified breakpoints
([#87](https://github.com/Microsoft/vscode-python/issues/87))
1. Ensure conda installer is not used for non-conda environments.
Expand All @@ -44,6 +73,7 @@ e.g. [pip-tools](https://github.com/jazzband/pip-tools).
1. Exclude 'news' folder from getting packaged into the extension.
([#1020](https://github.com/Microsoft/vscode-python/issues/1020))
1. Remove Jupyter commands.
(thanks [Yu Zhang](https://github.com/neilsustc))
([#1034](https://github.com/Microsoft/vscode-python/issues/1034))
1. Trigger incremental build compilation only when typescript files are modified.
([#1040](https://github.com/Microsoft/vscode-python/issues/1040))
Expand All @@ -52,20 +82,34 @@ e.g. [pip-tools](https://github.com/jazzband/pip-tools).
1. Enable unit testing of stdout and stderr redirection for the experimental debugger.
([#1048](https://github.com/Microsoft/vscode-python/issues/1048))
1. Update npm package `vscode-extension-telemetry` to fix the warning 'os.tmpDir() deprecation'.
(thanks [osya](https://github.com/osya))
([#1066](https://github.com/Microsoft/vscode-python/issues/1066))
1. Prevent debugger stepping into js code, when debugging async TypeScript code.
1. Prevent the debugger stepping into JS code while developing the extension when debugging async TypeScript code.
([#1090](https://github.com/Microsoft/vscode-python/issues/1090))
1. Increase timeouts for the debugger unit tests.
([#1094](https://github.com/Microsoft/vscode-python/issues/1094))
1. Change the command used to install pip on AppVeyor to avoid installation errors.
([#1107](https://github.com/Microsoft/vscode-python/issues/1107))
1. Check whether a document is active when detecthing changes in the active document.
([#1114](https://github.com/Microsoft/vscode-python/issues/1114))
1. Remove SIGINT handler in debugger adapter, thereby preventing it from shutting down the debugger.
([#1122](https://github.com/Microsoft/vscode-python/issues/1122))
1. Improve compilation speed of the extension's TypeScript code.
([#1146](https://github.com/Microsoft/vscode-python/issues/1146))
1. Changes to how debug options are passed into the experimental version of PTVSD (debugger).
([#1168](https://github.com/Microsoft/vscode-python/issues/1168))
1. Ensure file paths are not sent in telemetry when running unit tests.
([#1180](https://github.com/Microsoft/vscode-python/issues/1180))
1. Change `DjangoDebugging` to `Django` in `debugOptions` of launch.json.
([#1198](https://github.com/Microsoft/vscode-python/issues/1198))
1. Changed property name used to capture the trigger source of Unit Tests. ([#1213](https://github.com/Microsoft/vscode-python/issues/1213))
1. Enable unit testing of the experimental debugger on CI servers
([#742](https://github.com/Microsoft/vscode-python/issues/742))
1. Generate code coverage for debug adapter unit tests.
([#778](https://github.com/Microsoft/vscode-python/issues/778))
1. Execute prospector as a module (using -m).
([#982](https://github.com/Microsoft/vscode-python/issues/982))
1. Launch the unit tests in debug mode as opposed to running and attaching the debugger.
1. Launch unit tests in debug mode as opposed to running and attaching the debugger to the already-running interpreter.
([#983](https://github.com/Microsoft/vscode-python/issues/983))

## 2018.2.1 (09 Mar 2018)
Expand Down Expand Up @@ -792,4 +836,3 @@ the following people who contributed code:

## Version 0.0.3
* Added support for debugging using PDB

61 changes: 61 additions & 0 deletions CONTRIBUTING - PYTHON_ANALYSIS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Contributing to Microsoft Python Analysis Engine
[![Contributing to Python Tools for Visual Studio](https://github.com/Microsoft/PTVS/blob/master/CONTRIBUTING.md)]

[![Build Status (Travis)](https://travis-ci.org/Microsoft/vscode-python.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-python) [![Build status (AppVeyor)](https://ci.appveyor.com/api/projects/status/s0pt8d79gqw222j7?svg=true)](https://ci.appveyor.com/project/DonJayamanne/vscode-python-v3vd6) [![codecov](https://codecov.io/gh/Microsoft/vscode-python/branch/master/graph/badge.svg)](https://codecov.io/gh/Microsoft/vscode-python)


## Contributing a pull request

### Prerequisites

1. .NET Core 2.0+ SDK
- [Windows](https://www.microsoft.com/net/learn/get-started/windows)
- [Mac OS](https://www.microsoft.com/net/learn/get-started/macos)
- [Linux](https://www.microsoft.com/net/learn/get-started/linux/rhel)
2. C# Extension to VS Code (all platforms)
3. Python 2.7
4. Python 3.6

*Alternative:* [Visual Studio 2017](https://www.visualstudio.com/downloads/) (Windows only) with .NET Core and C# Workloads. Community Edition is free and is fully functional.

### Setup

```shell
git clone https://github.com/microsoft/ptvs
cd Python/Product/VsCode/AnalysisVsc
dotnet build
```

Visual Studio 2017:
1. Open solution in Python/Product/VsCode
2. Build AnalysisVsc project
3. Binaries arrive in *Python/BuildOutput/VsCode/raw*
4. Delete contents of the *analysis* folder in the Python Extension folder
5. Copy *.dll, *.pdb, *.json fron *Python/BuildOutput/VsCode/raw* to *analysis*

### Debugging code in Python Extension to VS Code
Folow regular TypeScript debugging steps

### Debugging C# code in Python Analysis Engine
1. Launch another instance of VS Code
2. Open Python/Product/VsCode/AnalysisVsc folder
3. Python Analysis Engine code is in *Python/Product/VsCode/Analysis*
4. Run extension from VS Code
5. In the instance with C# code select Dotnet Attach launch task.
6. Attach to *dotnet* process running *Microsoft.PythonTools.VsCode.dll*

On Windows you can also attach from Visual Studio 2017.

### Validate your changes

1. Build C# code
2. Copy binaries to *analysis* folder
3. Use the `Launch Extension` launch option.

### Unit Tests
1. Run the Unit Tests via the `Launch Analysis Engine Tests`.
2. On Windows you can also open complete PTVS solution in Visual Studio and run its tests (or at least the Analysis section).


### Coding Standards
See [![Contributing to Python Tools for Visual Studio](https://github.com/Microsoft/PTVS/blob/master/CONTRIBUTING.md)]
28 changes: 14 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

[![Build Status (Travis)](https://travis-ci.org/Microsoft/vscode-python.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-python) [![Build status (AppVeyor)](https://ci.appveyor.com/api/projects/status/s0pt8d79gqw222j7?svg=true)](https://ci.appveyor.com/project/DonJayamanne/vscode-python-v3vd6) [![codecov](https://codecov.io/gh/Microsoft/vscode-python/branch/master/graph/badge.svg)](https://codecov.io/gh/Microsoft/vscode-python)


# Contributing to Microsoft Python Analysis Engine
[![Contributing to Python Analysis Engine](https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING - PYTHON_ANALYSIS.md)]

## Contributing a pull request

Expand All @@ -28,7 +29,7 @@ You may see warnings that ```The engine "vscode" appears to be invalid.```, you

### Incremental Build

Run the `Compile` build Tasks from the [Command Palette](https://code.visualstudio.com/docs/editor/tasks) (short cut `CTRL+SHIFT+B` or `⇧⌘B`)
Run the `Compile` and `Hygiene` build Tasks from the [Command Palette](https://code.visualstudio.com/docs/editor/tasks) (short cut `CTRL+SHIFT+B` or `⇧⌘B`)

### Errors and Warnings

Expand Down Expand Up @@ -112,25 +113,23 @@ To help actively track what stage issues are at, various labels are
used. Which labels are expected to be set vary from when an issue is
open to when an issue is closed.

#### Open issues

When an
[issue is first opened](https://github.com/Microsoft/vscode-python/issues),
it is triaged to contain at least three types of labels:
it is triaged to contain at least two types of labels:

1. `needs`
1. `feature`
1. `type`

These labels cover what is blocking the issue from closing, what
feature(s) of the extension are related to the issue, and what type of
issue it is, respectively.
These labels cover what is blocking the issue from closing and what kind of
issue it is. We also add a `feature` label when appropriate for what the issue
relates to.

#### Closed issues

When an
[issue is closed](https://github.com/Microsoft/vscode-python/issues?q=is%3Aissue+is%3Aclosed),
it should have an appropriate `closed-` label.
When an issue is closed by a pull request we add a
[`validate fix`](https://github.com/Microsoft/vscode-python/issues?q=label%3A%22validate+fix%22+is%3Aclosed)
label in order to request people help us test the fix to validate the issue was
resolved successfully.

### Pull request workflow

Expand All @@ -150,8 +149,9 @@ it should have an appropriate `closed-` label.
1. Make sure all status checks are green (e.g. CLA check, CI, etc.)
1. Address any review comments
1. [Maintainers only] Merge the pull request
1. [Maintainers only] Update affected issues to be:
1. Closed (with an appropriate `closed-` label)
1. [Maintainers only] Update affected issues:
1. Add the [`validate fix`](https://github.com/Microsoft/vscode-python/issues?q=label%3A%22validate+fix%22+is%3Aclosed)
label
1. The issue(s) are attached to the current milestone
1. Register OSS usage
1. Email CELA about any 3rd-party usage changes
Expand Down
17 changes: 16 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#image: Visual Studio 2017
#shallow_clone: true

environment:
matrix:
- PYTHON: "C:\\Python36"
Expand All @@ -20,11 +23,23 @@ install:
- python -m easy_install -U setuptools
- "%PYTHON%/Scripts/pip.exe install --upgrade -r requirements.txt"

build: off
# build_script:
# - git clone https://github.com/MikhailArkhipov/PTVS.git c:/projects/PTVS
# - "cd c:\\projects\\PTVS"
# - git checkout origin/vsc
# - "cd Python\\Product\\VSCode\\AnalysisVsc"
# - "dotnet --info"
# - "dotnet build"
# - "cd c:\\projects\\vscode-python"
# - "xcopy /S /I c:\\projects\\PTVS\\BuildOutput\\VsCode\\raw analysis"

test_script:
- yarn run clean
- yarn run vscode:prepublish
- yarn run testDebugger --silent
- yarn run testSingleWorkspace --silent
- yarn run testMultiWorkspace --silent
# - yarn run testAnalysisEngine --silent


build: off
Loading