Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
were ignored (gh-465).
- Fixed a bug when the luatest log file was removed if the command line
option `--no-cleanup` was not used (gh-471).
- Now the `treegen` helper creates temporary files in `VARDIR`, which is
`/tmp/t` by default, so as not to pollute the system tmp directory.

## 1.4.4

Expand Down
4 changes: 4 additions & 0 deletions luatest/runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ function Runner.mt:run()
end
fio.mktree(Server.vardir)

-- Set TMPDIR to make fio.tempdir() create temporary files in
-- the test directory so as not to pollute global /tmp.
os.setenv('TMPDIR', Server.vardir)

log.initialize({
vardir = Server.vardir,
log_file = self.log_file,
Expand Down
2 changes: 1 addition & 1 deletion test/luaunit/utility_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ function g.test_junit_output_escape_for_attributes()
})

function g_positive_start_stages.test_start() end
end, {'-o', 'junit', '-n', output_path}), 0)
end, {'-o', 'junit', '-n', output_path, '--no-clean'}), 0)

local file = assert(io.open(output_path .. '.xml'))
local xml = file:read('*a')
Expand Down
3 changes: 3 additions & 0 deletions test/treegen_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ g.test_prepare_directory = function()
treegen.add_template('^.*$', 'test_script')
local dir = treegen.prepare_directory({'foo/bar.lua', 'baz.lua'})

local VARDIR = os.getenv('VARDIR') or '/tmp/t'
t.assert_equals(fio.dirname(dir), VARDIR)

t.assert(fio.path.is_dir(dir))
t.assert(fio.path.exists(dir))

Expand Down
Loading