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

Test explorer position resets after automatic test discovery refresh #23186

Closed
yawhide opened this issue Apr 5, 2024 · 6 comments
Closed

Test explorer position resets after automatic test discovery refresh #23186

yawhide opened this issue Apr 5, 2024 · 6 comments
Assignees
Labels
area-testing triage-needed Needs assignment to the proper sub-team

Comments

@yawhide
Copy link

yawhide commented Apr 5, 2024

Type: Bug

Behaviour

I like to look at the test explorer when writing/fixing test cases. I right-click the green checkmark and click Reveal in test explorer. I then edit a test case and save the file. Test discovery runs in the background and resets the test explorer tree. It also resets my position in the test explorer. Previous versions of the python extension did not have this issue so there is a regression here.

Steps to reproduce:

  1. Right click a test case and click Reveal in test explorer. Ensure you have a decent amount of tests so test case isnt at the top of the tree.
  2. Edit a test case name and save
  3. Observe that the position in the test explorer goes to the very top

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

Extension version: 2024.4.0
VS Code version: Code 1.87.2 (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:20:57.520Z)
OS version: Darwin arm64 23.3.0
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.4
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Poetry
  • Value of the python.languageServer setting: Pylance
User Settings


envFile: "<placeholder>"

languageServer: "Pylance"

testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true

Installed Extensions
Extension Name Extension Id Version
autoDocstring - Python Docstring Generator njpwerner.autodocstring 0.6.1
Coverage Gutters ryanluker.vscode-coverage-gutters 2.11.1
ESLint dbaeumer.vscode-eslint 2.4.4
File Utils sleistner.vscode-fileutils 3.10.3
GitHub Copilot GitHub.copilot 1.178.0
GitHub Copilot Chat GitHub.copilot-chat 0.13.1
GitLens — Git supercharged eamodio.gitlens 14.9.0
HashiCorp Terraform hashicorp.terraform 2.29.5
JavaScript Debugger ms-vscode.js-debug 1.87.0
JavaScript Debugger Companion Extension ms-vscode.js-debug-companion 1.1.2
Jupyter ms-toolsai.jupyter 2024.2.0
Jupyter Cell Tags ms-toolsai.vscode-jupyter-cell-tags 0.1.8
Jupyter Keymap ms-toolsai.jupyter-keymap 1.1.2
Jupyter Notebook Renderers ms-toolsai.jupyter-renderers 1.0.17
Jupyter Slide Show ms-toolsai.vscode-jupyter-slideshow 0.1.5
Live Preview ms-vscode.live-server 0.4.13
Live Share ms-vsliveshare.vsliveshare 1.0.5918
Partial Diff ryu1kn.partial-diff 1.4.3
Prettier - Code formatter esbenp.prettier-vscode 10.4.0
Pylance ms-python.vscode-pylance 2024.4.1
Python ms-python.python 2024.4.0
Python Debugger ms-python.debugpy 2024.2.0
Ruff charliermarsh.ruff 2024.16.0
Sass (.sass only) syler.sass-indented 1.8.29
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.8
Vitest vitest.explorer 0.4.1
System Info
Item Value
CPUs Apple M1 Max (10 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 3, 3, 3
Memory (System) 64.00GB (4.34GB free)
Process Argv --crash-reporter-id 02ba2b18-9d31-4feb-b817-249fabac55bc
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vscorecescf:30445987
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyonecf:30548226
2i9eh265:30646982
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:31000450
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
d34g3935:30971562
fegfb526:30981948
bg6jg535:30979843
ccp1r6:30993540
dsvsc020:30976470
pythonait:31006305
666c4381:30973075
gee8j676:31009558
dsvsc021:30996838
gd77d436:30999572

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Apr 5, 2024
@eleanorjboyd
Copy link
Member

Hi @yawhide, sorry for the delay. Do you know specifically which version this used to work on? I have not made updates in this area recently but it could be a change coming from core. Thanks

@eleanorjboyd eleanorjboyd added the info-needed Issue requires more information from poster label Apr 9, 2024
@yawhide
Copy link
Author

yawhide commented Apr 9, 2024

Hi @yawhide, sorry for the delay. Do you know specifically which version this used to work on? I have not made updates in this area recently but it could be a change coming from core. Thanks

I think it was pre-2024 versions.
i downgraded to 2023.20.0 and it works beautifully. It even has a feature where if I click the play button around a test case, it'll 'reveal' the test in the test explorer without me having to click reveal in test explorer. amazing! can we get this behaviour back?
i also changed a test case name and it did not reset the test explorer position nor 'refresh' the play buttons. it is a lot smoother of an experience!

i think ever since 2024+ versions, the test discovery & test explorer have been a bit 'janky'

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Apr 9, 2024
@eleanorjboyd
Copy link
Member

@connor4312, do you have any ideas here? I looked through all my changes in the past 5 months (since 2023.20.0 was release 5 months ago) and most of the files having to do with populating the test tree I have not touched. Is there anything upstream that might have changed how refresh loads test cases and if someone's "place" in the tree is kept?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Apr 15, 2024
@eleanorjboyd
Copy link
Member

Also I tried this on the most recent pre-release and am seeing this behavior which seems to be correct? Is there something with my repro that isn't right?

test-explorer-moving.mov

@yawhide
Copy link
Author

yawhide commented Apr 16, 2024

Also I tried this on the most recent pre-release and am seeing this behavior which seems to be correct? Is there something with my repro that isn't right?
test-explorer-moving.mov

so i cloned some popular python code bases like flask and sqlalchemy and I cant reproduce the problem there 🤔

it seems to be a problem local to my own codebase. not sure why its happening.

@yawhide yawhide closed this as completed Apr 16, 2024
@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Apr 16, 2024
@eleanorjboyd
Copy link
Member

hm very interesting! I would check your settings or clear them out for the workspace and see if that makes a difference. Good luck, thanks for taking a look!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants