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
498ab727
Commit
498ab727
authored
1 year ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
test: use create_space api in tests
parent
e3f665e4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!538
Feat/dml global
Pipeline
#18651
passed
1 year ago
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/int/test_ddl.py
+12
-22
12 additions, 22 deletions
test/int/test_ddl.py
test/int/test_dml.py
+7
-9
7 additions, 9 deletions
test/int/test_dml.py
with
19 additions
and
31 deletions
test/int/test_ddl.py
+
12
−
22
View file @
498ab727
...
...
@@ -95,21 +95,16 @@ def test_ddl_create_space_bulky(cluster: Cluster):
############################################################################
# Propose a space creation which will succeed
c
ommit_index
=
i1
.
propose_
create_space
(
c
luster
.
create_space
(
dict
(
id
=
space_id
,
name
=
"
stuff
"
,
format
=
[
dict
(
name
=
"
id
"
,
type
=
"
unsigned
"
,
is_nullable
=
False
)],
primary_key
=
[
dict
(
field
=
"
id
"
)
],
distribution
=
dict
(
kind
=
"
global
"
)
,
primary_key
=
[
"
id
"
],
distribution
=
"
global
"
,
),
)
i1
.
call
(
"
.proc_sync_raft
"
,
commit_index
,
(
3
,
0
))
i2
.
call
(
"
.proc_sync_raft
"
,
commit_index
,
(
3
,
0
))
i3
.
call
(
"
.proc_sync_raft
"
,
commit_index
,
(
3
,
0
))
i4
.
call
(
"
.proc_sync_raft
"
,
commit_index
,
(
3
,
0
))
# This time schema version did change
assert
i1
.
call
(
"
box.space._pico_property:get
"
,
"
current_schema_version
"
)[
1
]
==
2
assert
i2
.
call
(
"
box.space._pico_property:get
"
,
"
current_schema_version
"
)[
1
]
==
2
...
...
@@ -210,7 +205,7 @@ def test_ddl_create_sharded_space(cluster: Cluster):
# Propose a space creation which will succeed
schema_version
=
i1
.
next_schema_version
()
space_id
=
679
index
=
i1
.
propose_
create_space
(
cluster
.
create_space
(
dict
(
id
=
space_id
,
name
=
"
stuff
"
,
...
...
@@ -219,14 +214,11 @@ def test_ddl_create_sharded_space(cluster: Cluster):
dict
(
name
=
"
foo
"
,
type
=
"
integer
"
,
is_nullable
=
False
),
dict
(
name
=
"
bar
"
,
type
=
"
string
"
,
is_nullable
=
False
),
],
primary_key
=
[
dict
(
field
=
"
id
"
)
],
distribution
=
dict
(
kind
=
"
sharded_implicitly
"
,
sharding_key
=
[
"
foo
"
,
"
bar
"
]),
primary_key
=
[
"
id
"
],
distribution
=
dict
(
sharding_key
=
[
"
foo
"
,
"
bar
"
]
,
sharding_fn
=
"
murmur3
"
),
),
)
i1
.
call
(
"
.proc_sync_raft
"
,
index
,
(
3
,
0
))
i2
.
call
(
"
.proc_sync_raft
"
,
index
,
(
3
,
0
))
############################################################################
# Space was created and is operable
pico_space_def
=
[
...
...
@@ -381,10 +373,10 @@ def test_successful_wakeup_after_ddl(cluster: Cluster):
id
=
space_id
,
name
=
"
space_name_conflict
"
,
format
=
[
dict
(
name
=
"
id
"
,
type
=
"
unsigned
"
,
is_nullable
=
False
)],
primary_key
=
[
dict
(
field
=
"
id
"
)
],
distribution
=
dict
(
kind
=
"
global
"
)
,
primary_key
=
[
"
id
"
],
distribution
=
"
global
"
,
)
index
=
i1
.
propose_
create_space
(
space_def
)
index
=
i1
.
create_space
(
space_def
)
i2
.
call
(
"
.proc_sync_raft
"
,
index
,
(
3
,
0
))
i3
.
call
(
"
.proc_sync_raft
"
,
index
,
(
3
,
0
))
...
...
@@ -416,18 +408,16 @@ def test_ddl_from_snapshot(cluster: Cluster):
# TODO: check other ddl operations
# Propose a space creation which will succeed
space_id
=
632
index
=
i1
.
propose_
create_space
(
cluster
.
create_space
(
dict
(
id
=
space_id
,
name
=
"
stuff
"
,
format
=
[
dict
(
name
=
"
id
"
,
type
=
"
unsigned
"
,
is_nullable
=
False
)],
primary_key
=
[
dict
(
field
=
"
id
"
)
],
distribution
=
dict
(
kind
=
"
sharded_implicitly
"
,
sharding_key
=
[
"
id
"
]
),
primary_key
=
[
"
id
"
],
distribution
=
dict
(
sharding_key
=
[
"
id
"
],
sharding_fn
=
"
murmur3
"
),
),
)
i2
.
call
(
"
.proc_sync_raft
"
,
index
,
(
3
,
0
))
tt_space_def
=
[
space_id
,
1
,
...
...
This diff is collapsed.
Click to expand it.
test/int/test_dml.py
+
7
−
9
View file @
498ab727
...
...
@@ -13,7 +13,7 @@ def test_global_space_dml_catchup_by_log(cluster: Cluster):
# Catcher-upper replicaset follower
i5
=
cluster
.
add_instance
(
wait_online
=
True
,
replicaset_id
=
"
r2
"
)
index
=
i1
.
ddl_
create_space
(
cluster
.
create_space
(
dict
(
id
=
812
,
name
=
"
candy
"
,
...
...
@@ -22,11 +22,10 @@ def test_global_space_dml_catchup_by_log(cluster: Cluster):
dict
(
name
=
"
kind
"
,
type
=
"
string
"
,
is_nullable
=
False
),
dict
(
name
=
"
kilos
"
,
type
=
"
number
"
,
is_nullable
=
False
),
],
primary_key
=
[
dict
(
field
=
"
id
"
)
],
distribution
=
dict
(
kind
=
"
global
"
)
,
primary_key
=
[
"
id
"
],
distribution
=
"
global
"
,
),
)
i2
.
raft_wait_index
(
index
,
3
)
# Some dml
index
=
i1
.
cas
(
"
insert
"
,
"
candy
"
,
[
1
,
"
marshmallow
"
,
2.7
])
...
...
@@ -103,7 +102,7 @@ def test_global_space_dml_catchup_by_snapshot(cluster: Cluster):
# Catcher-upper replicaset follower
i5
=
cluster
.
add_instance
(
wait_online
=
True
,
replicaset_id
=
"
r2
"
)
index
=
i1
.
ddl_
create_space
(
cluster
.
create_space
(
dict
(
id
=
812
,
name
=
"
candy
"
,
...
...
@@ -112,11 +111,10 @@ def test_global_space_dml_catchup_by_snapshot(cluster: Cluster):
dict
(
name
=
"
kind
"
,
type
=
"
string
"
,
is_nullable
=
False
),
dict
(
name
=
"
kilos
"
,
type
=
"
number
"
,
is_nullable
=
False
),
],
primary_key
=
[
dict
(
field
=
"
id
"
)
],
distribution
=
dict
(
kind
=
"
global
"
)
,
)
,
primary_key
=
[
"
id
"
],
distribution
=
"
global
"
,
)
)
i2
.
raft_wait_index
(
index
,
3
)
# Some dml
index
=
i1
.
cas
(
"
insert
"
,
"
candy
"
,
[
1
,
"
marshmallow
"
,
2.7
])
...
...
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