-
Notifications
You must be signed in to change notification settings - Fork 58
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
Session settings #247
Session settings #247
Conversation
4e2f115
to
31a1af1
Compare
Use skipIfLess helpers like in other test conditions. Follows #119
In Tarantool, user space ids starts from 512. You can set arbitrary id or use autoincrement (sequence also starts from 512). Unfortunately, mixing spaces with autoincremented ids and spaces with explicit ids may cause id conflict [1]. Since there are cases when we cannot explicitly set space id (creating a space with SQL), a short range of free ids (from 512 to 515) causes problems. This patch increases range of free ids (now it's from 512 to 615) so it should be ok until [1] is resolved. 1. tarantool/tarantool#8036 Part of #215
da30c5b
to
8ab466a
Compare
Set up package paths so queue test instances could be run with arbitrary work_dir. Part of #215
9bf4566
to
c5cd184
Compare
12096dc
to
404772c
Compare
Generate tmp work directories for each new Tarantool instance, if not specified. It prevents possible directory clash issues. Later `ioutil.TempDir` (deprecated since Go 1.17) must be replaced with `os.MkdirTemp` (introduced in Go 1.16 as a replacement) when we drop support of Go 1.16 an older. Part of #215
Make skip helpers public. Add more wrappers to reduce code duplication. Part of #215
404772c
to
f8fe4ef
Compare
settings/request_test.go
Outdated
func TestRequestsAsync(t *testing.T) { | ||
tests := []struct { | ||
req tarantool.Request | ||
async bool | ||
}{ | ||
{req: NewErrorMarshalingEnabledSetRequest(false), async: false}, | ||
{req: NewErrorMarshalingEnabledGetRequest(), async: false}, | ||
{req: NewSQLDefaultEngineSetRequest("memtx"), async: false}, | ||
{req: NewSQLDefaultEngineGetRequest(), async: false}, | ||
{req: NewSQLDeferForeignKeysSetRequest(false), async: false}, | ||
{req: NewSQLDeferForeignKeysGetRequest(), async: false}, | ||
{req: NewSQLFullColumnNamesSetRequest(false), async: false}, | ||
{req: NewSQLFullColumnNamesGetRequest(), async: false}, | ||
{req: NewSQLFullMetadataSetRequest(false), async: false}, | ||
{req: NewSQLFullMetadataGetRequest(), async: false}, | ||
{req: NewSQLParserDebugSetRequest(false), async: false}, | ||
{req: NewSQLParserDebugGetRequest(), async: false}, | ||
{req: NewSQLRecursiveTriggersSetRequest(false), async: false}, | ||
{req: NewSQLRecursiveTriggersGetRequest(), async: false}, | ||
{req: NewSQLReverseUnorderedSelectsSetRequest(false), async: false}, | ||
{req: NewSQLReverseUnorderedSelectsGetRequest(), async: false}, | ||
{req: NewSQLSelectDebugSetRequest(false), async: false}, | ||
{req: NewSQLSelectDebugGetRequest(), async: false}, | ||
{req: NewSQLVDBEDebugSetRequest(false), async: false}, | ||
{req: NewSQLVDBEDebugGetRequest(), async: false}, | ||
} | ||
|
||
for _, test := range tests { | ||
if async := test.req.Async(); async != test.async { | ||
t.Errorf("An invalid async %t, expected %t", async, test.async) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need to add unit-tests for methods:
Code(), Body(), Context(), Ctx()
It would be good to split integration tests and unit tests into two files: tarantool_test.go? (integration), request_test.go (unit).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separated, added simple unit tests (without Body buffer comparison)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without Body buffer comparison
If we want complete beauty, it is better to add (SelectRequest.Body() == GetRequest.Body(), UpdateRequest.Body() == SetRequest.Body()), but it doesn't look critical, so up to you.
f87ee86
to
cdf2abe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the patch!
Support session settings in a separate subpackage "settings" [1]. It allows to create a specific requests to get or set session settings. Settings are independent for each connection. 1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_space/_session_settings/ Closes #215
cdf2abe
to
7665568
Compare
Support session settings in a separate subpackage "settings" [1]. It allows to create a specific Select/Update requests to get or set session settings. Settings are independent for each connection.
I didn't forget about (remove if it is not applicable):
Closes #215