Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
62068ae5
Commit
62068ae5
authored
1 year ago
by
Dmitry Ivanov
Browse files
Options
Downloads
Patches
Plain Diff
fix: `picodata connect` eats error logs and exit codes
parent
26da2901
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!621
Add proper support for LDAP
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/connect.lua
+13
-12
13 additions, 12 deletions
src/connect.lua
test/int/test_cli_connect.py
+2
-4
2 additions, 4 deletions
test/int/test_cli_connect.py
with
15 additions
and
16 deletions
src/connect.lua
+
13
−
12
View file @
62068ae5
local
console
=
require
(
"console"
)
local
console
=
require
(
"console"
)
local
uri
=
...
local
TIMEOUT_INFINITY
=
100
*
365
*
86400
local
TIMEOUT_INFINITY
=
100
*
365
*
86400
local
arg
=
...
local
opts
=
{}
opts
.
timeout
=
TIMEOUT_INFINITY
console
.
on_start
(
function
(
self
)
console
.
on_start
(
function
(
self
)
local
status
,
reason
local
status
,
reason
status
,
reason
=
pcall
(
status
,
reason
=
pcall
(
console
.
connect
,
uri
,
opts
)
console
.
connect
,
arg
,
{
connect_timeout
=
TIMEOUT_INFINITY
}
)
if
not
status
then
if
not
status
then
self
:
print
(
reason
)
-- `type(reason) == cdata`, so we have to convert it
os.exit
(
0
)
self
:
print
(
tostring
(
reason
))
os.exit
(
1
)
end
end
end
)
-- We should only set this after we try to connect, because
-- `console.connect` will call this before throwing eval errors
console
.
on_client_disconnect
(
function
(
_
)
console
.
on_client_disconnect
(
function
(
_
)
os.exit
(
0
)
os.exit
(
0
)
end
)
end
)
end
)
return
console
.
start
()
return
console
.
start
()
This diff is collapsed.
Click to expand it.
test/int/test_cli_connect.py
+
2
−
4
View file @
62068ae5
...
@@ -124,8 +124,7 @@ def test_wrong_pass(i1: Instance):
...
@@ -124,8 +124,7 @@ def test_wrong_pass(i1: Instance):
cli
.
expect_exact
(
"
Enter password for testuser:
"
)
cli
.
expect_exact
(
"
Enter password for testuser:
"
)
cli
.
sendline
(
"
badpass
"
)
cli
.
sendline
(
"
badpass
"
)
# FIXME: https://git.picodata.io/picodata/picodata/picodata/-/issues/247
cli
.
expect_exact
(
"
Connection is not established
"
)
cli
.
expect_exact
(
"
attempt to call method
'
endswith
'
(a nil value)
"
)
cli
.
expect_exact
(
pexpect
.
EOF
)
cli
.
expect_exact
(
pexpect
.
EOF
)
...
@@ -161,6 +160,5 @@ def test_connection_refused(binary_path: str):
...
@@ -161,6 +160,5 @@ def test_connection_refused(binary_path: str):
cli
.
expect_exact
(
"
Enter password for testuser:
"
)
cli
.
expect_exact
(
"
Enter password for testuser:
"
)
cli
.
sendline
(
""
)
cli
.
sendline
(
""
)
# FIXME: https://git.picodata.io/picodata/picodata/picodata/-/issues/247
cli
.
expect_exact
(
"
Connection is not established
"
)
cli
.
expect_exact
(
"
attempt to call method
'
endswith
'
(a nil value)
"
)
cli
.
expect_exact
(
pexpect
.
EOF
)
cli
.
expect_exact
(
pexpect
.
EOF
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment