-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add integration tests with full dbs sync scenario
- Loading branch information
Showing
31 changed files
with
874 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,5 @@ my_rocksdb/ | |
_rocksdb_backup/ | ||
_rocksdb_backup_archives/ | ||
/.project | ||
# Used by integration tests | ||
rocks_dump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
CONTAINER_NAME="test_db" | ||
IMAGE_NAME="postgres:14" | ||
DB_USER="solana" | ||
DB_PASSWORD="solana" | ||
DB_NAME="solana" | ||
DB_PATH="./db-data" | ||
ROCKS_DUMP_PATH="./rocks_dump" | ||
HOST_PORT="5432" | ||
CONTAINER_PORT="5432" | ||
|
||
mkdir -p "$DB_PATH" | ||
mkdir -p "$ROCKS_DUMP_PATH" | ||
|
||
docker run -d \ | ||
--name $CONTAINER_NAME \ | ||
-e POSTGRES_USER=$DB_USER \ | ||
-e POSTGRES_PASSWORD=$DB_PASSWORD \ | ||
-e POSTGRES_DB=$DB_NAME \ | ||
-v "$DB_PATH:/var/lib/postgresql/data:rw" \ | ||
-v "$ROCKS_DUMP_PATH:/rocks_dump:ro" \ | ||
-p $HOST_PORT:$CONTAINER_PORT \ | ||
--shm-size=1g \ | ||
$IMAGE_NAME \ | ||
postgres -c log_statement=none \ | ||
-c log_destination=stderr \ | ||
|
||
if [ $? -eq 0 ]; then | ||
echo "PostgreSQL container '$CONTAINER_NAME' is running." | ||
else | ||
echo "Failed to start the PostgreSQL container." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+240 Bytes
...nc_core_and_regular_nfts_get_assets_by_owner/4FFhh184GNqh3LEK8UhMY7KBuCdNvvhU7C23ZKrKnofb
Binary file not shown.
Binary file added
BIN
+224 Bytes
...nc_core_and_regular_nfts_get_assets_by_owner/8qbRNh9Q9pcksZVnmQemoh7is2NqsRNTx4jmpv75knC6
Binary file not shown.
Binary file added
BIN
+256 Bytes
...ync_core_and_regular_nfts_get_assets_by_owner/9tsHoBrkSqBW5uMxKZyvxL6m9CCaz1a7sGEg8SuckUj
Binary file not shown.
Binary file added
BIN
+312 Bytes
...nc_core_and_regular_nfts_get_assets_by_owner/CoeHPhsozRMmvJTg2uaNrAmQmjVvLk6PJvoEWDJavuBd
Binary file not shown.
Binary file added
BIN
+824 Bytes
...nc_core_and_regular_nfts_get_assets_by_owner/DHFGrBUK1Ctgr8RBftsWH952hS69hzesBpnyThWC6MjR
Binary file not shown.
Binary file added
BIN
+424 Bytes
...nc_core_and_regular_nfts_get_assets_by_owner/HEsxPaf6QFNBaN3LiVQAke99WaFMhT8JC2bWityF7mwZ
Binary file not shown.
Binary file added
BIN
+256 Bytes
...ounts/full_sync_core_get_assets_by_authority/4FcFVJVPRsYoMjt8ewDGV5nipoK63SNrJzjrBHyXvhcz
Binary file not shown.
Binary file added
BIN
+240 Bytes
...ounts/full_sync_core_get_assets_by_authority/9CSyGBw1DCVZfx621nb7UBM9SpVDsX1m9MaN6APCf1Ci
Binary file not shown.
Binary file added
BIN
+256 Bytes
.../accounts/full_sync_core_get_assets_by_group/EgzsppfYJmUet4ve8MnuHMyvSnj6R7LRmwsGEH5TuGhB
Binary file not shown.
Binary file added
BIN
+256 Bytes
.../accounts/full_sync_core_get_assets_by_group/J2kazVRuZ33Po4PVyZGxiDYUMQ1eZiT5Xa13usRYo264
Binary file not shown.
Binary file added
BIN
+304 Bytes
.../accounts/full_sync_core_get_assets_by_group/JChzyyp1CnNz56tJLteQ5BsbngmWQ3JwcxLZrmuQA5b7
Binary file not shown.
Binary file added
BIN
+256 Bytes
...a/accounts/full_sync_core_get_assets_by_group/kTMCCKLTaZsnSReer12HsciwScUwhHyZyd9D9BwQF8k
Binary file not shown.
Binary file added
BIN
+240 Bytes
.../accounts/full_sync_core_get_assets_by_owner/4FFhh184GNqh3LEK8UhMY7KBuCdNvvhU7C23ZKrKnofb
Binary file not shown.
Binary file added
BIN
+224 Bytes
.../accounts/full_sync_core_get_assets_by_owner/8qbRNh9Q9pcksZVnmQemoh7is2NqsRNTx4jmpv75knC6
Binary file not shown.
Binary file added
BIN
+256 Bytes
...a/accounts/full_sync_core_get_assets_by_owner/9tsHoBrkSqBW5uMxKZyvxL6m9CCaz1a7sGEg8SuckUj
Binary file not shown.
Binary file added
BIN
+312 Bytes
.../accounts/full_sync_core_get_assets_by_owner/CoeHPhsozRMmvJTg2uaNrAmQmjVvLk6PJvoEWDJavuBd
Binary file not shown.
Binary file added
BIN
+824 Bytes
.../accounts/full_sync_core_get_assets_by_owner/DHFGrBUK1Ctgr8RBftsWH952hS69hzesBpnyThWC6MjR
Binary file not shown.
Binary file added
BIN
+424 Bytes
.../accounts/full_sync_core_get_assets_by_owner/HEsxPaf6QFNBaN3LiVQAke99WaFMhT8JC2bWityF7mwZ
Binary file not shown.
Binary file added
BIN
+376 Bytes
integration_tests/src/data/accounts/sync/x3hJtpU4AUsGejNvxzX9TKjcyNB1eYtDdDPWdeF6opr
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ mod common; | |
mod general_scenario_tests; | ||
mod mpl_core_tests; | ||
mod regular_nft_tests; | ||
mod synchronizer_tests; |
147 changes: 147 additions & 0 deletions
147
...ation_tests__synchronizer_tests__full_sync_core_and_regular_nfts_get_assets_by_owner.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
--- | ||
source: integration_tests/src/synchronizer_tests.rs | ||
assertion_line: 183 | ||
expression: response | ||
snapshot_kind: text | ||
--- | ||
{ | ||
"total": 2, | ||
"limit": 50, | ||
"page": 1, | ||
"items": [ | ||
{ | ||
"interface": "MplCoreAsset", | ||
"id": "9tsHoBrkSqBW5uMxKZyvxL6m9CCaz1a7sGEg8SuckUj", | ||
"content": { | ||
"$schema": "https://schema.metaplex.com/nft1.0.json", | ||
"json_uri": "https://example.com/asset", | ||
"files": [], | ||
"metadata": { | ||
"name": "Test Asset", | ||
"symbol": "" | ||
}, | ||
"links": {} | ||
}, | ||
"authorities": [ | ||
{ | ||
"address": "APrZTeVysBJqAznfLXS71NAzjr2fCVTSF1A66MeErzM7", | ||
"scopes": [ | ||
"full" | ||
] | ||
} | ||
], | ||
"compression": { | ||
"eligible": false, | ||
"compressed": false, | ||
"data_hash": "", | ||
"creator_hash": "", | ||
"asset_hash": "", | ||
"tree": "", | ||
"seq": 0, | ||
"leaf_id": 0 | ||
}, | ||
"grouping": [ | ||
{ | ||
"group_key": "collection", | ||
"group_value": "4FFhh184GNqh3LEK8UhMY7KBuCdNvvhU7C23ZKrKnofb", | ||
"verified": true | ||
} | ||
], | ||
"royalty": { | ||
"royalty_model": "creators", | ||
"target": null, | ||
"percent": 0.0, | ||
"basis_points": 0, | ||
"primary_sale_happened": false, | ||
"locked": false | ||
}, | ||
"creators": [], | ||
"ownership": { | ||
"frozen": false, | ||
"delegated": false, | ||
"delegate": null, | ||
"ownership_model": "single", | ||
"owner": "7uScVQiT4vArB88dHrZoeVKWbtsRJmNp9r5Gce5VQpXS" | ||
}, | ||
"supply": null, | ||
"mutable": true, | ||
"burnt": false, | ||
"lamports": 3156480, | ||
"executable": false, | ||
"rent_epoch": 18446744073709551615, | ||
"plugins": {}, | ||
"mpl_core_info": { | ||
"plugins_json_version": 1 | ||
}, | ||
"external_plugins": [] | ||
}, | ||
{ | ||
"interface": "V1_NFT", | ||
"id": "8qbRNh9Q9pcksZVnmQemoh7is2NqsRNTx4jmpv75knC6", | ||
"content": { | ||
"$schema": "https://schema.metaplex.com/nft1.0.json", | ||
"json_uri": "https://arweave.net/zt75zlealvVfW7mFy7VHmr_bs3OJFbZIXiORXSka-I4", | ||
"files": [], | ||
"metadata": { | ||
"name": "Thug", | ||
"symbol": "TL", | ||
"token_standard": "NonFungible" | ||
}, | ||
"links": {} | ||
}, | ||
"authorities": [ | ||
{ | ||
"address": "3VvLDXqJbw3heyRwFxv8MmurPznmDVUJS9gPMX2BDqfM", | ||
"scopes": [ | ||
"full" | ||
] | ||
} | ||
], | ||
"compression": { | ||
"eligible": false, | ||
"compressed": false, | ||
"data_hash": "", | ||
"creator_hash": "", | ||
"asset_hash": "", | ||
"tree": "", | ||
"seq": 0, | ||
"leaf_id": 0 | ||
}, | ||
"grouping": [], | ||
"royalty": { | ||
"royalty_model": "creators", | ||
"target": null, | ||
"percent": 0.0, | ||
"basis_points": 0, | ||
"primary_sale_happened": false, | ||
"locked": false | ||
}, | ||
"creators": [], | ||
"ownership": { | ||
"frozen": false, | ||
"delegated": false, | ||
"delegate": null, | ||
"ownership_model": "single", | ||
"owner": "7uScVQiT4vArB88dHrZoeVKWbtsRJmNp9r5Gce5VQpXS" | ||
}, | ||
"supply": { | ||
"print_max_supply": 1000, | ||
"print_current_supply": 0, | ||
"edition_nonce": 255 | ||
}, | ||
"mutable": true, | ||
"burnt": false, | ||
"lamports": 5616720, | ||
"executable": false, | ||
"metadata_owner": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", | ||
"rent_epoch": 18446744073709551615, | ||
"token_info": { | ||
"supply": 1, | ||
"decimals": 0, | ||
"token_program": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", | ||
"mint_authority": "HEsxPaf6QFNBaN3LiVQAke99WaFMhT8JC2bWityF7mwZ", | ||
"freeze_authority": "HEsxPaf6QFNBaN3LiVQAke99WaFMhT8JC2bWityF7mwZ" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.