Skip to content

Add automatic deletion directory if workdir is custom #348

Open
@ochaplashkin

Description

@ochaplashkin

After the #327, we added the following logic: the entire vardir is deleted automatically or not (if the --not-clean flag is passed). However, if the user wants to use his workdir for the server, he is forced to manually delete it (fio.rmtree(server.workdir))

If the workdir is custom (i.e. passed as a parameter), then delete it automatically.

Current behavior:

g.before_each(function(cg)
    cg.server = server:new {
        box_cfg = {},
        workdir = fio.cwd() .. '/tmp'
    }
    cg.server:start()
end)

g.after_each(function(cg)
    cg.server:drop()
    fio.rmtree(cg.server.workdir) <--- this is mandatory
end)

g.test_foreign_keys = function(cg)
    cg.server:exec(function()
        t.assert(true)
    end)
end

Expected behavior:

...
g.after_each(function(cg)
    cg.server:drop()
end)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions