[vim/vim] tests: use noswapfile by default, only enable it for where it is tested (#4742)

20 views
Skip to first unread message

Daniel Hahler

unread,
Jul 29, 2019, 5:15:57 AM7/29/19
to vim/vim, Subscribed

This avoids leftover files from tests.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/4742

Commit Summary

  • tests: use noswapfile by default, only enable it for where it is tested

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Yegappan Lakshmanan

unread,
Jul 29, 2019, 10:20:05 AM7/29/19
to vim_dev, reply+ACY5DGFZ4JQOB4BYBM...@reply.github.com, vim/vim, Subscribed
Hi,

On Mon, Jul 29, 2019 at 2:15 AM Daniel Hahler <vim-dev...@256bit.org> wrote:
>
> This avoids leftover files from tests.
>

If the tests are run without the swapfile, then they are not reflecting
how normally Vim is used. The code path exercised by the tests
will be different.

I haven't seen many cases where swap files are left over in the system
after running the tests. Under what conditions do you see the swap
files in the system after a test run?

Regards,
Yegappan

vim-dev ML

unread,
Jul 29, 2019, 10:20:29 AM7/29/19
to vim/vim, vim-dev ML, Your activity
Hi,

On Mon, Jul 29, 2019 at 2:15 AM Daniel Hahler <vim-dev...@256bit.org> wrote:
>
> This avoids leftover files from tests.
>

If the tests are run without the swapfile, then they are not reflecting
how normally Vim is used. The code path exercised by the tests
will be different.

I haven't seen many cases where swap files are left over in the system
after running the tests. Under what conditions do you see the swap
files in the system after a test run?

Regards,
Yegappan

Daniel Hahler

unread,
Jul 29, 2019, 11:33:13 AM7/29/19
to vim/vim, vim-dev ML, Comment

If the tests are run without the swapfile, then they are not reflecting how normally Vim is used. The code path exercised by the tests will be different.

Yes, thought the same - but then there are (or should at least be) also explicit tests for it.

Coveralls says:

Coverage decreased (-0.1%) to 80.279%

But that unfortunately is flaky anyway still AFAIK, i.e. not reliable for this kind of analysis.

Under what conditions do you see the swap files in the system after a test run?

Usually in case of test failures only.
Initially I've thought it could avoid having to handle the SwapExist autocommand, but that appears to also be for when an user edits a file under test (although that then would not cause (most of) the test(s) to create/use swap files then).

The PR itself was inspired by test failures in Neovim's test suite, which uses set directory=. (with other directory related settings) as a measurement against messing with user files. This then caused test failures with test_filetype which edits files in /etc where swap files cannot be created.
As for directory I think it's the best to use some temporary directory after all.

I'm -0 on this myself, so feel free to close it.


You are receiving this because you commented.

Bram Moolenaar

unread,
Jul 29, 2019, 3:21:07 PM7/29/19
to vim/vim, vim-dev ML, Comment

I probably have more tests crash than most others, since I reproduce crashes when trying to fix them. But I don't recall having a problem with swapfiles. Thus I tend to think this is not so relevant.


You are receiving this because you commented.

Daniel Hahler

unread,
Jul 30, 2019, 12:45:44 PM7/30/19
to vim/vim, vim-dev ML, Comment

Closed #4742.


You are receiving this because you commented.

Reply all
Reply to author
Forward
0 new messages