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

[Feature Request] Enable setting custom environment variables for summary runs #431

Closed
lukerops opened this issue Jul 5, 2024 · 2 comments

Comments

@lukerops
Copy link

lukerops commented Jul 5, 2024

I use a custom set of environment variables for each project I work on and it works successfully with the lua API, but sometimes I want to run all the tests in the project and I can't get it to work. Running the test in summary doesn't allow me to set the environment variables I want to use.

rcarriga added a commit that referenced this issue Jul 11, 2024
Allow users to augment the arguments to all tests being run from a
singular function.

```lua
local nio = require("nio")
neotest.setup({
  run = {
    augment = function(tree, args)
      local name = nio.ui.input({ prompt = "What is your name?" })

      args.env = { USER_NAME = name }

      return args
    end,
  },
})
```

See #431
@rcarriga
Copy link
Collaborator

I've added a new augment option for the run consumer if you want to check it out in #437, I believe it'll work for your use case

@lukerops
Copy link
Author

I tried with your PR code and it worked perfectly!!

rcarriga added a commit that referenced this issue Jul 13, 2024
Allow users to augment the arguments to all tests being run from a
singular function.

```lua
local nio = require("nio")
neotest.setup({
  run = {
    augment = function(tree, args)
      local name = nio.ui.input({ prompt = "What is your name?" })

      args.env = { USER_NAME = name }

      return args
    end,
  },
})
```

See #431
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

No branches or pull requests

2 participants