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

build: Setup VS Code tests #3292

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

build: Setup VS Code tests #3292

wants to merge 3 commits into from

Conversation

edmundmiller
Copy link
Contributor

Adds VS Code tests. I need someone else to give it a shot locally but it seems to discover them correctly and run them correctly now. It's pretty nice to use.

PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

@edmundmiller edmundmiller self-assigned this Nov 21, 2024
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.74%. Comparing base (207129d) to head (35eb958).
Report is 31 commits behind head on dev.

Additional details and impacted files

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mirpedrol
Copy link
Member

I tried to see the tests in VSCode after checking out to this PR and I see an error

2024-11-22 10:44:05.561 [warning] could not find a pixi interpreter for the interpreter at /opt/homebrew/bin/python3
2024-11-22 10:44:05.576 [warning] could not find a pixi interpreter for the interpreter at /opt/homebrew/bin/python3
2024-11-22 10:44:05.577 [info] > /opt/homebrew/bin/python3 -m pytest -p vscode_pytest --collect-only tests -v --tb=short
2024-11-22 10:44:05.577 [info] cwd: .
2024-11-22 10:44:05.617 [error] /opt/homebrew/opt/[email protected]/bin/python3.12: No module named pytest

2024-11-22 10:44:05.619 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /Users/jmir/Work/tools.
2024-11-22 10:44:05.619 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /Users/jmir/Work/tools. Creating and sending error discovery payload
2024-11-22 10:44:05.619 [error] pytest test discovery error for workspace:  /Users/jmir/Work/tools 
  
 The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace /Users/jmir/Work/tools

I tried installing pixi with brew install pixi but it didn't work. Am I missing something?

@edmundmiller
Copy link
Contributor Author

Ah good catch, I was hoping this would just "pick up" your virtual environment 😞

It should just work with whatever virtualenv you're usually using(if that's not pixi)

Here's the docs on selecting a venv or conda based venv. I've gotten it to work with pixi envs but it doesn't know exactly how to install stuff in that case(but I was using a pixi.toml not pyproject.toml) https://code.visualstudio.com/docs/python/environments#_select-and-activate-an-environment

Copy link
Member

@mirpedrol mirpedrol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could use it now, thanks! It looks good! and very useful 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants