Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic deletion directory if workdir is custom #348

Open
ochaplashkin opened this issue Dec 26, 2023 · 0 comments
Open

Add automatic deletion directory if workdir is custom #348

ochaplashkin opened this issue Dec 26, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ochaplashkin
Copy link

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)
...
@ochaplashkin ochaplashkin added the bug Something isn't working label Dec 26, 2023
@ochaplashkin ochaplashkin changed the title Add automatic deletion directory if wokrdir is custom Add automatic deletion directory if workdir is custom Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant