In case of a monorepo project (e.g. Python + Go) go.mod might be located somewhere in nested directories, but not in the project root. This leads to an issue when running test from the Summary window.
With this change location variable (from the Summary window) is exposed to the args function, so additional logic can be used based on the path.
Example:
args = function(location)
local Path = require('plenary.path')
local current_dir = Path:new(location):parent()
local module_dir = current_dir:find_upwards('go.mod'):parent()
local coverprofile = module_dir .. '/cover.out'
print('Generated coverprofile:' .. coverprofile)
return {
'-coverprofile=' .. coverprofile,
}
end
In case of a monorepo project (e.g. Python + Go) go.mod might be located somewhere in nested directories, but not in the project root. This leads to an issue when running test from the Summary window.
With this change location variable (from the Summary window) is exposed to the args function, so additional logic can be used based on the path.
Example: