Skip to content

Commit 992ffd6

Browse files
authored
Merge pull request #715 from nickspoons/fix-github-action-tests
Fix Vader tests to work correctly with github actions
2 parents 03628c8 + 5691bc4 commit 992ffd6

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

.github/workflows/vader.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
vim:
16-
- 'v8.2.0000'
17-
- 'v8.1.0000'
18-
- 'v8.0.0000'
19-
- 'v7.4'
15+
cfg:
16+
- { editor: vim, neovim: false, version: nightly }
17+
- { editor: vim, neovim: false, version: stable }
18+
- { editor: neovim, neovim: true, version: stable }
2019

2120
steps:
2221
- name: Checkout code
@@ -30,7 +29,8 @@ jobs:
3029
- name: Setup Vim
3130
uses: rhysd/action-setup-vim@v1
3231
with:
33-
vim_version: ${{ matrix.vim }}
32+
neovim: ${{ matrix.cfg.neovim }}
33+
version: ${{ matrix.cfg.version }}
3434

3535
- name: Install Dependencies
3636
run: |
@@ -41,4 +41,12 @@ jobs:
4141
run: |
4242
cd test
4343
vim -esNu vimrc -c 'Vader! *'
44-
if: ${{ always() }}
44+
if: matrix.cfg.editor == 'vim'
45+
46+
- name: Run Test
47+
run: |
48+
cd test
49+
nvim --headless -Nu vimrc -c 'Vader! *'
50+
env:
51+
VADER_OUTPUT_FILE: /dev/stderr
52+
if: matrix.cfg.editor == 'neovim'

test/fixusings.vader

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,13 @@ Execute (should return ambiguous usings to Callback):
8585
call OmniSharpTestInitializeBuffer('FixUsings4')
8686
call OmniSharpWarmup('OmniSharp#actions#usings#Fix', [])
8787
let g:OmniSharp_test_locations = []
88-
function! s:Callback(locations)
88+
function! s:CallbackFixUsings(locations)
8989
let g:OmniSharp_test_waiting = 0
9090
let g:OmniSharp_test_locations = a:locations
9191
endfunction
92+
let Callback = function('s:CallbackFixUsings')
9293
let g:OmniSharp_test_waiting = 1
93-
call function('OmniSharp#actions#usings#Fix', [function('s:Callback')])()
94+
call function('OmniSharp#actions#usings#Fix', [Callback])()
9495
let starttime = reltime()
9596
while g:OmniSharp_test_waiting
9697
\ && reltime(starttime)[0] < g:OmniSharp_test_timeout

test/utils/async-helper.vader

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,24 @@ After():
22
call OmniSharpTestCleanupBuffer()
33

44
Execute (set up async helper):
5-
function! s:Callback(...)
5+
function! s:CallbackStopWaiting(...)
66
let g:OmniSharp_test_waiting = 0
77
endfunction
88

99
function! OmniSharpWarmup(funcname, args) abort
1010
call OmniSharpTestAwait(a:funcname, a:args, 1)
1111
endfunction
1212

13-
function! OmniSharpTestAwait(funcname, args, warmup = 0) abort
13+
function! OmniSharpTestAwait(funcname, args, ...) abort
14+
let warmup = a:0 ? a:1 : 0
1415
let g:OmniSharp_test_waiting = 1
15-
call function(a:funcname, a:args + [function('s:Callback')])()
16+
call function(a:funcname, a:args + [function('s:CallbackStopWaiting')])()
1617
let starttime = reltime()
1718
while g:OmniSharp_test_waiting
1819
\ && reltime(starttime)[0] < g:OmniSharp_test_timeout
1920
sleep 50m
2021
endwhile
21-
if !a:warmup
22+
if !warmup
2223
Assert !g:OmniSharp_test_waiting, a:funcname . ' timed out'
2324
endif
2425
endfunction

0 commit comments

Comments
 (0)