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
5c60ed9a
Commit
5c60ed9a
authored
1 year ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
test: fix test_proc_runtime_info
parent
07d25039
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!855
Gmoshkin/service auth
Pipeline
#32416
passed
1 year ago
Stage: test
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/conftest.py
+12
-3
12 additions, 3 deletions
test/conftest.py
test/int/test_basics.py
+12
-0
12 additions, 0 deletions
test/int/test_basics.py
test/int/test_http_server.py
+1
-10
1 addition, 10 deletions
test/int/test_http_server.py
with
25 additions
and
13 deletions
test/conftest.py
+
12
−
3
View file @
5c60ed9a
...
@@ -1567,10 +1567,19 @@ def cluster(
...
@@ -1567,10 +1567,19 @@ def cluster(
@pytest.fixture
@pytest.fixture
def
instance
(
cluster
:
Cluster
)
->
Generator
[
Instance
,
None
,
None
]:
def
instance
(
cluster
:
Cluster
,
pytestconfig
)
->
Generator
[
Instance
,
None
,
None
]:
"""
Returns a deployed instance forming a single-node cluster.
"""
"""
Returns a deployed instance forming a single-node cluster.
"""
cluster
.
deploy
(
instance_count
=
1
)
instance
=
cluster
.
add_instance
(
wait_online
=
False
)
yield
cluster
[
0
]
has_webui
=
bool
(
pytestconfig
.
getoption
(
"
--with-webui
"
))
if
has_webui
:
instance
.
env
[
"
PICODATA_HTTP_LISTEN
"
]
=
f
"
{
cluster
.
base_host
}
:
{
cluster
.
base_port
+
80
}
"
instance
.
start
()
instance
.
wait_online
()
yield
instance
@pytest.fixture
@pytest.fixture
...
...
This diff is collapsed.
Click to expand it.
test/int/test_basics.py
+
12
−
0
View file @
5c60ed9a
...
@@ -412,6 +412,7 @@ def test_proc_raft_info(instance: Instance):
...
@@ -412,6 +412,7 @@ def test_proc_raft_info(instance: Instance):
)
)
@pytest.mark.webui
def
test_proc_runtime_info
(
instance
:
Instance
):
def
test_proc_runtime_info
(
instance
:
Instance
):
info
=
instance
.
call
(
"
.proc_runtime_info
"
)
info
=
instance
.
call
(
"
.proc_runtime_info
"
)
...
@@ -420,6 +421,12 @@ def test_proc_runtime_info(instance: Instance):
...
@@ -420,6 +421,12 @@ def test_proc_runtime_info(instance: Instance):
# add a bootstrap entry.
# add a bootstrap entry.
info
[
"
raft
"
][
"
applied
"
]
=
69
info
[
"
raft
"
][
"
applied
"
]
=
69
version_info
=
instance
.
call
(
"
.proc_version_info
"
)
host_port
=
instance
.
env
[
"
PICODATA_HTTP_LISTEN
"
]
host
,
port
=
host_port
.
split
(
"
:
"
)
port
=
int
(
port
)
# type: ignore
assert
info
==
dict
(
assert
info
==
dict
(
raft
=
dict
(
raft
=
dict
(
id
=
1
,
id
=
1
,
...
@@ -432,6 +439,11 @@ def test_proc_runtime_info(instance: Instance):
...
@@ -432,6 +439,11 @@ def test_proc_runtime_info(instance: Instance):
main_loop_status
=
"
idle
"
,
main_loop_status
=
"
idle
"
,
governor_loop_status
=
"
idle
"
,
governor_loop_status
=
"
idle
"
,
),
),
http
=
dict
(
host
=
host
,
port
=
port
,
),
version_info
=
version_info
,
)
)
...
...
This diff is collapsed.
Click to expand it.
test/int/test_http_server.py
+
1
−
10
View file @
5c60ed9a
from
conftest
import
Cluster
,
Instance
from
conftest
import
Instance
from
urllib.request
import
urlopen
from
urllib.request
import
urlopen
import
pytest
import
pytest
import
json
import
json
@pytest.fixture
def
instance
(
cluster
:
Cluster
):
instance
=
cluster
.
add_instance
(
wait_online
=
False
)
instance
.
env
[
"
PICODATA_HTTP_LISTEN
"
]
=
f
"
{
cluster
.
base_host
}
:
{
cluster
.
base_port
+
80
}
"
instance
.
start
()
instance
.
wait_online
()
return
instance
def
test_http_routes
(
instance
:
Instance
):
def
test_http_routes
(
instance
:
Instance
):
instance
.
eval
(
instance
.
eval
(
"""
"""
...
...
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