Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
Init Elements
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Arkindex
Workers
Init Elements
Merge requests
!15
Draft: Migrate cache to use the Arkindex export structure
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Draft: Migrate cache to use the Arkindex export structure
cache-use-arkindex-export
into
master
Overview
0
Commits
2
Pipelines
2
Changes
5
Open
Manon Blanco
requested to merge
cache-use-arkindex-export
into
master
5 months ago
Overview
0
Commits
2
Pipelines
2
Changes
5
Expand
Refs
https://redmine.teklia.com/issues/6576
0
0
Merge request reports
Compare
master
version 1
783178ed
5 months ago
master (base)
and
version 1
latest version
9710ea5e
2 commits,
5 months ago
version 1
783178ed
1 commit,
5 months ago
5 files
+
119
−
125
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
tests/__init__.py
+
19
−
6
Options
@@ -2,7 +2,9 @@ import json
import
sqlite3
from
pathlib
import
Path
from
arkindex_worker.cache
import
SQL_VERSION
from
arkindex_export
import
Image
as
CachedImage
from
arkindex_worker.cache
import
CachedElement
def
check_json
(
json_path
:
Path
,
elements
:
list
)
->
None
:
@@ -16,15 +18,26 @@ def check_db(db_path: Path, elements: list, images: list) -> None:
db
=
sqlite3
.
connect
(
str
(
db_path
))
db
.
row_factory
=
sqlite3
.
Row
assert
list
(
map
(
dict
,
db
.
execute
(
"
select * from version
"
).
fetchall
()))
==
[
{
"
version
"
:
SQL_VERSION
}
]
assert
(
list
(
map
(
dict
,
db
.
execute
(
"
select * from elements order by id
"
).
fetchall
()))
list
(
map
(
dict
,
db
.
execute
(
f
"
select
{
'
,
'
.
join
(
key
for
key
in
CachedElement
.
_meta
.
columns
if
key
not
in
[
'
created
'
,
'
updated
'
])
}
from
{
CachedElement
.
_meta
.
table_name
}
order by id
"
).
fetchall
(),
)
)
==
elements
)
assert
(
list
(
map
(
dict
,
db
.
execute
(
"
select * from images order by id
"
).
fetchall
()))
list
(
map
(
dict
,
db
.
execute
(
f
"
select * from
{
CachedImage
.
_meta
.
table_name
}
order by id
"
).
fetchall
(),
)
)
==
images
)
Loading