Navigation Menu

Skip to content

Commit

Permalink
Add command test for system.absorb-data
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 14, 2015
1 parent a53b7db commit 0c8bdcd
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 0 deletions.
59 changes: 59 additions & 0 deletions test/command/suite/system/absorb-data/records.catalog.json
@@ -0,0 +1,59 @@
{
"datasets": {
"Default": {
},
"Source": {
"schema": {
"Users": {
"type": "Hash",
"keyType": "ShortText"
}
},
"fact": "Users",
"nWorkers": 2,
"plugins": ["groonga", "crud", "search", "dump", "system", "catalog"],
"replicas": [
{
"dimension": "_key",
"slicer": "hash",
"slices": [
{
"label": "slice020",
"weight": 50,
"volume": {
"address": "127.0.0.1:23003/droonga.020"
}
},
{
"label": "slice021",
"weight": 50,
"volume": {
"address": "127.0.0.1:23003/droonga.021"
}
}
]
},
{
"dimension": "_key",
"slicer": "hash",
"slices": [
{
"label": "slice030",
"weight": 50,
"volume": {
"address": "127.0.0.1:23003/droonga.030"
}
},
{
"label": "slice031",
"weight": 50,
"volume": {
"address": "127.0.0.1:23003/droonga.031"
}
}
]
}
]
}
}
}
43 changes: 43 additions & 0 deletions test/command/suite/system/absorb-data/records.expected
@@ -0,0 +1,43 @@
{
"inReplyTo": "request-id",
"dataset": "Default",
"date": "0000-00-00T00:00:00.000000Z",
"type": "system.absorb-data.start"
}
{
"inReplyTo": "request-id",
"dataset": "Default",
"date": "0000-00-00T00:00:00.000000Z",
"type": "system.absorb-data.start"
}
{
"inReplyTo": "request-id",
"statusCode": 200,
"type": "system.absorb-data.result",
"body": {
"started": true
}
}
{
"inReplyTo": "request-id",
"dataset": "Default",
"date": "0000-00-00T00:00:00.000000Z",
"body": {
"nProcessedMessages": 1,
"percentage": 100,
"message": "100% done (maybe 00:00:00 remaining)"
},
"type": "system.absorb-data.progress"
}
{
"inReplyTo": "request-id",
"dataset": "Default",
"date": "0000-00-00T00:00:00.000000Z",
"type": "system.absorb-data.end"
}
{
"inReplyTo": "request-id",
"dataset": "Default",
"date": "0000-00-00T00:00:00.000000Z",
"type": "system.absorb-data.end"
}
21 changes: 21 additions & 0 deletions test/command/suite/system/absorb-data/records.test
@@ -0,0 +1,21 @@
#@require-catalog-version 2
#@disable-logging
{
"type": "add",
"dataset": "Source",
"body": {
"table": "Users",
"key": "Adam"
}
}
#@enable-logging
{
"type": "system.absorb-data",
"dataset": "Default",
"body": {
"host": "localhost",
"port": 23003,
"tag": "droonga",
"dataset": "Source"
}
}

0 comments on commit 0c8bdcd

Please sign in to comment.