Skip to content

Commit

Permalink
Prefer setline() to normal mode insertion
Browse files Browse the repository at this point in the history
Starting with neovim 0.6.0, vader tests were consistently hanging,
although the problem dates back even farther [*], around the time
that test recipes began executing the `norm` command [**]

It seems neovim's implementation of `norm` can fail to close the
input stream in non-interactive mode, hence the stalled process

This also reverts the rollback to 0.5.1 from 3149920, unblocking
the use of newer pythons. Neovim before 0.6.0 incorrectly parsed
the minor version number of python 3.10, using the string '3.3'
as the required minimum [***]. (As a side note, the real minimum
was always 3.4, because of pynvim)

---
[*] cf. 3db79fd
[**] cf. 021d9a1
[***] neovim/neovim#15937
  • Loading branch information
rdipardo committed Jan 10, 2022
1 parent 41a8116 commit 4aed209
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
vim-version: [7.4.1689, 8.2.3082]
vim-version: [7.4.1689, 8.2.4049]
nvim-version: [stable]
python-version: ['2.7.18', '3.4.10', '3.5', '3.6', '3.7', '3.8', '3.9']
python-version: ['2.7.18', '3.4.10', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10']
env:
LOG: python-${{ matrix.python-version }}-bench.log
steps:
- uses: actions/checkout@v2
- name: Set up python
Expand Down Expand Up @@ -91,8 +93,6 @@ jobs:

- name: Test plugin on vim
if: ${{ startsWith(matrix.python-version, '2.7') }}
env:
LOG: python-${{ matrix.python-version }}-bench.log
run: |
git clone --branch v${{ matrix.vim-version }} https://github.com/vim/vim.git vim-src
cd vim-src
Expand All @@ -109,8 +109,6 @@ jobs:
"${{ steps.neovim.outputs.executable }}" --startuptime nvim_bench.log -ENsu test/vimrc -c '+Vader! test/vader/pyx/*' > /dev/null
- name: Check startup times
env:
LOG: python-${{ matrix.python-version }}-bench.log
run: |
head -n 10 nvim_*.log > neovim-${{ matrix.nvim-version }}-$LOG
awk '/.*\/cpywrite\.vim.*$/{print $2 " " $3 " " $5}' nvim_* | sort >> neovim-${{ matrix.nvim-version }}-$LOG
Expand Down
4 changes: 2 additions & 2 deletions test/vader/pyx/test_machine_readable_tags.vader
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Then(Smalltalk file has two tags in comment heading);
Execute(Prepend the GFDL-1.3+ id to an HTML file);
new! index.html
b index.html
norm i<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
norm o "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
call setline(1, '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"')
call setline(2, ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">')
CPYwrite GFDL-1.3-or-later

Then(HTML file has two tags in comment block);
Expand Down
2 changes: 1 addition & 1 deletion test/vader/pyx/test_new_langs.vader
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Then(Smalltalk file header quotes the Apache-2.0);
Execute(Prepend a standard license header to an XML file);
new! ecl.xml
b ecl.xml
norm i<?xml version="1.0" encoding="UTF-8"?>
call setline(1, '<?xml version="1.0" encoding="UTF-8"?>')
CPYwrite ECL-2.0

Then(XML file header quotes the ECL-2.0);
Expand Down
4 changes: 2 additions & 2 deletions test/vader/pyx/test_no_anonymous_copyrights.vader
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Then(C source file names a copyright holder);
Execute(Prepend the CC-PDDC to an HTML5 file);
new! index.htm
b index.htm
norm i<!DOCTYPE html>
call setline(1, '<!DOCTYPE html>')
CPYwrite CC-PDDC

Then(HTML comment block names a copyright holder);
Expand All @@ -38,7 +38,7 @@ Then(HTML comment block names a copyright holder);
Execute(Prepend the CC0-1.0 to an XML file);
new! pd.xml
b pd.xml
norm i<?xml version="1.0" encoding="UTF-8"?>
call setline(1, '<?xml version="1.0" encoding="UTF-8"?>')
CPYwrite CC0-1.0

Then(XML file names a copyright holder);
Expand Down
12 changes: 6 additions & 6 deletions test/vader/pyx/test_scripting_langs.vader
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Then(Assert that shebangs will be overwritten);
Execute(Prepend a standard header to a Perl script);
new! standard.pl
b standard.pl
norm i#!C:\perl -w
call setline(1, '#!C:\perl -w')
CPYwrite ECL-2.0

Then(Perl script header quotes the ECL-2.0);
Expand Down Expand Up @@ -71,7 +71,7 @@ Execute(Prepend a standard license header to a shell script);
new! brief_header
b brief_header
set syntax=zsh
norm i#!/usr/bin/zsh -euxo
call setline(1, '#!/usr/bin/zsh -euxo')
CPYwrite GFDL-1.1-only

Then(Shell script header quotes the GFDL-1.1-only);
Expand All @@ -86,7 +86,7 @@ Then(Shell script header quotes the GFDL-1.1-only);
Execute(Prepend a standard header to a Batch script);
new! standard.cmd
b standard.cmd
norm i@echo off
call setline(1, '@echo off')
CPYwrite MPL-2.0

Then(Batch script quotes the MPL-2.0);
Expand All @@ -113,7 +113,7 @@ Then(Python file header quotes the GPL-3.0+);
Execute(Prepend a standard header to a Python script);
new! standard
b standard
norm i#!/usr/bin/env python3.7 -wt
call setline(1, '#!/usr/bin/env python3.7 -wt')
set syntax=python
CPYwrite AFL-1.1

Expand Down Expand Up @@ -143,7 +143,7 @@ Execute(Prepend a header-less license to a Ruby script);
new! brief_header
b brief_header
set syntax=ruby
norm i#!/usr/bin/env ruby -wc
call setline(1, '#!/usr/bin/env ruby -wc')
CPYwrite MIT

Then(Ruby script header has brief license mention);
Expand All @@ -158,7 +158,7 @@ Then(Ruby script header has brief license mention);
Execute(Prepend the default license header to a PHP file);
new! default_header.php
b default_header.php
norm i<? phpinfo();?>
call setline(1, '<? phpinfo();?>')
CPYwrite

Then(PHP file quotes the GPL-3.0+);
Expand Down
2 changes: 1 addition & 1 deletion test/vader/pyx/test_web_langs.vader
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Then(TypeScript file header has brief license mention);
Execute(Prepend a standard license header to an HTML5 file);
new! standard.htm
b standard.htm
norm i<!DOCTYPE html>
call setline(1, '<!DOCTYPE html>')
CPYwrite GFDL-1.1-or-later

Then(HTML comment block quotes the GFDL-1.1-or-later);
Expand Down

0 comments on commit 4aed209

Please sign in to comment.