Skip to content

Commit 763d9b5

Browse files
committed
Make tests 1.6/1.7/1.8 compatible
* Upload to 1.8 and test against latest 1.6/1.7/1.8 versions * Disable checking of queue in packpack builds
1 parent 078784d commit 763d9b5

File tree

6 files changed

+66
-60
lines changed

6 files changed

+66
-60
lines changed

.travis.yml

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
sudo: required
22
language: C
3-
compiler:
4-
- clang
5-
- gcc
63

74
services:
85
- docker
@@ -15,7 +12,9 @@ env:
1512
global:
1613
- PRODUCT=tarantool-queue
1714
matrix:
18-
- TARGET=test
15+
- TARGET=test VERSION=1_6
16+
- TARGET=test VERSION=1_7
17+
- TARGET=test VERSION=1_8
1918
- OS=el DIST=6
2019
- OS=el DIST=7
2120
- OS=fedora DIST=24
@@ -28,43 +27,6 @@ env:
2827
- OS=debian DIST=jessie
2928
- OS=debian DIST=stretch
3029

31-
matrix:
32-
allow_failures:
33-
# - env: OS=el DIST=6
34-
# - env: OS=el DIST=7
35-
# - env: OS=fedora DIST=24
36-
# - env: OS=fedora DIST=25
37-
# - env: OS=ubuntu DIST=precise
38-
# - env: OS=ubuntu DIST=trusty
39-
# - env: OS=ubuntu DIST=xenial
40-
# - env: OS=ubuntu DIST=yakkety
41-
# - env: OS=debian DIST=wheezy
42-
# - env: OS=debian DIST=jessie
43-
# - env: OS=debian DIST=stretch
44-
exclude:
45-
- env: OS=el DIST=6
46-
compiler: clang
47-
- env: OS=el DIST=7
48-
compiler: clang
49-
- env: OS=fedora DIST=24
50-
compiler: clang
51-
- env: OS=fedora DIST=25
52-
compiler: clang
53-
- env: OS=ubuntu DIST=precise
54-
compiler: clang
55-
- env: OS=ubuntu DIST=trusty
56-
compiler: clang
57-
- env: OS=ubuntu DIST=xenial
58-
compiler: clang
59-
- env: OS=ubuntu DIST=yakkety
60-
compiler: clang
61-
- env: OS=debian DIST=wheezy
62-
compiler: clang
63-
- env: OS=debian DIST=jessie
64-
compiler: clang
65-
- env: OS=debian DIST=stretch
66-
compiler: clang
67-
6830
script:
6931
- git describe --long
7032
- |
@@ -100,6 +62,16 @@ deploy:
10062
on:
10163
branch: master
10264
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
65+
- provider: packagecloud
66+
username: tarantool
67+
repository: "1_8"
68+
token: ${PACKAGECLOUD_TOKEN}
69+
dist: ${OS}/${DIST}
70+
package_glob: build/*.{rpm,deb}
71+
skip_cleanup: true
72+
on:
73+
branch: master
74+
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
10375

10476
notifications:
10577
email:

rpm/tarantool-queue.spec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ A collection of persistent queue implementations for Tarantool.
2020
%build
2121
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo
2222

23-
%check
24-
make check
25-
23+
# %check
24+
# make check
25+
#
2626
%define luapkgdir %{_datadir}/tarantool/queue/
2727
%install
2828
%make_install

t/020-fifottl.t

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ test:plan(13)
77
local queue = require('queue')
88
local state = require('queue.abstract.state')
99

10+
local qc = require('queue.compat')
11+
1012
local tnt = require('t.tnt')
1113
tnt.cfg{}
1214

@@ -209,9 +211,13 @@ test:test('read_only test', function(test)
209211
tube:put('abc', { delay = 0.1 })
210212
box.cfg{ read_only = true }
211213
fiber.sleep(0.11)
212-
local task = tube:take(0.2)
213-
test:isnil(task, "check that task wasn't moved to ready state")
214-
print(task)
214+
if qc.check_version({1, 7}) then
215+
local task = tube:take(0.2)
216+
test:isnil(task, "check that task wasn't moved to ready state")
217+
else
218+
local stat, task = pcall(tube.take, tube, 0.2)
219+
test:is(stat, false, "check that task wasn't taken")
220+
end
215221
test:is(tube.raw.fiber:status(), 'suspended',
216222
"check that background fiber isn't dead")
217223
box.cfg{ read_only = false }

t/040-utubettl.t

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ test:plan(15)
88
local queue = require('queue')
99
local state = require('queue.abstract.state')
1010

11+
local qc = require('queue.compat')
12+
1113
local tnt = require('t.tnt')
1214
tnt.cfg{}
1315

@@ -221,9 +223,13 @@ test:test('read_only test', function(test)
221223
tube:put('abc', { delay = 0.1 })
222224
box.cfg{ read_only = true }
223225
fiber.sleep(0.11)
224-
local task = tube:take(0.2)
225-
test:isnil(task, "check that task wasn't moved to ready state")
226-
print(task)
226+
if qc.check_version({1, 7}) then
227+
local task = tube:take(0.2)
228+
test:isnil(task, "check that task wasn't moved to ready state")
229+
else
230+
local stat, task = pcall(tube.take, tube, 0.2)
231+
test:is(stat, false, "check that task wasn't taken")
232+
end
227233
test:is(tube.raw.fiber:status(), 'suspended',
228234
"check that background fiber isn't dead")
229235
box.cfg{ read_only = false }

t/090-grant-check.t

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ local netbox = require('net.box')
1313
local tnt = require('t.tnt')
1414

1515
tnt.cfg{
16-
listen = uri.format({ host = test_host, service = test_port })
16+
listen = ('%s:%s'):format(test_host, test_port)
17+
-- listen = uri.format({ host = test_host, service = test_port })
1718
}
1819

1920
local qc = require('queue.compat')
@@ -86,23 +87,42 @@ test:test('check for call grants', function(test)
8687
test:is(a[1], 0, 'we aren\'t getting any error')
8788
box.session.su('admin')
8889

90+
local nb_connect = netbox.connect
91+
if nb_connect == nil then
92+
nb_connect = netbox.new
93+
end
94+
local con = nb_connect(
95+
('%s:%s@%s:%s'):format(test_user, test_pass, test_host, test_port)
96+
)
97+
--[[
8998
local con = netbox.connect(uri.format({
9099
login = test_user, password = test_pass,
91100
host = test_host, service = test_port,
92101
}, true))
102+
]]--
93103

94-
local stat, er = pcall(con.call, con, tube, 'queue.tube.test:take')
104+
local stat, err = pcall(con.call, con, 'queue.tube.test:take')
95105
test:is(stat, false, 'we\'re getting error')
96106

97107
-- granting call
98108
tube:grant('test', { call = true })
99109

110+
local qc_arg_unpack = function(arg)
111+
if qc.check_version({1, 7}) then
112+
return arg
113+
end
114+
return arg and arg[1]
115+
end
116+
100117
local a = con:call('queue.tube.test:take')
101-
test:is(a[1], 0, 'we aren\'t getting any error')
118+
test:is(qc_arg_unpack(a[1]), 0, 'we aren\'t getting any error')
102119
local b = con:call('queue.tube.test:take', qc.pack_args(0.1))
103-
test:isnil(b, 'we aren\'t getting any error')
104-
local c = con:call('queue.tube.test:ack', qc.pack_args(a[1]))
105-
test:is(a[1], 0, 'we aren\'t getting any error')
120+
test:isnil(
121+
qc_arg_unpack(qc_arg_unpack(b)),
122+
'we aren\'t getting any error'
123+
)
124+
local c = con:call('queue.tube.test:ack', qc.pack_args(qc_arg_unpack(a[1])))
125+
test:is(qc_arg_unpack(a[1]), 0, 'we aren\'t getting any error')
106126

107127
-- check grants again
108128
tube:grant('test', { call = true })

test.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/bin/bash
22

3-
curl https://packagecloud.io/tarantool/1_6/gpgkey | sudo apt-key add -
3+
VERSION=${VERSION:-1_6}
4+
5+
curl https://packagecloud.io/tarantool/${VERSION}/gpgkey | sudo apt-key add -
46
release=`lsb_release -c -s`
57

68
sudo apt-get install -y apt-transport-https
79

8-
sudo tee /etc/apt/sources.list.d/tarantool_1_6.list <<- EOF
9-
deb https://packagecloud.io/tarantool/1_6/ubuntu/ $release main
10-
deb-src https://packagecloud.io/tarantool/1_6/ubuntu/ $release main
10+
sudo tee /etc/apt/sources.list.d/tarantool_${VERSION}.list <<- EOF
11+
deb https://packagecloud.io/tarantool/${VERSION}/ubuntu/ $release main
12+
deb-src https://packagecloud.io/tarantool/${VERSION}/ubuntu/ $release main
1113
EOF
1214

1315
sudo apt-get update > /dev/null

0 commit comments

Comments
 (0)