Giter Site home page Giter Site logo

Comments (9)

YouneselBarnoussi avatar YouneselBarnoussi commented on September 14, 2024

Thanks for submitting the issue, I will have a look at it. For now, if you want to keep using the extension you can downgrade the test explorer UI version in your marketplace.

from vscode-bdd-python-test-adapter.

lorthirk avatar lorthirk commented on September 14, 2024

Here's a log from the debugger:

rejected promise not handled within 1 second: Error occurred during process execution: Error: spawn cd && behave ENOENT
/Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-fork.js:5
rejected promise not handled within 1 second: Error: Error occurred during process execution: Error: spawn behave ENOENT
/Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-fork.js:5
stack trace: Error: Error occurred during process execution: Error: spawn behave ENOENT
	at behaveTestRunner.<anonymous> (/Users/claudio.mezzasalma/dev/git/lorthirk/vscode-BDD-Python-test-adapter/out/behaveTestRunner.js:29:23)
	at Generator.throw (<anonymous>)
	at rejected (/Users/claudio.mezzasalma/dev/git/lorthirk/vscode-BDD-Python-test-adapter/node_modules/tslib/tslib.js:108:69)
	at runMicrotasks (<anonymous>)
	at processTicksAndRejections (internal/process/task_queues.js:93:5)

from vscode-bdd-python-test-adapter.

lorthirk avatar lorthirk commented on September 14, 2024

And this is the JS Object contained in the error event at processExecution:53

{
    errno: -2,
    code: "ENOENT",
    syscall: "spawn behave",
    path: "behave",
    spawnargs: [
      "--dry-run",
      undefined,
    ],
    vslsStack: [
      {
      },
      {
      },
      {
      },
    ],
  }

from vscode-bdd-python-test-adapter.

YouneselBarnoussi avatar YouneselBarnoussi commented on September 14, 2024

Thanks for posting the logs, I am not able to recreate them. Would you be able to provide a sample project that causes this error?

from vscode-bdd-python-test-adapter.

lorthirk avatar lorthirk commented on September 14, 2024

It's a simple project with pipenv to manage the dependencies, and behave installed as a dev dependency. The ENOENT error makes me think that the command is spawn outside of the environment.
python-playground.tar.gz

from vscode-bdd-python-test-adapter.

YouneselBarnoussi avatar YouneselBarnoussi commented on September 14, 2024

I have been trying out the sample project that you have posted and it works completely fine for me on multiple versions of Test Explorer UI. I think it might be your working environment that is causing the bug, could you give me any more information about that?

from vscode-bdd-python-test-adapter.

lorthirk avatar lorthirk commented on September 14, 2024

What information do you need exactly?

from vscode-bdd-python-test-adapter.

tyrius02 avatar tyrius02 commented on September 14, 2024

I'm having virtually the same issue. I use Anaconda to manage my environments.

Here are my repro steps. Note, you must not have behave anywhere in your PATH.

  1. Install Anaconda (I use mambaforge from https://github.com/conda-forge/miniforge)
    The installer updates .bashrc on Linux; you'll need to start your terminal as a login shell or source ~/.bashrc (this assume you're using bash)
    If you're on Windows the installer will add a start menu entry which you can use to open a console window set up for Anaconda
  2. Create a new environment
    I use mamba, but you can use conda, just swap one for the other
    mamba create -y -n repro -c conda-forge --strict-channel-priority behave
  3. Change the current directory to the location of a project w/ behave tests
  4. Launch VS Code from here (simply type code in the console window)
  5. Install the extension
  6. Reload the window (CTRL + R)
  7. View the Runtime Status of the Behave Test Explorer extension.
    You should see Error occurred during process execution: Error: spawn behave ENOENT

If you activate the environment from the console window (conda activate repro) and then launch VS Code the extension works just fine.

I think the problem is the extension blindly assumes behave is available on the PATH when VS Code is launched. I wonder if there's a way to leverage Microsoft's Python extension and use the current Python interpreter (you can invoke behave via python -m behave).

from vscode-bdd-python-test-adapter.

YouneselBarnoussi avatar YouneselBarnoussi commented on September 14, 2024

Thanks for your step by step explanation @tyrius02 , For now, I implemented the invocation you suggested (python -m behave). If this did not fix it, let me know and I will try to put this on the top of my list.

I abandoned this extension for a while but in the coming month, I will try to update this extension with more improvements.

from vscode-bdd-python-test-adapter.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.