From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id CC30D6EC6F; Fri, 26 Feb 2021 01:08:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CC30D6EC6F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614290919; bh=SEZ4rTxP0eT/rZxgdldLvx22D9U3Qg7vthaX/8DTq/I=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=HxiTzwDdBKKO8slfulGfbB233JatbtO2DKUJHdYFbeAtx81+FNmWJHqHlY1DjyM84 98HWiGNmLU5uJj6Z8Nx2FrGgt+RKQB3XUDLipI0fAa5P5z37NccVqNodNEGYYpog1x E4GbyYPziS9L3vRl7OtXNAzd61vm/O9THYrMNQNg= Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id A27C96EC6F for ; Fri, 26 Feb 2021 01:08:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A27C96EC6F Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1lFOoG-0006Jx-BO; Fri, 26 Feb 2021 01:08:36 +0300 Date: Fri, 26 Feb 2021 01:08:32 +0300 To: Timur Safin Message-ID: <20210225220832.GC9042@tarantool.org> References: <2ac28542e4eac2031e5c30b279aabd3bcacbd7a1.1612390822.git.imun@tarantool.org> <03e801d70a7c$f9162700$eb427500$@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <03e801d70a7c$f9162700$eb427500$@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD975C3EC174F56692243410BA6471F01664CBE9F2A03BCE963182A05F5380850402CB8F6160A3FAD880F14FF53C5892696793F056A17D805164B97A26FAAA865A4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE79A02CDD1178524C2EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E0FC02D497BF09508638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95CDDE882590F889B1C58C114A6CF28D180AB5AE7834B75E19FA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE77A825AB47F0FC8649FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C34964A708C60C975A117882F4460429728AD0CFFFB425014E868A13BD56FB6657A7F4EDE966BC389F9E8FC8737B5C22497ECBC18655D52CDF089D37D7C0E48F6CCF19DD082D7633A0E7DDDDC251EA7DABAAAE862A0553A39223F8577A6DFFEA7CDB14762BE8BDFCF043847C11F186F3C5E7DDDDC251EA7DABCC89B49CDF41148FA8EF81845B15A4842623479134186CDE6BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5A50718424A170BC6E65B042700C0DB250B7B53E066BE4600D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7557E988E9157162368E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D348BE83DFD8AFB1CAC7148FD5D08B77F1F69DF77FFE471B2CD4F3B7DBCE3F5155B7D309DEE8D3A1E6E1D7E09C32AA3244CEC24A86BCB81C675C1C80C2079C77BF064EE5813BBCA3A9D927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojvz1c9SWJtj//eE4lYxUXVA== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822058151157F924DAAEDF1E0AB5B71A975A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 3/3] ci: enable LuaJIT tests in CI X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: TML Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Timur, On 24.02.21, Timur Safin wrote: > This 1 thing is the only one that is bother me: it looks dependency of > Tarantool LuaJIT tests are not yet properly assigned between build > Targets we have. > > Let me put it how it looks like from my side: > - LuaJIT-test is phony, defined in third_party/luajit target and > depends on tarantool-tests > - tarantool-tests are not phony (i.e. you could not run Tarantool-tests > Twice, if you wish to) Please, do not take it personally (at least since I've heard such "bothering" from several teammates), but I consider this as a disease. Why do you need to run the *passed* tests twice? To make *more* sure? Kinda Windows-way... Unfortunately, I can't create a dialog window with "Are you sure these tests passed?" message, so I removed the artefacts produced by .PHONY rules you mentioned above. Now you can run and targets as much as you want. > - third_party/luajit/test is also depending on LuaJIT-luacheck > Which is not phone either, and is not runnable if you > Run it outside of Tarantool build (because .luacheckrc is > At the root of Tarantool repo, not LuaJIT repo). This is not true, there is a LuaJIT specific .luacheckrc in LuaJIT repo. The issue you've shared with me relates to the case when is located within -- so called "idiomatic build way". Since luacheck is run against all Lua files within , autogenerated jit/vmdef.lua (the single file producing luacheck warnings) is also checked. I explicitly excluded it from the file list to be checked. Now everything is fine. > - Also LuaJIT-test is explicitly referred in the travis makefiles > And not implicitly called by dependency of Tarantool testing. LuaJIT-test is a dependency for Tarantool testing (i.e. target), but Make is not used for running Tarantool tests in CI, so there is no other convenient way than using in .travis.mk. I hope this will have been fixed in the future and it is definitely out of the scope of this issue. > > This bothers me a lot, looks like dependency tree is not working > correctly at the moment. Could you please make luacheck and Tarantool-test > targets phony, and add LuaJIT-test as prerequisite of Tarantool > testing (in cmake)? I hope the changes below are enough. Fixed in LuaJIT submodule, squashed, force-pushed to the branch. ================================================================================ diff --git a/.gitignore b/.gitignore index 22921bf..2103a30 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,5 @@ cmake_install.cmake cmake_uninstall.cmake compile_commands.json install_manifest.txt -luacheck.ok luajit-parse-memprof luajit.pc -tests.ok diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bb0ff91..d166c9d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -6,33 +6,32 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) find_program(LUACHECK luacheck) if(LUACHECK) set(LUACHECK_RC ${PROJECT_SOURCE_DIR}/.luacheckrc) - set(LUACHECK_OK ${CMAKE_CURRENT_BINARY_DIR}/luacheck.ok) file(GLOB_RECURSE LUACHECK_DEPS ${PROJECT_SOURCE_DIR}/*.lua) - add_custom_command( + add_custom_target(${PROJECT_NAME}-luacheck + DEPENDS ${LUACHECK_RC} ${LUACHECK_DEPS} + ) + add_custom_command(TARGET ${PROJECT_NAME}-luacheck COMMENT "Running luacheck static analysis" - OUTPUT ${LUACHECK_OK} - DEPENDS ${LUACHECK} ${LUACHECK_RC} ${LUACHECK_DEPS} COMMAND ${LUACHECK} ${PROJECT_SOURCE_DIR} --codes --config ${LUACHECK_RC} - && touch ${LUACHECK_OK} - # XXX: Filenames in .luacheckrc are considered relative to - # the working directory, hence luacheck should be run in the - # project root directory. - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + # XXX: jit/vmdef.lua is an autogenerated Lua source, so + # there is no need to run luacheck against it. Hence + # explicitly exclude this file from the list for check. + --exclude-files ${LUAJIT_BINARY_DIR}/jit/vmdef.lua + # XXX: Filenames in .luacheckrc are considered relative to + # the working directory, hence luacheck should be run in the + # project root directory. + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} ) else() - add_custom_command( + add_custom_target(${PROJECT_NAME}-luacheck) + add_custom_command(TARGET ${PROJECT_NAME}-luacheck COMMENT "`luacheck' is not found, so ${PROJECT_NAME}-luacheck target is dummy" - OUTPUT luacheck.ok - COMMAND touch luacheck.ok - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) endif() -add_custom_target(${PROJECT_NAME}-luacheck DEPENDS luacheck.ok) - add_subdirectory(tarantool-tests) add_custom_target(${PROJECT_NAME}-test DEPENDS diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt index 52c3007..e9ac62a 100644 --- a/test/tarantool-tests/CMakeLists.txt +++ b/test/tarantool-tests/CMakeLists.txt @@ -72,10 +72,11 @@ file(GLOB TEST_DEPS ${CMAKE_CURRENT_SOURCE_DIR}/*${LUA_TEST_SUFFIX}) # LUA_CPATH and LD_LIBRARY_PATH variables and also TESTLIBS list # with dependecies are set in scope of BuildTestLib macro. -add_custom_command( - COMMENT "Running Tarantool tests" - OUTPUT tests.ok +add_custom_target(tarantool-tests DEPENDS ${LUAJIT_TEST_BINARY} ${TESTLIBS} ${TEST_DEPS} +) +add_custom_command(TARGET tarantool-tests + COMMENT "Running Tarantool tests" COMMAND env LUA_PATH="${LUA_PATH}\;\;" @@ -85,8 +86,6 @@ add_custom_command( --exec ${LUAJIT_TEST_BINARY} --ext ${LUA_TEST_SUFFIX} --failures --shuffle - && touch tests.ok WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) -add_custom_target(tarantool-tests DEPENDS tests.ok) ================================================================================ > > Thanks, > Timur > > -- Best regards, IM