Skip to content

Commit

Permalink
fix: test conflicts in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
Goose97 committed Dec 16, 2024
1 parent c58691e commit 05d5e2b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions tests/timber/actions/timber_actions_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1343,8 +1343,8 @@ describe("timber.actions.clear_log_statements", function()

describe("given the global opts is true", function()
before_each(function()
vim.fn.system({ "rm", "-rf", "test_sandbox" })
vim.fn.mkdir("test_sandbox")
vim.fn.system({ "rm", "-rf", "test_sandbox.actions" })
vim.fn.mkdir("test_sandbox.actions")
local random = math.random(1000)

timber.setup({
Expand All @@ -1358,7 +1358,7 @@ describe("timber.actions.clear_log_statements", function()
end)

after_each(function()
vim.fn.system({ "rm", "-rf", "test_sandbox" })
vim.fn.system({ "rm", "-rf", "test_sandbox.actions" })
end)

it("clears all statements in ALL buffers", function()
Expand Down Expand Up @@ -1388,8 +1388,8 @@ describe("timber.actions.clear_log_statements", function()
end,
})

write_buf_file(bufnr1, "test_sandbox/clear1")
write_buf_file(bufnr2, "test_sandbox/clear2")
write_buf_file(bufnr1, "test_sandbox.actions/clear1")
write_buf_file(bufnr2, "test_sandbox.actions/clear2")

helper.wait(20)
actions.clear_log_statements({ global = true })
Expand Down
8 changes: 4 additions & 4 deletions tests/timber/timber_summary_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -608,19 +608,19 @@ describe("timber.summary._open_entry", function()

describe("given the log placeholder is NOT in a loaded buffer", function()
before_each(function()
vim.fn.system({ "rm", "-rf", "test_sandbox" })
vim.fn.mkdir("test_sandbox")
vim.fn.system({ "rm", "-rf", "test_sandbox.summary" })
vim.fn.mkdir("test_sandbox.summary")
end)

after_each(function()
vim.fn.system({ "rm", "-rf", "test_sandbox" })
vim.fn.system({ "rm", "-rf", "test_sandbox.summary" })
end)

it("opens the buffer and jump to the line", function()
local id = watcher.generate_unique_id()
local file_content = string.format([[print("%s%s| Hello world")]], watcher.MARKER, id)

local file = io.open("test_sandbox/open_entry1", "w")
local file = io.open("test_sandbox.summary/open_entry1", "w")
---@cast file -nil
file:write(file_content)
file:close()
Expand Down

0 comments on commit 05d5e2b

Please sign in to comment.