-
Notifications
You must be signed in to change notification settings - Fork 10
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
Ban direct calling of box.cfg() #245
Comments
Just tarantool> box.cfg = setmetatable({}, {__call = function() error('No!', 0) end})
tarantool> box.cfg()
---
- error: No!
... @ylobankov proposed to just add it to |
Direct call and configuration of the runner instance is prohibited. Now if you need to test something with specific configuration use a server instance please (see luatest.Server module). In-scope-of tarantool/luatest#245 NO_DOC=ban calling box.cfg NO_TEST=ban calling box.cfg NO_CHANGELOG=ban calling box.cfg
Direct call and configuration of the runner instance is prohibited. Now if you need to test something with specific configuration use a server instance please (see luatest.Server module). In-scope-of tarantool/luatest#245 NO_DOC=ban calling box.cfg NO_TEST=ban calling box.cfg NO_CHANGELOG=ban calling box.cfg
Direct call and configuration of the runner instance is prohibited. Now if you need to test something with specific configuration use a server instance please (see luatest.Server module). In-scope-of tarantool/luatest#245 NO_DOC=ban calling box.cfg NO_TEST=ban calling box.cfg NO_CHANGELOG=ban calling box.cfg
Direct call and configuration of the runner instance is prohibited. Now if you need to test something with specific configuration use a server instance please (see luatest.Server module). In-scope-of tarantool/luatest#245 NO_DOC=ban calling box.cfg NO_TEST=ban calling box.cfg NO_CHANGELOG=ban calling box.cfg
Direct call and configuration of the runner instance is prohibited. Now if you need to test something with specific configuration use a server instance please (see luatest.Server module). In-scope-of tarantool/luatest#245 NO_DOC=ban calling box.cfg NO_TEST=ban calling box.cfg NO_CHANGELOG=ban calling box.cfg
Direct call and configuration of the runner instance is prohibited. Now if you need to test something with specific configuration use a server instance please (see luatest.Server module). In-scope-of tarantool/luatest#245 NO_DOC=ban calling box.cfg NO_TEST=ban calling box.cfg NO_CHANGELOG=ban calling box.cfg
Direct call and configuration of the runner instance is prohibited. Now if you need to test something with specific configuration use a server instance please (see luatest.Server module). In-scope-of tarantool/luatest#245 NO_DOC=ban calling box.cfg NO_TEST=ban calling box.cfg NO_CHANGELOG=ban calling box.cfg
Direct call and configuration of the runner instance is prohibited. Now if you need to test something with specific configuration use a server instance please (see luatest.Server module). In-scope-of tarantool/luatest#245 NO_DOC=ban calling box.cfg NO_TEST=ban calling box.cfg NO_CHANGELOG=ban calling box.cfg
Direct call and configuration of the runner instance is prohibited. Now if you need to test something with specific configuration use a server instance please (see luatest.Server module). In-scope-of tarantool/luatest#245 NO_DOC=ban calling box.cfg NO_TEST=ban calling box.cfg NO_CHANGELOG=ban calling box.cfg (cherry picked from commit fc3426d)
Direct call and configuration of the runner instance is prohibited. Now if you need to test something with specific configuration use a server instance please (see luatest.Server module). In-scope-of tarantool/luatest#245 NO_DOC=ban calling box.cfg NO_TEST=ban calling box.cfg NO_CHANGELOG=ban calling box.cfg (cherry picked from commit fc3426d)
Direct call and configuration of the runner instance is prohibited. Now if you need to test something with specific configuration use a server instance please (see luatest.Server module). In-scope-of tarantool/luatest#245 NO_DOC=ban calling box.cfg NO_TEST=ban calling box.cfg NO_CHANGELOG=ban calling box.cfg (cherry picked from commit fc3426d)
Let's consider this fixed. We banned calling |
It likely badly influence other tests and may look like luatest itself is buggy.
The proposal is to forbid calling
box.cfg()
not only from topmost level code, but also from tests. If we'll do only the former, a test that follows one that callsbox.cfg()
will be influenced and this effect will depend on the order of tests. It is better if a test withbox.cfg()
will always fail.It can be implemented either as a check after
require('<...>_test.lua')
and after execution of a test. Or we can simply dobox.cfg = nil
before loading tests.If
box.cfg()
is required for testing, it should be called on an auxiliary instance.Motivating issue in tarantool/tarantool#7647. See also #191.
The text was updated successfully, but these errors were encountered: