-
Notifications
You must be signed in to change notification settings - Fork 387
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
Docker support #254
Comments
@LandonSchropp Yes, you can register a transformation function that will be applied for each test command. function! DockerTransform(cmd) abort
" return test command wrapped in docker stuff
endfunction
let g:test#custom_transformations = {'docker': function('DockerTransform')}
let g:test#transformation = 'docker' |
Awesome! Thank you. |
@LandonSchropp Did you manage to get this to work? |
@jvanbaarsen: I'm using Neovim, so I went ahead and wrote my own custom functions that call function! RunTests(command_variable)
if !exists(a:command_variable)
echo 'The ' . a:command_variable ' variable must be set to run this command.'
return
endif
execute 'let l:command = ' . a:command_variable
let l:command = substitute(l:command, '$file', expand('%'), 'g')
split
execute 'terminal ' . l:command
endfunction
function! TestSuite()
call RunTests('g:test#suite_command')
endfunction
function! TestFile()
call RunTests('g:test#file_command')
endfunction I then mapped those functions to keyboard shortcuts. This also allows me to substitute |
For the googlers: |
Kind of a hack but, if you are using neoterm and ssh into the container you can still use the default executor since vim-test will paste the command in the neoterm opened. I tested it and it worked for me. |
At work, we do all of our local development inside of Docker containers. Is there an easy way to configure vim-test to prepend Docker to the test commands? Barring that, can I override the command vim-test uses and set my own?
The text was updated successfully, but these errors were encountered: