Skip to content

Commit

Permalink
Fix luatest package build
Browse files Browse the repository at this point in the history
  • Loading branch information
ylobankov committed Nov 14, 2023
1 parent edc7cf0 commit 28dd223
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include_files = {"**/*.lua", "*.rockspec", "*.luacheckrc"}
exclude_files = {"lua_modules/", ".luarocks/", ".rocks/", "tmp/"}
exclude_files = {"build.luarocks/", "lua_modules/", "tmp/", ".luarocks/", ".rocks/"}

max_line_length = 120
24 changes: 17 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,38 @@ set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES .rocks)
add_custom_command(
OUTPUT .rocks
DEPENDS ${PROJECT_NAME}-scm-1.rockspec
COMMAND tarantoolctl rocks make ./${PROJECT_NAME}-scm-1.rockspec
COMMAND tarantoolctl rocks install http 1.1.0
COMMAND tarantoolctl rocks install luacheck 0.25.0
COMMAND tarantoolctl rocks install luacov 0.13.0
COMMAND tt rocks make ./${PROJECT_NAME}-scm-1.rockspec
COMMAND tt rocks install http 1.1.0
COMMAND tt rocks install luacheck 0.26.0
COMMAND tt rocks install luacov 0.13.0
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

add_custom_target(bootstrap DEPENDS .rocks)

add_custom_command(
OUTPUT .rocks/bin/ldoc
DEPENDS bootstrap
COMMAND tarantoolctl rocks install ldoc --server=http://rocks.moonscript.org
COMMAND tt rocks --server=http://rocks.moonscript.org install ldoc
)

set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES doc)
add_custom_target(doc
DEPENDS .rocks/bin/ldoc
COMMAND .rocks/bin/ldoc -t ${PROJECT_NAME}-scm-1 -p ${PROJECT_NAME} --all .
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)

add_custom_target(lint DEPENDS bootstrap COMMAND .rocks/bin/luacheck .)
add_custom_target(selftest DEPENDS bootstrap COMMAND bin/luatest --shuffle group)
add_custom_target(lint
DEPENDS bootstrap
COMMAND .rocks/bin/luacheck .
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
add_custom_target(selftest
DEPENDS bootstrap
COMMAND bin/luatest --shuffle group
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)

add_custom_target(test_with_coverage_report
DEPENDS bootstrap
Expand Down
6 changes: 3 additions & 3 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ luatest (0.5.7-1) unstable; urgency=medium
* Change test run summary report: use verbs in past simple tense (succeeded,
failed, xfailed, etc.) instead of nouns (success(es), fail(s), xfail(s), etc.)

-- Nikolay Volynkin <[email protected]> Fri, 28 Jan 2022 14:00:00 +0300
-- Nikolay Volynkin <[email protected]> Fri, 28 Jan 2022 14:00:00 +0300

luatest (0.5.6-1) unstable; urgency=medium

Expand Down Expand Up @@ -51,8 +51,8 @@ luatest (0.5.3-1) unstable; urgency=medium

luatest (0.5.2-1) unstable; urgency=medium

- Throw parser error when .json is accessed on response with invalid body.
- Set `Content-Type: application/json` for `:http_request(..., {json = ...})` requests.
* Throw parser error when .json is accessed on response with invalid body.
* Set `Content-Type: application/json` for `:http_request(..., {json = ...})` requests.

-- Maxim Melentiev <[email protected]> Thu, 25 Jun 2020 13:00:00 +0300

Expand Down
2 changes: 1 addition & 1 deletion debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9
10
3 changes: 2 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Maintainer: Konstantin Nazarov <[email protected]>
Build-Depends: debhelper (>= 9), cdbs,
tarantool (>= 1.9.0),
tarantool-dev (>= 1.9.0),
tarantool-checks (>= 3.0.1)
tarantool-checks (>= 3.0.1),
tt (>= 1.0.0)
Standards-Version: 3.9.6
Homepage: https://github.com/tarantool/luatest
Vcs-Git: git://github.com/tarantool/luatest.git
Expand Down
2 changes: 1 addition & 1 deletion debian/docs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
README.md
README.rst
2 changes: 1 addition & 1 deletion debian/prebuild.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
curl -s https://packagecloud.io/install/repositories/tarantool/1_10/script.deb.sh | sudo bash
curl -L https://tarantool.io/release/${LUATEST_TARANTOOL_SERIES:-2}/installer.sh | bash
2 changes: 2 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ VERSION := $(shell echo $(DEB_VERSION) | sed 's/-[[:digit:]]\+$$//')
DEB_CMAKE_EXTRA_FLAGS := -DCMAKE_INSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DVERSION=$(VERSION)

DEB_MAKE_CHECK_TARGET := selftest

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/cmake.mk
2 changes: 1 addition & 1 deletion rpm/prebuild.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
curl -s https://packagecloud.io/install/repositories/tarantool/1_10/script.rpm.sh | sudo bash
curl -L https://tarantool.io/release/${LUATEST_TARANTOOL_SERIES:-2}/installer.sh | bash
15 changes: 8 additions & 7 deletions rpm/tarantool-luatest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,32 @@ License: MIT
URL: https://github.com/tarantool/luatest
Source0: https://github.com/tarantool/luatest/archive/%{version}/luatest-%{version}.tar.gz
BuildArch: noarch
BuildRequires: tarantool >= 1.9.0
BuildRequires: tarantool-devel >= 1.9.0
BuildRequires: tarantool-checks
BuildRequires: tarantool-checks >= 3.0.1
BuildRequires: tt >= 1.0.0
Requires: tarantool >= 1.9.0
Requires: tarantool-checks
Requires: tarantool-checks >= 3.0.1
%description
Simple Tarantool test framework for both unit and integration testing.

%prep
%setup -q -n %{name}-%{version}

%build
%cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVERSION=%{version}
%cmake -B . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVERSION=%{version}
make %{?_smp_mflags}

%check
ctest -VV
make selftest

%install
%make_install

%files
#%{_libdir}/tarantool/*/
%{_datarootdir}/tarantool/*/
%{_bindir}/luatest
%doc README.md
%doc README.rst
%{!?_licensedir:%global license %doc}
%license LICENSE

Expand All @@ -52,7 +53,7 @@ ctest -VV
- Add `xfail` status.
- Add new `Server:exec()` function which runs a Lua function remotely.

* Thu Sept 16 2021 Aleksandr Shemenev <[email protected]> 0.5.5-1
* Thu Sep 16 2021 Aleksandr Shemenev <[email protected]> 0.5.5-1
- Repeat `_each` and `_test` hooks when `--repeat` is specified.
- Add group parametrization.

Expand Down
4 changes: 2 additions & 2 deletions test/capturing_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ end
local function assert_captured(fn)
helper.run_suite(fn)
local captured = capture:flush()
t.assert_not_str_contains(captured.stdout, 'test-')
t.assert_not_str_contains(captured.stderr, 'test-')
t.assert_not_str_contains(captured.stdout, 'test-out')
t.assert_not_str_contains(captured.stderr, 'test-err')
assert_capture_restored()
end

Expand Down

0 comments on commit 28dd223

Please sign in to comment.