Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding plain indexes tests #50

Merged
merged 6 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions clt_tests/tests/base/manticore-indexer-all.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
searchd {
listen = 9306:mysql41
listen = /var/run/mysqld/mysqld.sock:mysql41
log = searchd.log
pid_file = searchd.pid
binlog_path =

}

source src {
type = csvpipe
csvpipe_command = echo "1,abc" && echo "2,abc" && echo "3,abc abc"
csvpipe_field = f
}

index idx1 {
type = plain
source = src
path = idx1
stored_fields = f
}
37 changes: 37 additions & 0 deletions clt_tests/tests/base/manticore-indexer-desired.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
searchd {
listen = 9306:mysql41
listen = /var/run/mysqld/mysqld.sock:mysql41
log = searchd.log
pid_file = searchd.pid
binlog_path =

}

source src {
type = csvpipe
csvpipe_command = echo "1,abc" && echo "2,abc" && echo "3,abc abc"
csvpipe_field = f
}

index idx1 {
type = plain
source = src
path = idx1
stored_fields = f
}


index idx2 {
type = plain
source = src
path = idx2
stored_fields = f
}


index idx3 {
type = plain
source = src
path = idx3
stored_fields = f
}
27 changes: 27 additions & 0 deletions clt_tests/tests/plain-indexes-all.rec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
––– block: ./base/init –––
––– input –––
docker run -d -e CREATE_PLAIN_TABLES=1 --name manticore -v $(pwd)/clt_tests/tests/base/manticore-indexer-all.conf:/etc/manticoresearch/manticore.conf manticoresoftware/manticore:current
––– output –––
#!/[0-9a-z]+/!#
––– input –––
sleep 5;docker logs manticore | grep "accepting connections"
––– output –––
accepting connections
––– input –––
docker exec manticore mysql -e "SHOW TABLES\G;"
––– output –––
*************************** 1. row ***************************
Index: idx1
Type: local
––– input –––
docker exec manticore mysql -e "SELECT * FROM idx1\G;"
––– output –––
*************************** 1. row ***************************
id: 1
f: abc
*************************** 2. row ***************************
id: 2
f: abc
*************************** 3. row ***************************
id: 3
f: abc abc
62 changes: 62 additions & 0 deletions clt_tests/tests/plain-indexes-crontab.rec
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
––– block: ./base/init –––
––– input –––
docker run -d -e "CREATE_PLAIN_TABLES=idx1;idx2:* * * * *" --name manticore -v $(pwd)/clt_tests/tests/base/manticore-indexer-desired.conf:/etc/manticoresearch/manticore.conf manticoresoftware/manticore:current
––– output –––
#!/[0-9a-z]+/!#
––– input –––
timeout 5 docker logs -f manticore | grep -qm1 "accepting connections" && echo 'accepting connections' || echo 'Timeout failed'
––– output –––
accepting connections
––– input –––
docker exec manticore mysql -e "SELECT * FROM idx1\G;"
––– output –––
*************************** 1. row ***************************
id: 1
f: abc
*************************** 2. row ***************************
id: 2
f: abc
*************************** 3. row ***************************
id: 3
f: abc abc
––– input –––
docker exec manticore ls | grep idx
––– output –––
idx1.spa
idx1.spd
idx1.spds
idx1.spe
idx1.sph
idx1.sphi
idx1.spi
idx1.spl
idx1.spm
idx1.spp
idx1.spt
––– input –––
sleep 65
––– output –––
––– input –––
docker exec manticore ls | grep idx
––– output –––
idx1.spa
idx1.spd
idx1.spds
idx1.spe
idx1.sph
idx1.sphi
idx1.spi
idx1.spl
idx1.spm
idx1.spp
idx1.spt
idx2.new.spa
idx2.new.spd
idx2.new.spds
idx2.new.spe
idx2.new.sph
idx2.new.sphi
idx2.new.spi
idx2.new.spm
idx2.new.spp
idx2.new.spt
62 changes: 62 additions & 0 deletions clt_tests/tests/plain-indexes-crontab2.rec
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
––– block: ./base/init –––
––– input –––
docker run -d -e "CREATE_PLAIN_TABLES=idx1:* * * * *;idx2" --name manticore -v $(pwd)/clt_tests/tests/base/manticore-indexer-desired.conf:/etc/manticoresearch/manticore.conf manticoresoftware/manticore:current
––– output –––
#!/[0-9a-z]+/!#
––– input –––
timeout 5 docker logs -f manticore | grep -qm1 "accepting connections" && echo 'accepting connections' || echo 'Timeout failed'
––– output –––
accepting connections
––– input –––
docker exec manticore mysql -e "SELECT * FROM idx2\G;"
––– output –––
*************************** 1. row ***************************
id: 1
f: abc
*************************** 2. row ***************************
id: 2
f: abc
*************************** 3. row ***************************
id: 3
f: abc abc
––– input –––
docker exec manticore ls | grep idx | sort
––– output –––
idx2.spa
idx2.spd
idx2.spds
idx2.spe
idx2.sph
idx2.sphi
idx2.spi
idx2.spl
idx2.spm
idx2.spp
idx2.spt
––– input –––
sleep 65
––– output –––
––– input –––
docker exec manticore ls | grep idx | sort
––– output –––
idx1.new.spa
idx1.new.spd
idx1.new.spds
idx1.new.spe
idx1.new.sph
idx1.new.sphi
idx1.new.spi
idx1.new.spm
idx1.new.spp
idx1.new.spt
idx2.spa
idx2.spd
idx2.spds
idx2.spe
idx2.sph
idx2.sphi
idx2.spi
idx2.spl
idx2.spm
idx2.spp
idx2.spt
42 changes: 42 additions & 0 deletions clt_tests/tests/plain-indexes-desired.rec
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
––– block: ./base/init –––
––– input –––
docker run -d -e "CREATE_PLAIN_TABLES=idx1;idx2" --name manticore -v $(pwd)/clt_tests/tests/base/manticore-indexer-desired.conf:/etc/manticoresearch/manticore.conf manticoresoftware/manticore:current
––– output –––
#!/[0-9a-z]+/!#
––– input –––
sleep 5;docker logs manticore | grep "accepting connections"
––– output –––
accepting connections
––– input –––
docker exec manticore mysql -e "SHOW TABLES\G;"
––– output –––
*************************** 1. row ***************************
Index: idx1
Type: local
*************************** 2. row ***************************
Index: idx2
Type: local
––– input –––
docker exec manticore mysql -e "SELECT * FROM idx1\G;"
––– output –––
*************************** 1. row ***************************
id: 1
f: abc
*************************** 2. row ***************************
id: 2
f: abc
*************************** 3. row ***************************
id: 3
f: abc abc
––– input –––
docker exec manticore mysql -e "SELECT * FROM idx2\G;"
––– output –––
*************************** 1. row ***************************
id: 1
f: abc
*************************** 2. row ***************************
id: 2
f: abc
*************************** 3. row ***************************
id: 3
f: abc abc
28 changes: 28 additions & 0 deletions clt_tests/tests/plain-indexes-only-crontab.rec
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
––– block: ./base/init –––
––– input –––
docker run -d -e "CREATE_PLAIN_TABLES=idx1:* * * * *" --name manticore -v $(pwd)/clt_tests/tests/base/manticore-indexer-desired.conf:/etc/manticoresearch/manticore.conf manticoresoftware/manticore:current
––– output –––
#!/[0-9a-z]+/!#
––– input –––
timeout 5 docker logs -f manticore | grep -qm1 "accepting connections" && echo 'accepting connections' || echo 'Timeout failed'
––– output –––
accepting connections
––– input –––
docker exec manticore ls | grep idx | sort
––– output –––
––– input –––
sleep 65
––– output –––
––– input –––
docker exec manticore ls | grep idx | sort
––– output –––
idx1.new.spa
idx1.new.spd
idx1.new.spds
idx1.new.spe
idx1.new.sph
idx1.new.sphi
idx1.new.spi
idx1.new.spm
idx1.new.spp
idx1.new.spt