From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (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 B2894469719 for ; Mon, 21 Sep 2020 05:18:05 +0300 (MSK) Date: Mon, 21 Sep 2020 05:18:13 +0300 From: Alexander Turenko Message-ID: <20200921021813.t7pfdtlpupv6fnbk@tkn_work_nb> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH v2 1/2] gitlab-ci: save failed test results files List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Alexander V. Tikhonov" Cc: tarantool-patches@dev.tarantool.org > + <<: *artifacts_reject_files_definition > + > +.pack_artifacts_reject_files_template: &pack_artifacts_reject_files_definition > + <<: *artifacts_reject_files_definition > + after_script: > + - > > + for f in `ls build/usr/src/*/tarantool-*/test/*/*.reject` ; do Nit: 'for f in path-with-star-globbing; do' would do almost the same and I would suggest to use the simpler form (it also does not depend on an external tool and does not involve forking), but this way we should handle 'no such files' case explicitly. See example here: https://github.com/tarantool/tarantool/commit/080beba063b05b184d7befcb15a8bcf32e7424f6 | for file in @TARANTOOL_ENABLEDDIR@/*.lua; do | instance=`basename $file .lua` | [ "${instance}" = "*" ] && break # skip empty directory | <...> | done When the glob is not matched, it falls into the loop with the 'as is' value (with star symbols). We all like bourne shell for those funny pitfalls. > + d=`dirname $f | sed 's#^build/usr/src/.*/tarantool-.*/test/##g'` ; > + mkdir -p test/$d 2>/dev/null ; > + cp $f test/$d/. ; > + done ; > + rm -rf test/var ; mkdir -p test/var ; > + cp -r build/usr/src/*/tarantool-*/test/var/artifacts test/var/. Nit: The period at the end looks unusual, but don't change anything. The patch would be a way simpler if test-run would collect everything that is necessary to upload within the artifacts directory. In fact, reject files are already there: test/var/artifacts//.result. But if you want to organize them in an another way, I would do this on the test-run side (somewhere within test/var/artifacts). Related code: [1]. See, the reject file is just copied, not moved. [1]: https://github.com/tarantool/test-run/blob/461731d71cf27faa6295bc759941f402fedc88e4/lib/test.py#L254