Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add setting for running Behave from alternate current working directory #55

Open
gabeseltzer opened this issue Oct 7, 2024 · 1 comment
Labels
feature request New feature or new functionality request

Comments

@gabeseltzer
Copy link

Hi! Thanks for your hard work to make this extension work well! I'm trying to use it with a repository where we've stored our tests in a less-than-ideal place:

Repository root
| - autotest
  | - product1
    | - features
  | - product2
    | - features

I'm able to use the setting behave-vsc.featuresPath to get the extension to recognize my tests, which is great.

Unfortunately, when I run the tests from the "tests" left panel, behave runs from the repository root folder. My tests expect to be run from the product1 folder or product2 folder, and they contain relative links to other files which don't work when behave is run from the repository root directory.

To fix this, I can see three solutions:

First, I could fix my project layout. I'll probably do that 😅

Second: The vscode extension could expose a setting to allow me to adjust the current working directory (cwd) so behave runs from the correct folder. I believe that value is currently set here, but it isn't exposed as an extension variable. This seems easy, and is the main reason why I'm making this issue

Third: A more complicated, but probably also good option would be to allow users to define launch configurations in their .vscode/launch.json file. I've seen another extension allow this: in that case, as long as one of the launch configuration have a specific name it gets used instead of the default config. I believe the default debugging config currently lives here.

@jimasp
Copy link
Owner

jimasp commented Oct 9, 2024

A setting to set a working directory is not as easy as it seems, but you are not the first person to ask for it, and it will be an option in release 0.7.0 (hopefully released before the end of the year).

@jimasp jimasp added the feature request New feature or new functionality request label Oct 9, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature request New feature or new functionality request
Projects
None yet
Development

No branches or pull requests

2 participants