mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-26 18:29:03 -06:00
Add archive legacy version loading tests
This commit is contained in:
@@ -91,3 +91,28 @@ Storage Artifact:
|
||||
Path: /Users/neil/Documents/data_dir_1/db1/clone2/.dolt/noms/oldgen/c5j9u4ced6eg6cnegk0mgdglc3t04air
|
||||
Table File Metadata:
|
||||
Snappy Chunk Count: 273 (bytes: 377979)
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
v1: A copy of base. This is used to verify we can read from an archive
|
||||
file which was created with the version 1 archive format.
|
||||
|
||||
Content: see `base` above.
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
v2: This is used to verify we can read from an archive in format 2.
|
||||
|
||||
$ dolt admin storage
|
||||
Storage Artifact:
|
||||
ID: i8ivrn485g73hao1foo3p7l2clq3gqqv
|
||||
Path: /Users/neil/Documents/data_dir_1/db8/.dolt/noms/i8ivrn485g73hao1foo3p7l2clq3gqqv
|
||||
Table File Metadata:
|
||||
Snappy Chunk Count: 2 (bytes: 383)
|
||||
|
||||
Storage Artifact:
|
||||
ID: 27avtn2a3upddh52eu750m4709gfps7s
|
||||
Path: /Users/neil/Documents/data_dir_1/db8/.dolt/noms/oldgen/27avtn2a3upddh52eu750m4709gfps7s.darc
|
||||
Archive Metadata:
|
||||
Format Version: 2
|
||||
Snappy Chunk Count: 0 (bytes: 0)
|
||||
ZStd Chunk Count: 230 (bytes: 58956)
|
||||
Dictionary Count: 1 (bytes: 2968)
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
5:__DOLT__:6eseiohaelofp485e95ti1pgqe5qrseg:att0kn4lt0uqce5mdqf01ni9ediahoo4:6eseiohaelofp485e95ti1pgqe5qrseg:8p5e2m6skovfdjlh4jg3llr8sfvu384l:2
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
5:__DOLT__:c3qnrebcud1nuibb18lmitlc442ql6me:00000000000000000000000000000000:c3qnrebcud1nuibb18lmitlc442ql6me:29o8a3uevcpr15tilcemb3s438edmoog:125:dnu4lr5j8sstbj5usbld7alsnuj5nf23:139
|
||||
6
integration-tests/bats/archive-test-repos/v1/repo_state.json
Executable file
6
integration-tests/bats/archive-test-repos/v1/repo_state.json
Executable file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"head": "refs/heads/main",
|
||||
"remotes": {},
|
||||
"backups": {},
|
||||
"branches": {}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
5:__DOLT__:mqdhu8os4b800j3spsfrjfeec1jth7td:eiebm3v7edkhm536b47fmbhmpk4t04o7:mqdhu8os4b800j3spsfrjfeec1jth7td:i8ivrn485g73hao1foo3p7l2clq3gqqv:2
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
5:__DOLT__:2a2cfo9tfmv0qqt5iap4139mnu69nk3k:00000000000000000000000000000000:2a2cfo9tfmv0qqt5iap4139mnu69nk3k:27avtn2a3upddh52eu750m4709gfps7s:230
|
||||
Binary file not shown.
6
integration-tests/bats/archive-test-repos/v2/repo_state.json
Executable file
6
integration-tests/bats/archive-test-repos/v2/repo_state.json
Executable file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"head": "refs/heads/main",
|
||||
"remotes": {},
|
||||
"backups": {},
|
||||
"branches": {}
|
||||
}
|
||||
@@ -1,13 +1,6 @@
|
||||
#!/usr/bin/env bats
|
||||
load $BATS_TEST_DIRNAME/helper/common.bash
|
||||
|
||||
# Note on Testing Archive format versions: Currently the archive format version is 3. All archives which are built
|
||||
# as part of these tests will be produced in version 3 format.
|
||||
#
|
||||
# Version 1 and 2 archives are currently present as tracked artifacts in our tests. Any test which first copies
|
||||
# from the archive-test-repos directory will implicitly be demonstrating our continued ability to open and read
|
||||
# those archives.
|
||||
|
||||
setup() {
|
||||
setup_common
|
||||
|
||||
@@ -509,4 +502,20 @@ mutations_and_gc_statement() {
|
||||
[[ $output =~ Table[[:space:]]File[[:space:]]Metadata:[[:space:]]*Snappy[[:space:]]Chunk[[:space:]]Count:[[:space:]]260[[:space:]] ]] || false
|
||||
|
||||
dolt fsck
|
||||
}
|
||||
}
|
||||
|
||||
@test "archive: read legacy v1 database" {
|
||||
mkdir -p original/.dolt
|
||||
cp -R $BATS_TEST_DIRNAME/archive-test-repos/v1/* original/.dolt
|
||||
cd original
|
||||
|
||||
dolt fsck
|
||||
}
|
||||
|
||||
@test "archive: read legacy v2 database" {
|
||||
mkdir -p original/.dolt
|
||||
cp -R $BATS_TEST_DIRNAME/archive-test-repos/v2/* original/.dolt
|
||||
cd original
|
||||
|
||||
dolt fsck
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user