From 4aed20984a20bfe463ec279b910c6f0047c724ae Mon Sep 17 00:00:00 2001 From: Robert Di Pardo Date: Mon, 10 Jan 2022 17:48:28 -0500 Subject: [PATCH] Prefer setline() to normal mode insertion 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 [***] https://github.com/neovim/neovim/pull/15937 --- .github/workflows/ci.yml | 10 ++++------ test/vader/pyx/test_machine_readable_tags.vader | 4 ++-- test/vader/pyx/test_new_langs.vader | 2 +- test/vader/pyx/test_no_anonymous_copyrights.vader | 4 ++-- test/vader/pyx/test_scripting_langs.vader | 12 ++++++------ test/vader/pyx/test_web_langs.vader | 2 +- 6 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60a5ee4..df49285 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 diff --git a/test/vader/pyx/test_machine_readable_tags.vader b/test/vader/pyx/test_machine_readable_tags.vader index 47abb93..bb05ba0 100644 --- a/test/vader/pyx/test_machine_readable_tags.vader +++ b/test/vader/pyx/test_machine_readable_tags.vader @@ -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 + call setline(1, '') CPYwrite GFDL-1.3-or-later Then(HTML file has two tags in comment block); diff --git a/test/vader/pyx/test_new_langs.vader b/test/vader/pyx/test_new_langs.vader index a8b5d1c..161af0c 100644 --- a/test/vader/pyx/test_new_langs.vader +++ b/test/vader/pyx/test_new_langs.vader @@ -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 + call setline(1, '') CPYwrite ECL-2.0 Then(XML file header quotes the ECL-2.0); diff --git a/test/vader/pyx/test_no_anonymous_copyrights.vader b/test/vader/pyx/test_no_anonymous_copyrights.vader index de89c3e..57c70a3 100644 --- a/test/vader/pyx/test_no_anonymous_copyrights.vader +++ b/test/vader/pyx/test_no_anonymous_copyrights.vader @@ -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 + call setline(1, '') CPYwrite CC-PDDC Then(HTML comment block names a copyright holder); @@ -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 + call setline(1, '') CPYwrite CC0-1.0 Then(XML file names a copyright holder); diff --git a/test/vader/pyx/test_scripting_langs.vader b/test/vader/pyx/test_scripting_langs.vader index 1621952..70021cb 100644 --- a/test/vader/pyx/test_scripting_langs.vader +++ b/test/vader/pyx/test_scripting_langs.vader @@ -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); @@ -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); @@ -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); @@ -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 @@ -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); @@ -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 + call setline(1, '') CPYwrite Then(PHP file quotes the GPL-3.0+); diff --git a/test/vader/pyx/test_web_langs.vader b/test/vader/pyx/test_web_langs.vader index a266a34..6f07726 100644 --- a/test/vader/pyx/test_web_langs.vader +++ b/test/vader/pyx/test_web_langs.vader @@ -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 + call setline(1, '') CPYwrite GFDL-1.1-or-later Then(HTML comment block quotes the GFDL-1.1-or-later);