Skip to content

Commit

Permalink
test(ALL): stop using mark_flaky() helper
Browse files Browse the repository at this point in the history
  • Loading branch information
echasnovski committed Oct 7, 2024
1 parent 379a3dd commit 5858eaf
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
7 changes: 0 additions & 7 deletions tests/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,6 @@ Helpers.new_child_neovim = function()
return child
end

-- Mark test failure as "flaky"
Helpers.mark_flaky = function()
MiniTest.finally(function()
if #MiniTest.current.case.exec.fails > 0 then MiniTest.add_note('This test is flaky.') end
end)
end

-- Detect CI
Helpers.is_ci = function() return os.getenv('CI') ~= nil end
Helpers.skip_in_ci = function(msg)
Expand Down
17 changes: 0 additions & 17 deletions tests/test_indentscope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ local helpers = dofile('tests/helpers.lua')
local child = helpers.new_child_neovim()
local expect, eq = helpers.expect, helpers.expect.equality
local new_set = MiniTest.new_set
local mark_flaky = helpers.mark_flaky

-- Helpers with child processes
--stylua: ignore start
Expand Down Expand Up @@ -389,8 +388,6 @@ T['draw()'] = new_set({
})

T['draw()']['works'] = function()
mark_flaky()

set_cursor(6, 1)
child.lua('MiniIndentscope.draw()')

Expand Down Expand Up @@ -434,8 +431,6 @@ T['draw()']['uses correct highlight groups'] = new_set(
)

T['draw()']['respects `config.draw.animation`'] = function()
mark_flaky()

local validate = function(duration)
set_cursor(5, 4)
child.lua('MiniIndentscope.draw()')
Expand Down Expand Up @@ -463,8 +458,6 @@ T['draw()']['respects `config.draw.animation`'] = function()
end

T['draw()']['respects `config.draw.priority`'] = function()
mark_flaky()

local ns_id = child.api.nvim_create_namespace('indentscope-test')
child.api.nvim_buf_set_extmark(0, ns_id, 4, 0, { virt_text_pos = 'overlay', virt_text = { { '+' } }, priority = 5 })

Expand All @@ -482,8 +475,6 @@ T['draw()']['respects `config.draw.priority`'] = function()
end

T['draw()']['respects `config.symbol`'] = function()
mark_flaky()

child.lua([[MiniIndentscope.config.symbol = '-']])
set_cursor(5, 4)
child.lua('MiniIndentscope.draw()')
Expand All @@ -498,8 +489,6 @@ T['draw()']['respects `config.symbol`'] = function()
end

T['draw()']["does not overshadow 'listchars'"] = function()
mark_flaky()

child.o.list = true
child.o.listchars = 'space:.'

Expand Down Expand Up @@ -565,8 +554,6 @@ T['undraw()'] = new_set({
})

T['undraw()']['works'] = function()
mark_flaky()

set_cursor(5, 4)
child.lua('MiniIndentscope.draw()')
child.expect_screenshot()
Expand All @@ -585,8 +572,6 @@ T['Auto drawing'] = new_set({
})

T['Auto drawing']['works in Normal mode'] = function()
mark_flaky()

set_cursor(5, 4)
sleep(default_draw_delay - small_time)
-- Nothing should yet be shown
Expand All @@ -604,8 +589,6 @@ T['Auto drawing']['respects common events'] = new_set({
parametrize = { { 'CursorMoved' }, { 'CursorMovedI' }, { 'TextChanged' }, { 'TextChangedI' }, { 'TextChangedP' } },
}, {
test = function(event_name)
mark_flaky()

set_cursor(5, 4)
child.lua('MiniIndentscope.undraw()')
sleep(small_time)
Expand Down
4 changes: 0 additions & 4 deletions tests/test_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ local helpers = dofile('tests/helpers.lua')
local child = helpers.new_child_neovim()
local expect, eq = helpers.expect, helpers.expect.equality
local new_set, finally = MiniTest.new_set, MiniTest.finally
local mark_flaky = helpers.mark_flaky

-- Helpers with child processes
--stylua: ignore start
Expand Down Expand Up @@ -1453,8 +1452,6 @@ T['gen_reporter']['buffer'] = new_set({
test = function(opts_element)
if child.fn.has('nvim-0.10') == 0 then MiniTest.skip('Screenshots are generated for Neovim>=0.10.') end

mark_flaky()

-- Testing "in dynamic" is left for manual approach
local path = get_ref_path('testref_reporters.lua')
local reporter_command = string.format('_G.reporter = MiniTest.gen_reporter.buffer({ %s })', opts_element)
Expand Down Expand Up @@ -1492,7 +1489,6 @@ T['gen_reporter']['stdout'] = new_set({
}, {
test = function(env_var)
helpers.skip_on_windows('Terminal tests are designed for Unix')
mark_flaky()

-- Testing "in dynamic" is left for manual approach
local path = 'tests/dir-test/init_stdout-reporter_works.lua'
Expand Down

0 comments on commit 5858eaf

Please sign in to comment.