-
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
Change conversion of box.error
to string in error message assertions
#355
Open
CuriousGeorgiy
wants to merge
2
commits into
tarantool:master
Choose a base branch
from
CuriousGeorgiy:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CuriousGeorgiy
force-pushed
the
master
branch
from
February 21, 2024 11:18
2ab64a2
to
0f7eac6
Compare
CuriousGeorgiy
added a commit
to CuriousGeorgiy/test-run
that referenced
this pull request
Feb 22, 2024
New version includes the following commits. - Change conversion of `box.error` to string in error message assertions [1] [1]: tarantool/luatest@xxx (WIP tarantool/luatest#355)
CuriousGeorgiy
added a commit
to CuriousGeorgiy/test-run
that referenced
this pull request
Feb 22, 2024
New version includes the following commits. - Change conversion of `box.error` to string in error message assertions [1] [1]: tarantool/luatest@xxx (WIP tarantool/luatest#355)
CuriousGeorgiy
added a commit
to CuriousGeorgiy/test-run
that referenced
this pull request
Feb 22, 2024
New version includes the following commits. - Change conversion of `box.error` to string in error message assertions [1] [1] tarantool/luatest@xxx (WIP tarantool/luatest#355)
CuriousGeorgiy
force-pushed
the
master
branch
from
February 22, 2024 13:25
0f7eac6
to
8da205a
Compare
CuriousGeorgiy
added a commit
to CuriousGeorgiy/tarantool
that referenced
this pull request
Feb 22, 2024
Currently, error message assertions convert `box.error` to string using `tostring`. `box.error`'s `__tostring` metamethod is currently equivalent to the `message` field of `box.error`. In scope of tarantool#9105, we are going to increase the verbosity of `box.error` `__tostring` metamethod, and it will no longer be convenient for testing the error message. Let's replace `tostring(error)` usage with `error.message` to retain the old behaviour. See also tarantool/luatest@xxx (WIP tarantool/luatest#355). Needed for tarantool#9105 NO_CHANGELOG=<tests change> NO_DOC=<tests change>
CuriousGeorgiy
added a commit
to CuriousGeorgiy/tarantool
that referenced
this pull request
Feb 22, 2024
Bump test-run to new version with the following improvements: - Bump luatest to 1.0.0-5-gxxx (WIP tarantool/luatest#355) [1] - Disable verbose serialization of box.error in diff tests [2] [1] tarantool/test-run@xxx (WIP tarantool/test-run#tarantool#424) [2] tarantool/test-run@xxx (WIP tarantool#424) NO_DOC=test NO_TEST=test NO_CHANGELOG=test
CuriousGeorgiy
force-pushed
the
master
branch
from
February 22, 2024 14:40
8da205a
to
fc5c42e
Compare
CuriousGeorgiy
added a commit
to CuriousGeorgiy/test-run
that referenced
this pull request
Feb 22, 2024
New version includes the following commits. - Change conversion of `box.error` to string in error message assertions [1] [1] tarantool/luatest@xxx (WIP tarantool/luatest#355)
CuriousGeorgiy
added a commit
to CuriousGeorgiy/tarantool
that referenced
this pull request
Feb 22, 2024
Bump test-run to new version with the following improvements: - Bump luatest to 1.0.0-5-gxxx (WIP tarantool/luatest#355) [1] - Disable verbose serialization of box.error in diff tests [2] [1] tarantool/test-run@xxx (WIP tarantool/test-run#tarantool#424) [2] tarantool/test-run@xxx (WIP tarantool#424) NO_DOC=test NO_TEST=test NO_CHANGELOG=test
CuriousGeorgiy
added a commit
to CuriousGeorgiy/tarantool
that referenced
this pull request
Feb 22, 2024
Currently, error message assertions convert `box.error` to string using `tostring`. `box.error`'s `__tostring` metamethod is currently equivalent to the `message` field of `box.error`. In scope of tarantool#9105, we are going to increase the verbosity of `box.error` `__tostring` metamethod, and it will no longer be convenient for testing the error message. Let's replace `tostring(error)` usage with `error.message` to retain the old behaviour. See also tarantool/luatest@xxx (WIP tarantool/luatest#355). Needed for tarantool#9105 NO_CHANGELOG=<tests change> NO_DOC=<tests change>
CuriousGeorgiy
added a commit
to CuriousGeorgiy/tarantool
that referenced
this pull request
Feb 22, 2024
Bump test-run to new version with the following improvements: - Bump luatest to 1.0.0-5-gxxx (WIP tarantool/luatest#355) [1] - Disable verbose serialization of box.error in diff tests [2] [1] tarantool/test-run@xxx (WIP tarantool/test-run#tarantool#424) [2] tarantool/test-run@xxx (WIP tarantool#424) NO_DOC=test NO_TEST=test NO_CHANGELOG=test
Currently, error message assertions convert `box.error` to string using `tostring`. The string conversion metamethod of `box.error` is currently equivalent to the `message` field of `box.error`. In scope of tarantool/tarantool#9105, we are going to increase the verbosity of the string metamethod, and it will no longer be suitable for testing error messages. Let's replace `tostring(error)` conversions with `error.message` to retain the old behaviour. Needed for tarantool/tarantool#9105
CuriousGeorgiy
force-pushed
the
master
branch
from
February 22, 2024 18:59
fc5c42e
to
cab46b4
Compare
CuriousGeorgiy
added a commit
to CuriousGeorgiy/test-run
that referenced
this pull request
Feb 22, 2024
New version includes the following commits. - Change conversion of `box.error` to string in error message assertions [1] [1] tarantool/luatest@xxx (WIP tarantool/luatest#355)
CuriousGeorgiy
added a commit
to CuriousGeorgiy/tarantool
that referenced
this pull request
Feb 22, 2024
Bump test-run to new version with the following improvements: - Bump luatest to 1.0.0-5-gxxx (WIP tarantool/luatest#355) [1] - Disable verbose serialization of box.error in diff tests [2] [1] tarantool/test-run@xxx (WIP tarantool/test-run#tarantool#424) [2] tarantool/test-run@xxx (WIP tarantool#424) NO_DOC=test NO_TEST=test NO_CHANGELOG=test
CuriousGeorgiy
added a commit
to CuriousGeorgiy/test-run
that referenced
this pull request
Feb 22, 2024
New version includes the following commits. - Change conversion of `box.error` to string in error message assertions [1] [1] tarantool/luatest@xxx (WIP tarantool/luatest#355)
CuriousGeorgiy
added a commit
to CuriousGeorgiy/tarantool
that referenced
this pull request
Feb 22, 2024
Bump test-run to new version with the following improvements: - Bump luatest to 1.0.0-5-gxxx (WIP tarantool/luatest#355) [1] - Disable verbose serialization of box.error in diff tests [2] [1] tarantool/test-run@xxx (WIP tarantool/test-run#tarantool#424) [2] tarantool/test-run@xxx (WIP tarantool#424) NO_DOC=test NO_TEST=test NO_CHANGELOG=test
CuriousGeorgiy
added a commit
to CuriousGeorgiy/tarantool
that referenced
this pull request
Feb 22, 2024
`box.error`'s string conversion metamethod is currently equivalent to the `message` field of `box.error`. In scope of tarantool#9105, we are going to increase the verbosity of the string conversion metamethod, and it will no longer be suitable for testing the error message. Let's replace `tostring(error)` usage with `error.message` to retain the old behaviour. See also tarantool/luatest@xxx (WIP tarantool/luatest#355). Needed for tarantool#9105 NO_CHANGELOG=<tests change> NO_DOC=<tests change>
CuriousGeorgiy
added a commit
to CuriousGeorgiy/tarantool
that referenced
this pull request
Feb 22, 2024
Bump test-run to new version with the following improvements: - Bump luatest to 1.0.0-5-gxxx (WIP tarantool/luatest#355) [1] - Disable verbose serialization of box.error in diff tests [2] [1] tarantool/test-run@xxx (WIP tarantool/test-run#tarantool#424) [2] tarantool/test-run@xxx (WIP tarantool#424) NO_DOC=test NO_TEST=test NO_CHANGELOG=test
net.box's `eval` method always throws a `box.error` in case of an error. When we decode the `eval` we result, in case of an error we currently rely on the fact that the string conversion metamethod returns the error's message. However, in scope of tarantool/tarantool#9105, we are going to increase the verbosity of the string conversion metamethod, and it will no longer return the error's message. Let's explicitly extract the error's message to retain the old behaviour. Needed for tarantool/tarantool#9105
CuriousGeorgiy
added a commit
to CuriousGeorgiy/test-run
that referenced
this pull request
Feb 22, 2024
New version includes the following commits. - Change conversion of `box.error` to string in error message assertions [1] [1] tarantool/luatest@xxx (WIP tarantool/luatest#355)
CuriousGeorgiy
added a commit
to CuriousGeorgiy/tarantool
that referenced
this pull request
Feb 22, 2024
Bump test-run to new version with the following improvements: - Bump luatest to 1.0.0-5-gxxx (WIP tarantool/luatest#355) [1] - Disable verbose serialization of box.error in diff tests [2] [1] tarantool/test-run@xxx (WIP tarantool/test-run#tarantool#424) [2] tarantool/test-run@xxx (WIP tarantool#424) NO_DOC=test NO_TEST=test NO_CHANGELOG=test
CuriousGeorgiy
added a commit
to CuriousGeorgiy/tarantool
that referenced
this pull request
Feb 26, 2024
Bump test-run to new version with the following improvements: - Bump luatest to 1.0.0-5-gxxx (WIP tarantool/luatest#355) [1] - Disable verbose serialization of box.error in diff tests [2] [1] tarantool/test-run@xxx (WIP tarantool/test-run#tarantool#424) [2] tarantool/test-run@xxx (WIP tarantool#424) NO_DOC=test NO_TEST=test NO_CHANGELOG=test
ylobankov
reviewed
Feb 26, 2024
@@ -611,7 +611,9 @@ end | |||
|
|||
local function exec_tail(ok, ...) | |||
if not ok then | |||
local _ok, res = pcall(json.decode, tostring(...)) | |||
local err = ... |
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.
Is new code block compatible with Tarantool 1.10?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch changes the conversion of
box.error
to string to retain the behavior after tarantool/tarantool#9105.Needed for tarantool/tarantool#9105