Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-mysqlbackend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
caosdb
Software
caosdb-mysqlbackend
Commits
4e96ecc4
Verified
Commit
4e96ecc4
authored
4 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: unittests versioning 8
parent
04f40567
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_reference_values.sql
+16
-20
16 additions, 20 deletions
tests/test_reference_values.sql
with
16 additions
and
20 deletions
tests/test_reference_values.sql
+
16
−
20
View file @
4e96ecc4
...
...
@@ -48,23 +48,6 @@ INSERT INTO feature_config (_key, _value) VALUES ("ENTITY_VERSIONING", "ENABLED"
-- TEST insertEntityProperty with Versioning - REFERENCE HEAD
-- TODO assert throws
SET
@
VALUE
=
"50@"
;
CALL
insertEntityProperty
(
0
,
@
EntityID
,
@
PropertyID
,
"reference_data"
,
@
Value
,
NULL
,
"FIX"
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
-- TODO switch expected/actual
SELECT
tap
.
eq
(
0
,
domain_id
,
"domain ok"
)
FROM
reference_data
;
SELECT
tap
.
eq
(
99
,
entity_id
,
"entity ok"
)
FROM
reference_data
;
SELECT
tap
.
eq
(
11
,
property_id
,
"property ok"
)
FROM
reference_data
;
SELECT
tap
.
eq
(
50
,
value
,
"value ok"
)
FROM
reference_data
;
SELECT
tap
.
eq
(
"FIX"
,
status
,
"status ok"
)
FROM
reference_data
;
SELECT
tap
.
eq
(
"0"
,
pidx
,
"pidx ok"
)
FROM
reference_data
;
SELECT
tap
.
eq
(
value_iversion
,
NULL
,
"value_iversion ok"
)
FROM
reference_data
;
DELETE
FROM
reference_data
WHERE
domain_id
=
0
AND
entity_id
=
99
;
SET
@
VALUE
=
"50"
;
CALL
insertEntityProperty
(
0
,
@
EntityID
,
@
PropertyID
,
"reference_data"
,
@
Value
,
NULL
,
"FIX"
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
...
...
@@ -82,8 +65,8 @@ DELETE FROM reference_data WHERE domain_id=0 AND entity_id=99;
-- TEST insertEntityProperty with Versioning - Reference version
CALL
insert_single_child_version
(
@
EntityID
,
"hashbla"
,
"versionbla"
,
NULL
,
"SRIDbla"
);
CALL
insert_single_child_version
(
@
EntityID
,
"hashblub"
,
"versionblub"
,
"versionbla"
,
"SRIDblub"
);
CALL
insert_single_child_version
(
50
,
"hashbla"
,
"versionbla"
,
NULL
,
"SRIDbla"
);
CALL
insert_single_child_version
(
50
,
"hashblub"
,
"versionblub"
,
"versionbla"
,
"SRIDblub"
);
SET
@
VALUE
=
"50@versionbla"
;
CALL
insertEntityProperty
(
0
,
@
EntityID
,
@
PropertyID
,
"reference_data"
,
@
Value
,
...
...
@@ -103,6 +86,7 @@ SET @VALUE="50@versionblub";
CALL
insertEntityProperty
(
0
,
@
EntityID
,
@
PropertyID
,
"reference_data"
,
@
Value
,
NULL
,
"FIX"
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
-- TODO switch expected/actual
SELECT
tap
.
eq
(
0
,
domain_id
,
"domain ok"
)
FROM
reference_data
;
SELECT
tap
.
eq
(
99
,
entity_id
,
"entity ok"
)
FROM
reference_data
;
SELECT
tap
.
eq
(
11
,
property_id
,
"property ok"
)
FROM
reference_data
;
...
...
@@ -111,7 +95,19 @@ SELECT tap.eq("FIX", status, "status ok") FROM reference_data;
SELECT
tap
.
eq
(
"0"
,
pidx
,
"pidx ok"
)
FROM
reference_data
;
SELECT
tap
.
eq
(
value_iversion
,
"2"
,
"value_iversion ok"
)
FROM
reference_data
;
-- TODO switch expected/actual
-- invalid values throw errors
SET
@
VALUE
=
"50@"
;
CALL
tap
.
_assert_throws
(
'
CALL insertEntityProperty(0, @EntityID, @PropertyID, "reference_data", @Value,
NULL, "FIX", NULL, NULL, NULL, NULL, 0)'
,
"@ but no version id"
);
SET
@
VALUE
=
"50@non-existing-version"
;
CALL
tap
.
_assert_throws
(
'
CALL insertEntityProperty(0, @EntityID, @PropertyID, "reference_data", @Value,
NULL, "FIX", NULL, NULL, NULL, NULL, 0)'
,
"non-existing-version id"
);
-- #####################################################################
...
...
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