Skip to content

Commit

Permalink
Move clt-tests under test directory and update CLT version to the lat…
Browse files Browse the repository at this point in the history
…est one
  • Loading branch information
donhardman committed Jul 9, 2024
1 parent 0162f4a commit cce9fdb
Show file tree
Hide file tree
Showing 26 changed files with 1,211 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/clt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ jobs:
clt:
runs-on: ubuntu-22.04
steps:
- uses: manticoresoftware/clt@0.1.21
- uses: manticoresoftware/clt@0.2.1
with:
image: 'ghcr.io/manticoresoftware/manticoresearch:test-kit-latest'
init_code: |
git clone https://github.com/manticoresoftware/phar_builder.git
./phar_builder/bin/build --name="Manticore Backup" --package="manticore-backup"
run_args: '-v $PWD/build/manticore-backup:/usr/bin/manticore-backup -v $PWD/build/share/modules/manticore-backup:/usr/share/manticore/modules/manticore-backup'
test_prefix: test/clt-tests/
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ vendor/**
.phpunit.result.cache
phar_builder
clt
tests/*.rep
tests/*.cmp
test/clt-tests/*.rep
test/clt-tests/*.cmp
File renamed without changes.
139 changes: 139 additions & 0 deletions test/clt-tests/backup-all-ok.rep
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
You can use regex in the output sections.
More info here: https://github.com/manticoresoftware/clt#refine
Time taken for test: 410ms
––– input –––
cp ./test/clt-tests/config/manticore.conf /etc/manticoresearch/manticore.conf
––– output –––
––– duration: 2ms (0.49%) –––
––– input –––
searchd
––– output –––
Manticore 6.2.13 5de07b0ae@24022215 dev (columnar 2.2.5 a5342a1@240217) (secondary 2.2.5 a5342a1@240217) (knn 2.2.5 a5342a1@240217)
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-2024, Manticore Software LTD (https://manticoresearch.com)
[44:31.566] [29] using config file '/etc/manticoresearch/manticore.conf' (273 chars)...
starting daemon version '6.2.13 5de07b0ae@24022215 dev (columnar 2.2.5 a5342a1@240217) (secondary 2.2.5 a5342a1@240217) (knn 2.2.5 a5342a1@240217)' ...
listening on 127.0.0.1:9312 for sphinx and http(s)
listening on 127.0.0.1:9306 for mysql
listening on 127.0.0.1:9308 for sphinx and http(s)
––– duration: 106ms (25.85%) –––
––– input –––
manticore-backup --version
––– output –––
Copyright (c) 2023-2024, Manticore Software LTD (https://manticoresearch.com)
Manticore Backup version: 1.3.5
––– duration: 16ms (3.90%) –––
––– input –––
mysql -h0 -P9306 < test/clt-tests/dumps/tables.sql
––– output –––
––– duration: 7ms (1.71%) –––
––– input –––
mysql -h0 -P9306 -e 'show tables'
––– output –––
+---------------------+-------------+
| Index | Type |
+---------------------+-------------+
| distributed_index | distributed |
| rt_with_columnar | rt |
| rt_without_columnar | rt |
+---------------------+-------------+
––– duration: 6ms (1.46%) –––
––– input –––
mysql -h0 -P9306 -e 'show create table distributed_index'
––– output –––
+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| distributed_index | CREATE TABLE distributed_index type='distributed' local='rt_with_columnar' agent='127.0.0.1:9312:plain_with_columnar, plain_without_columnar' |
+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
––– duration: 5ms (1.22%) –––
––– input –––
mysql -h0 -P9306 -e 'show create table rt_with_columnar'
––– output –––
+------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| rt_with_columnar | CREATE TABLE rt_with_columnar (
id bigint,
title text,
category_id integer,
price float,
description string attribute engine='columnar',
tags multi,
attributes json
) |
+------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
––– duration: 9ms (2.20%) –––
––– input –––
mysql -h0 -P9306 -e 'show create table rt_without_columnar'
––– output –––
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| rt_without_columnar | CREATE TABLE rt_without_columnar (
id bigint,
title text,
category_id integer,
price float,
description string attribute,
tags multi,
attributes json
) |
+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
––– duration: 8ms (1.95%) –––
––– input –––
ls -lt /tmp/backup-*
––– output –––
ls: cannot access '/tmp/backup-*': No such file or directory
––– duration: 4ms (0.98%) –––
––– input –––
manticore-backup --backup-dir=/tmp
––– output –––
Copyright (c) 2023-2024, Manticore Software LTD (https://manticoresearch.com)
Manticore config file: /etc/manticoresearch/manticore.conf
Tables to backup: all tables
Backup dir: /tmp
Manticore config
endpoint = http://127.0.0.1:9312
Manticore versions:
manticore: 6.2.13 5de07b0ae@24022215 dev
columnar: 2.2.5 a5342a1@240217
secondary: 2.2.5 a5342a1@240217
knn: 2.2.5 a5342a1@240217
buddy: 2.1.7
2024-02-22 11:44:31 [Info] Starting the backup...
2024-02-22 11:44:31 [Info] Backing up config files...
2024-02-22 11:44:31 [Info] config files - OK
2024-02-22 11:44:31 [Info] Backing up global state files...
2024-02-22 11:44:31 [Info] global state files – OK
2024-02-22 11:44:31 [Info] Backing up tables...
2024-02-22 11:44:31 [Info] distributed_index (distributed)...
2024-02-22 11:44:31 [Info] SKIP
2024-02-22 11:44:31 [Info] rt_with_columnar (rt) [2.915K]...
2024-02-22 11:44:31 [Info] OK
2024-02-22 11:44:31 [Info] rt_without_columnar (rt) [2.789K]...
2024-02-22 11:44:31 [Info] OK
2024-02-22 11:44:31 [Info] Running sync
2024-02-22 11:44:31 [Info] OK
2024-02-22 11:44:31 [Info] You can find backup here: /tmp/backup-20240222114431
2024-02-22 11:44:31 [Info] Elapsed time: 0.01s
2024-02-22 11:44:31 [Info] Done
2024-02-22 11:44:31 [Info]
Unfreezing all tables...
2024-02-22 11:44:31 [Info] distributed_index...
2024-02-22 11:44:31 [Info] OK
2024-02-22 11:44:31 [Info] rt_with_columnar...
2024-02-22 11:44:31 [Info] OK
2024-02-22 11:44:31 [Info] rt_without_columnar...
2024-02-22 11:44:31 [Info] OK
––– duration: 242ms (59.02%) –––
––– input –––
ls -lh /tmp/backup-*
––– output –––
total 16K
drwxr-xr-x. 4 root root 4.0K Feb 22 11:44 config
drwxr-xr-x. 4 root root 4.0K Feb 22 11:44 data
drwxr-xr-x. 2 root root 4.0K Feb 22 11:44 state
-rw-r--r--. 1 root root 176 Feb 22 11:44 versions.json
––– duration: 5ms (1.22%) –––
File renamed without changes.
112 changes: 112 additions & 0 deletions test/clt-tests/backup-conf.rep
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
You can use regex in the output sections.
More info here: https://github.com/manticoresoftware/clt#refine
Time taken for test: 429ms
––– input –––
cp /etc/manticoresearch/manticore.conf /tmp/
––– output –––
––– duration: 2ms (0.47%) –––
––– input –––
cp ./test/clt-tests/config/manticore.conf /etc/manticoresearch/manticore.conf
––– output –––
––– duration: 2ms (0.47%) –––
––– input –––
searchd
––– output –––
Manticore 6.2.13 d6f2c7d84@24022421 dev (columnar 2.2.5 a5342a1@240217) (secondary 2.2.5 a5342a1@240217) (knn 2.2.5 a5342a1@240217)
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-2024, Manticore Software LTD (https://manticoresearch.com)
[03:14.971] [30] using config file '/etc/manticoresearch/manticore.conf' (273 chars)...
starting daemon version '6.2.13 d6f2c7d84@24022421 dev (columnar 2.2.5 a5342a1@240217) (secondary 2.2.5 a5342a1@240217) (knn 2.2.5 a5342a1@240217)' ...
listening on 127.0.0.1:9312 for sphinx and http(s)
listening on 127.0.0.1:9306 for mysql
listening on 127.0.0.1:9308 for sphinx and http(s)
––– duration: 107ms (24.94%) –––
––– input –––
manticore-backup --version
––– output –––
Copyright (c) 2023-2024, Manticore Software LTD (https://manticoresearch.com)
Manticore Backup version: 1.3.5
––– duration: 16ms (3.73%) –––
––– input –––
mysql -h0 -P9306 < test/clt-tests/dumps/tables.sql
––– output –––
––– duration: 8ms (1.86%) –––
––– input –––
manticore-backup --version
––– output –––
Copyright (c) 2023-2024, Manticore Software LTD (https://manticoresearch.com)
Manticore Backup version: 1.3.5
––– duration: 18ms (4.20%) –––
––– input –––
mysql -h0 -P9306 -e 'show tables'
––– output –––
+---------------------+-------------+
| Index | Type |
+---------------------+-------------+
| distributed_index | distributed |
| rt_with_columnar | rt |
| rt_without_columnar | rt |
| test | rt |
+---------------------+-------------+
––– duration: 9ms (2.10%) –––
––– input –––
manticore-backup --config=/etc/manticoresearch/manticore.conf --config=/tmp/manticore.conf --backup-dir=/tmp/
––– output –––
Copyright (c) 2023-2024, Manticore Software LTD (https://manticoresearch.com)
Manticore config file: /etc/manticoresearch/manticore.conf
Tables to backup: all tables
Backup dir: /tmp/
Manticore config
endpoint = http://127.0.0.1:9312
Manticore config
endpoint = http://127.0.0.1:9312
Manticore versions:
manticore: 6.2.13 d6f2c7d84@24022421 dev
columnar: 2.2.5 a5342a1@240217
secondary: 2.2.5 a5342a1@240217
knn: 2.2.5 a5342a1@240217
buddy: 2.1.7
2024-02-27 13:03:15 [Info] Starting the backup...
2024-02-27 13:03:15 [Info] Backing up config files...
2024-02-27 13:03:15 [Info] config files - OK
2024-02-27 13:03:15 [Info] Backing up global state files...
2024-02-27 13:03:15 [Info] global state files – OK
2024-02-27 13:03:15 [Info] Backing up tables...
2024-02-27 13:03:15 [Info] distributed_index (distributed)...
2024-02-27 13:03:15 [Info] SKIP
2024-02-27 13:03:15 [Info] rt_with_columnar (rt) [2.915K]...
2024-02-27 13:03:15 [Info] OK
2024-02-27 13:03:15 [Info] rt_without_columnar (rt) [2.789K]...
2024-02-27 13:03:15 [Info] OK
2024-02-27 13:03:15 [Info] test (rt) [956B]...
2024-02-27 13:03:15 [Info] OK
2024-02-27 13:03:15 [Info] Running sync
2024-02-27 13:03:15 [Info] OK
2024-02-27 13:03:15 [Info] You can find backup here: /tmp/backup-20240227130315
2024-02-27 13:03:15 [Info] Elapsed time: 0.01s
2024-02-27 13:03:15 [Info] Done
2024-02-27 13:03:15 [Info]
Unfreezing all tables...
2024-02-27 13:03:15 [Info] distributed_index...
2024-02-27 13:03:15 [Info] OK
2024-02-27 13:03:15 [Info] rt_with_columnar...
2024-02-27 13:03:15 [Info] OK
2024-02-27 13:03:15 [Info] rt_without_columnar...
2024-02-27 13:03:15 [Info] OK
2024-02-27 13:03:15 [Info] test...
2024-02-27 13:03:15 [Info] OK
––– duration: 245ms (57.11%) –––
––– input –––
rm /etc/manticoresearch/manticore.conf; rm /tmp/manticore.conf
––– output –––
––– duration: 3ms (0.70%) –––
––– input –––
manticore-backup --backup-dir=/tmp/ --restore
––– output –––
Copyright (c) 2023-2024, Manticore Software LTD (https://manticoresearch.com)
Manticore config file:
Backup dir: /tmp/
Available backups: 1
backup-20240227130315 (Feb 27 2024 13:03:15)
––– duration: 19ms (4.43%) –––
File renamed without changes.
Loading

0 comments on commit cce9fdb

Please sign in to comment.