-
Notifications
You must be signed in to change notification settings - Fork 78
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
Set run configuration options for debug_test #76
Comments
I have a use case that needs to set cwd and env. It would be nice to be able to merge table into what is running. I have a workaround for some of the options. I just override the ones that this plugin adds after setup but it doesn't work for test. This is what I am doing to fix some of my problems.
|
@friesencr I created a #77 to add an option for extra configuration arguments specifically for when calling For all other configurations, I've been just adding arguments manually by looping through the default provided configs after setup. |
I'd also like to see this implemented. For example, I'm working on a repo that requires the Another potential approach would be to have -- WARNING: UNTESTED
-- get the basic config, which may have been overridden by the user
local function get_base_config(configName)
local dap = load_module("dap")
for _, v in ipairs(dap.configurations.go) do
if v.name == configName then
return v
end
end
end
local function debug_test(testname, testpath, build_flags)
local dap = load_module("dap")
local baseConfig = get_base_config("Debug test")
local config = vim.tbl_deep_extend("force", {}, baseConfig, {
-- merge user defined config with default args/build flags, and add the testname/path
name = testname,
program = testpath,
args = vim.tbl_deep_extend("force", {}, baseConfig.args, { "-test.run", "^" .. testname .. "$" }),
buildFlags = vim.tbl_deep_extend("force", {}, baseConfig.build_flags, build_flags or {}),
})
dap.run(config)
end |
I'd also like to see this added. I'm working on a project with the oci8 SQL driver which requires the |
It would be very helpful if someone provided a minimal Go project setup as a PR in the |
I have a use case where I need to set up an environment variable only when debugging tests. We're using Temporal and for it not to timeout it needs a TEMPORAL_DEBUG variable set when debugging.
It would be great if we could configure extra run options to
debug_test
so that we can set not only this but other configuration options as well.Would you be willing to accept a PR for this?
The text was updated successfully, but these errors were encountered: