Skip to content
Closed
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
37 changes: 16 additions & 21 deletions .github/release_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,22 @@ All dates should align with VS Code's [iteration](https://github.com/microsoft/v
Feature freeze is Monday @ 17:00 America/Vancouver, XXX XX. At that point, commits to `main` should only be in response to bugs found during endgame testing until the release candidate is ready.

<details>
<summary>Release Primary and Secondary Assignments for the 2024 Calendar Year</summary>

| Month | Primary | Secondary |
|:----------|:----------|:------------|
| ~~January~~ | ~~Eleanor~~ | ~~Karthik~~ |
| ~~February~~ | ~~Kartik~~ | ~~Anthony~~ |
| ~~March~~ | ~~Karthik~~ | ~~Eleanor~~ |
| ~~April~~ | ~~Paula~~ | ~~Eleanor~~ |
| ~~May~~ | ~~Anthony~~ | ~~Karthik~~ |
| ~~June~~ | ~~Karthik~~ | ~~Eleanor~~ |
| July | Anthony | Karthik |
| August | Paula | Anthony |
| September | Anthony | Eleanor |
| October | Paula | Karthik |
| November | Eleanor | Paula |
| December | Eleanor | Anthony |

Paula: 3 primary, 2 secondary
Eleanor: 3 primary (2 left), 3 secondary (2 left)
Anthony: 2 primary, 3 secondary (2 left)
Karthik: 2 primary (1 left), 4 secondary (3 left)
<summary>Release Primary and Secondary Assignments for the 2025 Calendar Year</summary>

| Month and version number | Primary | Secondary |
|------------|----------|-----------|
| January v2025.0.0 | Eleanor | Karthik |
| February v2025.2.0 | Anthony | Eleanor |
| March v2025.4.0 | Karthik | Anthony |
| April v2025.6.0 | Eleanor | Karthik |
| May v2025.8.0 | Anthony | Eleanor |
| June v2025.10.0 | Karthik | Anthony |
| July v2025.12.0 | Eleanor | Karthik |
| August v2025.14.0 | Anthony | Eleanor |
| September v2025.16.0 | Karthik | Anthony |
| October v2025.18.0 | Eleanor | Karthik |
| November v2025.20.0 | Anthony | Eleanor |
| December v2025.22.0 | Karthik | Anthony |

</details>

Expand Down
51 changes: 0 additions & 51 deletions .github/workflows/stale-prs.yml

This file was deleted.

3 changes: 3 additions & 0 deletions build/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ pytest-json

# for pytest-describe related tests
pytest-describe

# for pytest-ruff related tests
pytest-ruff
27 changes: 0 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1147,12 +1147,6 @@
"command": "python.execInInteractiveWindowEnter",
"key": "enter",
"when": "!config.interactiveWindow.executeWithShiftEnter && isCompositeNotebook && activeEditor == 'workbench.editor.interactive' && !inlineChatFocused && !notebookCellListFocused"
},
{
"command": "python.refreshTensorBoard",
"key": "ctrl+r",
"mac": "cmd+r",
"when": "python.hasActiveTensorBoardSession"
}
],
"languages": [
Expand Down Expand Up @@ -1302,20 +1296,6 @@
"title": "%python.command.python.execInREPL.title%",
"when": "false"
},
{
"category": "Python",
"command": "python.launchTensorBoard",
"title": "%python.command.python.launchTensorBoard.title%",
"when": "!virtualWorkspace && shellExecutionSupported && !python.tensorboardExtInstalled"
},
{
"category": "Python",
"command": "python.refreshTensorBoard",
"enablement": "python.hasActiveTensorBoardSession",
"icon": "$(refresh)",
"title": "%python.command.python.refreshTensorBoard.title%",
"when": "!virtualWorkspace && shellExecutionSupported && !python.tensorboardExtInstalled"
},
{
"category": "Python",
"command": "python.reportIssue",
Expand Down Expand Up @@ -1414,13 +1394,6 @@
"when": "editorFocus && editorLangId == python && !virtualWorkspace && shellExecutionSupported && config.python.REPL.sendToNativeREPL"
}
],
"editor/title": [
{
"command": "python.refreshTensorBoard",
"group": "navigation@0",
"when": "python.hasActiveTensorBoardSession && !virtualWorkspace && shellExecutionSupported"
}
],
"editor/title/run": [
{
"command": "python.execInTerminal-icon",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

# This file has no test, it's just a random script.

if __name__ == "__main__":
print("Hello World!")
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.


# This test passes.
def test_function(): # test_marker--test_function
assert 1 == 1
91 changes: 91 additions & 0 deletions python_files/tests/pytestadapter/expected_discovery_test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -1577,3 +1577,94 @@
],
"id_": TEST_DATA_PATH_STR,
}
# This is the expected output for the folder_with_script folder when run with ruff
# └── .data
# └── folder_with_script
# └── script_random.py
# └── ruff
# └── test_simple.py
# └── ruff
# └── test_function
ruff_test_expected_output = {
"name": ".data",
"path": TEST_DATA_PATH_STR,
"type_": "folder",
"children": [
{
"name": "folder_with_script",
"path": os.fspath(TEST_DATA_PATH / "folder_with_script"),
"type_": "folder",
"id_": os.fspath(TEST_DATA_PATH / "folder_with_script"),
"children": [
{
"name": "script_random.py",
"path": os.fspath(TEST_DATA_PATH / "folder_with_script" / "script_random.py"),
"type_": "file",
"id_": os.fspath(TEST_DATA_PATH / "folder_with_script" / "script_random.py"),
"children": [
{
"name": "ruff",
"path": os.fspath(
TEST_DATA_PATH / "folder_with_script" / "script_random.py"
),
"lineno": "",
"type_": "test",
"id_": get_absolute_test_id(
"folder_with_script/script_random.py::ruff",
TEST_DATA_PATH / "folder_with_script" / "script_random.py",
),
"runID": get_absolute_test_id(
"folder_with_script/script_random.py::ruff",
TEST_DATA_PATH / "folder_with_script" / "script_random.py",
),
}
],
},
{
"name": "test_simple.py",
"path": os.fspath(TEST_DATA_PATH / "folder_with_script" / "test_simple.py"),
"type_": "file",
"id_": os.fspath(TEST_DATA_PATH / "folder_with_script" / "test_simple.py"),
"children": [
{
"name": "ruff",
"path": os.fspath(
TEST_DATA_PATH / "folder_with_script" / "test_simple.py"
),
"lineno": "",
"type_": "test",
"id_": get_absolute_test_id(
"folder_with_script/test_simple.py::ruff",
TEST_DATA_PATH / "folder_with_script" / "test_simple.py",
),
"runID": get_absolute_test_id(
"folder_with_script/test_simple.py::ruff",
TEST_DATA_PATH / "folder_with_script" / "test_simple.py",
),
},
{
"name": "test_function",
"path": os.fspath(
TEST_DATA_PATH / "folder_with_script" / "test_simple.py"
),
"lineno": find_test_line_number(
"test_function",
TEST_DATA_PATH / "folder_with_script" / "test_simple.py",
),
"type_": "test",
"id_": get_absolute_test_id(
"folder_with_script/test_simple.py::test_function",
TEST_DATA_PATH / "folder_with_script" / "test_simple.py",
),
"runID": get_absolute_test_id(
"folder_with_script/test_simple.py::test_function",
TEST_DATA_PATH / "folder_with_script" / "test_simple.py",
),
},
],
},
],
}
],
"id_": TEST_DATA_PATH_STR,
}
59 changes: 47 additions & 12 deletions python_files/tests/pytestadapter/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,17 @@ def test_pytest_collect(file, expected_const):
if actual_list is not None:
actual_item = actual_list.pop(0)
assert all(item in actual_item for item in ("status", "cwd", "error"))
assert (
actual_item.get("status") == "success"
), f"Status is not 'success', error is: {actual_item.get('error')}"
assert actual_item.get("status") == "success", (
f"Status is not 'success', error is: {actual_item.get('error')}"
)
assert actual_item.get("cwd") == os.fspath(helpers.TEST_DATA_PATH)
assert is_same_tree(
actual_item.get("tests"),
expected_const,
["id_", "lineno", "name", "runID"],
), f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_const, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
), (
f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_const, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
)


@pytest.mark.skipif(
Expand Down Expand Up @@ -232,13 +234,13 @@ def test_symlink_root_dir():
actual_item = actual_list.pop(0)
try:
# Check if all requirements
assert all(
item in actual_item for item in ("status", "cwd", "error")
), "Required keys are missing"
assert all(item in actual_item for item in ("status", "cwd", "error")), (
"Required keys are missing"
)
assert actual_item.get("status") == "success", "Status is not 'success'"
assert actual_item.get("cwd") == os.fspath(
destination
), f"CWD does not match: {os.fspath(destination)}"
assert actual_item.get("cwd") == os.fspath(destination), (
f"CWD does not match: {os.fspath(destination)}"
)
assert actual_item.get("tests") == expected, "Tests do not match expected value"
except AssertionError as e:
# Print the actual_item in JSON format if an assertion fails
Expand Down Expand Up @@ -271,7 +273,9 @@ def test_pytest_root_dir():
actual_item.get("tests"),
expected_discovery_test_output.root_with_config_expected_output,
["id_", "lineno", "name", "runID"],
), f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_discovery_test_output.root_with_config_expected_output, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
), (
f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_discovery_test_output.root_with_config_expected_output, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
)


def test_pytest_config_file():
Expand All @@ -298,7 +302,9 @@ def test_pytest_config_file():
actual_item.get("tests"),
expected_discovery_test_output.root_with_config_expected_output,
["id_", "lineno", "name", "runID"],
), f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_discovery_test_output.root_with_config_expected_output, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
), (
f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_discovery_test_output.root_with_config_expected_output, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
)


def test_config_sub_folder():
Expand Down Expand Up @@ -329,3 +335,32 @@ def test_config_sub_folder():
if actual_item.get("tests") is not None:
tests: Any = actual_item.get("tests")
assert tests.get("name") == "config_sub_folder"


def test_ruff_plugin():
"""Here the session node will be a subfolder of the workspace root and the test are in another subfolder.

This tests checks to see if test node path are under the session node and if so the
session node is correctly updated to the common path.
"""
file_path = helpers.TEST_DATA_PATH / "folder_with_script"
actual = helpers.runner(
[os.fspath(file_path), "--collect-only", "--ruff"],
)

assert actual
actual_list: List[Dict[str, Any]] = actual
if actual_list is not None:
actual_item = actual_list.pop(0)
assert all(item in actual_item for item in ("status", "cwd", "error"))
assert actual_item.get("status") == "success", (
f"Status is not 'success', error is: {actual_item.get('error')}"
)
assert actual_item.get("cwd") == os.fspath(helpers.TEST_DATA_PATH)
assert is_same_tree(
actual_item.get("tests"),
expected_discovery_test_output.ruff_test_expected_output,
["id_", "lineno", "name", "runID"],
), (
f"Tests tree does not match expected value. \n Expected: {json.dumps(expected_discovery_test_output.ruff_test_expected_output, indent=4)}. \n Actual: {json.dumps(actual_item.get('tests'), indent=4)}"
)
12 changes: 6 additions & 6 deletions python_files/tests/pytestadapter/test_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,13 @@ def test_symlink_run():
actual_item = actual_list.pop(0)
try:
# Check if all requirements
assert all(
item in actual_item for item in ("status", "cwd", "result")
), "Required keys are missing"
assert all(item in actual_item for item in ("status", "cwd", "result")), (
"Required keys are missing"
)
assert actual_item.get("status") == "success", "Status is not 'success'"
assert actual_item.get("cwd") == os.fspath(
destination
), f"CWD does not match: {os.fspath(destination)}"
assert actual_item.get("cwd") == os.fspath(destination), (
f"CWD does not match: {os.fspath(destination)}"
)
actual_result_dict = {}
actual_result_dict.update(actual_item["result"])
assert actual_result_dict == expected_const
Expand Down
6 changes: 3 additions & 3 deletions python_files/tests/unittestadapter/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ def test_simple_django_collect():
if actual_list is not None:
actual_item = actual_list.pop(0)
assert all(item in actual_item for item in ("status", "cwd"))
assert (
actual_item.get("status") == "success"
), f"Status is not 'success', error is: {actual_item.get('error')}"
assert actual_item.get("status") == "success", (
f"Status is not 'success', error is: {actual_item.get('error')}"
)
assert actual_item.get("cwd") == os.fspath(data_path)
assert len(actual_item["tests"]["children"]) == 1
assert actual_item["tests"]["children"][0]["children"][0]["id_"] == os.fsdecode(
Expand Down
1 change: 0 additions & 1 deletion python_files/unittestadapter/pvsc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ def send_post_request(
encoded = request.encode("utf-8")
bytes_written = 0
while bytes_written < len(encoded):
print("writing more bytes!")
segment = encoded[bytes_written : bytes_written + size]
bytes_written += __writer.write(segment)
__writer.flush()
Expand Down
Loading
Loading