-
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
Fix saving artifacts #318
Merged
ylobankov
merged 1 commit into
tarantool:master
from
ochaplashkin:fix-save-artifacts-in-before-hook
Aug 28, 2023
Merged
Fix saving artifacts #318
ylobankov
merged 1 commit into
tarantool:master
from
ochaplashkin:fix-save-artifacts-in-before-hook
Aug 28, 2023
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
ochaplashkin
force-pushed
the
fix-save-artifacts-in-before-hook
branch
4 times, most recently
from
August 17, 2023 11:09
92779e6
to
a67064f
Compare
I found a corner case: g.s = Server:new()
g.s:start()
g.test_foo = function()
t.assert(true)
end
g.test_bar = function()
t.assert(false)
end
g.after_all(function()
g.s:get_vclock()
end) Expected: test_foo - success Actual:
|
ochaplashkin
force-pushed
the
fix-save-artifacts-in-before-hook
branch
3 times, most recently
from
August 22, 2023 11:56
df47ba0
to
e8cce9c
Compare
ylobankov
reviewed
Aug 24, 2023
ochaplashkin
force-pushed
the
fix-save-artifacts-in-before-hook
branch
from
August 25, 2023 11:27
e8cce9c
to
c703bce
Compare
ylobankov
reviewed
Aug 25, 2023
ochaplashkin
force-pushed
the
fix-save-artifacts-in-before-hook
branch
2 times, most recently
from
August 28, 2023 05:41
65d93b3
to
768809e
Compare
ylobankov
approved these changes
Aug 28, 2023
> What's the problem? When creating the logic for saving artifacts [1] a global variable has been created as `current_test` in the `runner.lua` module. Luatest has collected all the tests and runs a simple loop. At the beginning of each iteration the current test is written to the `current_test'. Server saved the value of the current test. However at some point the current test in the global variable and in the server object were different (the server stored information about the previous test). Also server does not store information about which test it was used in. > What is the solution? Redesign the logic of working with artifacts: now each test knows which server is linked to it, and each server knows about the test. For example: foo = Server:new() foo:start() -- only `foo` artifacts g.test_with_foo = function() foo:exec(...) end -- no server artifacts g.test_without_servers = function() ... end [1] tarantool#296 Helped-by: Igor Munkin <[email protected]> Close tarantool#299
ochaplashkin
force-pushed
the
fix-save-artifacts-in-before-hook
branch
from
August 28, 2023 12:36
768809e
to
a8c57c9
Compare
Closed
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.
What's the problem?
When creating the logic for saving artifacts 1 a global variable has been created as
current_test
in therunner.lua
module. Luatest has collected all the tests and runs a simple loop. At the beginning of each iteration the current test is written to thecurrent_test
.Server saved the value of the current test. However at some point the current test in the global variable and in the server object were different (the server stored information about the previous test). Also server does not store information about which test it was used in.
What is the solution?
Redesign the logic of working with artifacts: now each test knows which server is linked to it, and each server knows about the test.
For example:
How it works?
Common behavior with hooks
Output
Advanced behavior with hooks
Now there is no confusion between tests and servers. Only the server that is "linked" to the test will always be specified.
Output
❤️ Dynamic linking upon use
New feature: when using any server method, we will link it dynamically to the test. (thanks for the help @igormunkin ❤️ )
Output
📤 TAP 13 output
Artifacts:
Close #299
Footnotes
Keep artifacts of server(logs, snap, etc) if test has been failed #296 ↩