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

Edited Discovery Logic #20631

Merged
merged 86 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
d6d24ab
switch to using tcp for comm with server
eleanorjboyd Apr 3, 2023
f2a189a
mock test changes
eleanorjboyd Apr 4, 2023
9f00e97
fix msgs
eleanorjboyd Apr 4, 2023
dff2cac
discovery code
eleanorjboyd Feb 2, 2023
45faa4f
black formatting
eleanorjboyd Feb 7, 2023
23919f4
still working and comments in progress
eleanorjboyd Feb 8, 2023
cf0a76d
changing to different typing
eleanorjboyd Feb 9, 2023
6e8a87f
adding docstrings
eleanorjboyd Feb 9, 2023
437df9e
fix path and docstring
eleanorjboyd Feb 10, 2023
38adb97
black formatting
eleanorjboyd Feb 10, 2023
65404ee
functioning test infrastructure
eleanorjboyd Mar 3, 2023
70c123a
switch to single expected output file
eleanorjboyd Mar 3, 2023
7a20aab
try for unittests
eleanorjboyd Mar 3, 2023
7f1ebfe
refactoring and adding more .data files
eleanorjboyd Mar 6, 2023
6c2acf7
double and dual tests
eleanorjboyd Mar 6, 2023
aa9eb74
cleanup
eleanorjboyd Mar 6, 2023
bdc05d4
fix expected output for unittest folders
eleanorjboyd Mar 7, 2023
61ffee9
inital take on error handling
eleanorjboyd Mar 7, 2023
16baaea
switch to correct path to string
eleanorjboyd Mar 7, 2023
eb51f15
parametrize
eleanorjboyd Mar 7, 2023
c69bd61
remove unneeded comments
eleanorjboyd Mar 7, 2023
c2ffbc9
comments
eleanorjboyd Mar 7, 2023
25d0392
fix formatting
eleanorjboyd Mar 7, 2023
456f185
parametrize the tests
eleanorjboyd Mar 7, 2023
bb2424a
add commenting
eleanorjboyd Mar 8, 2023
4212119
fixing paths for non local testing
eleanorjboyd Mar 8, 2023
632ac36
unneeded files
eleanorjboyd Mar 8, 2023
40abfd2
attempt on http server/client
eleanorjboyd Mar 8, 2023
4cd75e8
reverting
eleanorjboyd Mar 9, 2023
108f7e1
add commenting, tests are passing
eleanorjboyd Mar 9, 2023
616f9b5
fix paths to ensure all use const
eleanorjboyd Mar 9, 2023
ba45341
remove local references
eleanorjboyd Mar 9, 2023
9e1cd2f
fixing typing, add error handling
eleanorjboyd Mar 9, 2023
a601882
comments, settings fix
eleanorjboyd Mar 9, 2023
13df91d
add doc string
eleanorjboyd Mar 9, 2023
340dd52
fix comment
eleanorjboyd Mar 9, 2023
8abd93e
fixing formatting
eleanorjboyd Mar 9, 2023
4208ebc
black formatting
eleanorjboyd Mar 9, 2023
c91677e
black formatting
eleanorjboyd Mar 9, 2023
819d699
remove print
eleanorjboyd Mar 9, 2023
d91038a
comment noting line num
eleanorjboyd Mar 9, 2023
7406d4a
change to txt file
eleanorjboyd Mar 9, 2023
37b8643
create find line no function
eleanorjboyd Mar 9, 2023
2bbbab1
line no cont
eleanorjboyd Mar 9, 2023
cf4b22b
Apply suggestions from code review from Brett
eleanorjboyd Mar 10, 2023
205beb8
switch to any types to avoid private module
eleanorjboyd Mar 11, 2023
0ca0a6f
current changes- broken with add for UUID
eleanorjboyd Mar 30, 2023
d94e4e9
pytest y, unittest n
eleanorjboyd Mar 30, 2023
d21c5bf
both unit and pytest ts working
eleanorjboyd Mar 31, 2023
d99dd6b
current state
eleanorjboyd Mar 31, 2023
543b35f
remove debug
eleanorjboyd Apr 4, 2023
b3d9186
add jsonRPCProcessor test
eleanorjboyd Apr 4, 2023
c3b3d01
round 2 changes
eleanorjboyd Apr 4, 2023
4fc031d
round 3 edits
eleanorjboyd Apr 5, 2023
6aa071b
fix uneeded edits
eleanorjboyd Apr 5, 2023
4badcda
small fixes
eleanorjboyd Apr 6, 2023
9c596cc
comments and typing
eleanorjboyd Apr 6, 2023
709f5f8
Fix UUID unittest (#20996)
eleanorjboyd Apr 5, 2023
f730a75
switch to using tcp for comm with server (#20981)
eleanorjboyd Apr 6, 2023
7b38e8b
mock test changes
eleanorjboyd Apr 4, 2023
f720341
add jsonRPCProcessor test
eleanorjboyd Apr 4, 2023
0cb6ca0
comment out new code
eleanorjboyd Apr 6, 2023
4bc71c3
removing unneeded edit
eleanorjboyd Apr 6, 2023
3127183
last few
eleanorjboyd Apr 6, 2023
ffa2073
remove pytest adapter tests from running rn
eleanorjboyd Apr 6, 2023
e54b09d
fix pyright
eleanorjboyd Apr 7, 2023
9265aa0
pyright
eleanorjboyd Apr 7, 2023
55ec145
black reformat
eleanorjboyd Apr 7, 2023
c47da49
add lambda
eleanorjboyd Apr 7, 2023
a827e31
Merge branch 'main' into python-discovery-code
eleanorjboyd Apr 10, 2023
cad3c32
Update .vscode/launch.json
eleanorjboyd Apr 11, 2023
ba4e38f
updated a few types
eleanorjboyd Apr 11, 2023
253010d
Merge branch 'main' into python-discovery-code
eleanorjboyd Apr 13, 2023
6d8dd25
fix for CLI
eleanorjboyd Apr 13, 2023
7ae5a15
fix env var
eleanorjboyd Apr 13, 2023
0b344f4
Attempt to fix the connection error issue.
karthiknadig Apr 13, 2023
53bd9b4
fix typing.
karthiknadig Apr 13, 2023
a525ec3
Throw error when subprocess run fails.
karthiknadig Apr 14, 2023
e05e52e
Log errors
karthiknadig Apr 14, 2023
3997752
Try winsock reset
karthiknadig Apr 14, 2023
62a61c0
Revert "Try winsock reset"
karthiknadig Apr 14, 2023
548140f
Try with shell execute
karthiknadig Apr 14, 2023
d637af0
Revert "Try with shell execute"
karthiknadig Apr 14, 2023
cf0b921
Fix pathing for windows
karthiknadig Apr 14, 2023
cd4ddac
Try running all python tests without deps
karthiknadig Apr 14, 2023
f7caf06
Ensure proper env use.
karthiknadig Apr 14, 2023
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
9 changes: 9 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,15 @@
"request": "attach",
"listen": { "host": "localhost", "port": 5678 },
"justMyCode": true
},
{
"name": "Debug pytest plugin tests",

"type": "python",
"request": "launch",
"module": "pytest",
"args": ["${workspaceFolder}/pythonFiles/tests/pytestadapter"],
"justMyCode": true
}
],
"compounds": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.


# This test's id is double_nested_folder/nested_folder_one/nested_folder_two/test_nest.py::test_function.
# This test passes.
def test_function(): # test_marker--test_function
assert 1 == 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.


# This test's id is dual_level_nested_folder/nested_folder_one/test_bottom_folder.py::test_bottom_function_t.
# This test passes.
def test_bottom_function_t(): # test_marker--test_bottom_function_t
assert True


# This test's id is dual_level_nested_folder/nested_folder_one/test_bottom_folder.py::test_bottom_function_f.
# This test fails.
def test_bottom_function_f(): # test_marker--test_bottom_function_f
assert False
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.


# This test's id is dual_level_nested_folder/test_top_folder.py::test_top_function_t.
# This test passes.
def test_top_function_t(): # test_marker--test_top_function_t
assert True


# This test's id is dual_level_nested_folder/test_top_folder.py::test_top_function_f.
# This test fails.
def test_top_function_f(): # test_marker--test_top_function_f
assert False
7 changes: 7 additions & 0 deletions pythonFiles/tests/pytestadapter/.data/empty_discovery.py
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 tests in it; the discovery will return an empty list of tests.
def function_function(string):
return string
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import pytest


# This test has an error which will appear on pytest discovery.
# This error is intentional and is meant to test pytest discovery error handling.
@pytest.mark.parametrize("actual,expected", [("3+5", 8), ("2+4", 6), ("6*9", 42)])
def test_function():
assert True
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 has a syntax error.
# This error is intentional and is meant to test pytest discovery error handling.
def test_function()
assert True
10 changes: 10 additions & 0 deletions pythonFiles/tests/pytestadapter/.data/parametrize_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pytest


# Testing pytest with parametrized tests. The first two pass, the third fails.
# The tests ids are parametrize_tests.py::test_adding[3+5-8] and so on.
@pytest.mark.parametrize( # test_marker--test_adding
"actual, expected", [("3+5", 8), ("2+4", 6), ("6+9", 16)]
)
def test_adding(actual, expected):
assert eval(actual) == expected
7 changes: 7 additions & 0 deletions pythonFiles/tests/pytestadapter/.data/simple_pytest.py
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
4 changes: 4 additions & 0 deletions pythonFiles/tests/pytestadapter/.data/text_docstring.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This is a doctest test which passes #test_marker--text_docstring.txt
>>> x = 3
>>> x
3
21 changes: 21 additions & 0 deletions pythonFiles/tests/pytestadapter/.data/unittest_folder/test_add.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import unittest


def add(a, b):
return a + b


class TestAddFunction(unittest.TestCase):
# This test's id is unittest_folder/test_add.py::TestAddFunction::test_add_positive_numbers.
# This test passes.
def test_add_positive_numbers(self): # test_marker--test_add_positive_numbers
result = add(2, 3)
self.assertEqual(result, 5)

# This test's id is unittest_folder/test_add.py::TestAddFunction::test_add_negative_numbers.
# This test passes.
def test_add_negative_numbers(self): # test_marker--test_add_negative_numbers
result = add(-2, -3)
self.assertEqual(result, -5)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import unittest


def subtract(a, b):
return a - b


class TestSubtractFunction(unittest.TestCase):
# This test's id is unittest_folder/test_subtract.py::TestSubtractFunction::test_subtract_positive_numbers.
# This test passes.
def test_subtract_positive_numbers( # test_marker--test_subtract_positive_numbers
self,
):
result = subtract(5, 3)
self.assertEqual(result, 2)

# This test's id is unittest_folder/test_subtract.py::TestSubtractFunction::test_subtract_negative_numbers.
# This test passes.
def test_subtract_negative_numbers( # test_marker--test_subtract_negative_numbers
self,
):
result = subtract(-2, -3)
self.assertEqual(result, 1)
17 changes: 17 additions & 0 deletions pythonFiles/tests/pytestadapter/.data/unittest_pytest_same_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

import unittest


class TestExample(unittest.TestCase):
# This test's id is unittest_pytest_same_file.py::TestExample::test_true_unittest.
# Test type is unittest and this test passes.
def test_true_unittest(self): # test_marker--test_true_unittest
assert True


# This test's id is unittest_pytest_same_file.py::test_true_pytest.
# Test type is pytest and this test passes.
def test_true_pytest(): # test_marker--test_true_pytest
assert True
2 changes: 2 additions & 0 deletions pythonFiles/tests/pytestadapter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Loading