From: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
To: git@vger.kernel.org
Cc: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>,
sunshine@sunshineco.com, peff@peff.net, gitster@pobox.com
Subject: [PATCH v2 0/8] fix test failure with busybox
Date: Sun, 22 Mar 2020 07:55:09 +0700 [thread overview]
Message-ID: <cover.1584838148.git.congdanhqx@gmail.com> (raw)
Despite non-compiance from busybox's sh(1), grep(1), diff(1), find(1)
Alpine Linux is still a popular choice for container these days.
Fix false-positive failure in testsuite when run in Alpine Linux.
Đoàn Trần Công Danh (8):
t4061: use POSIX compliant regex(7)
test-lib-functions: test_cmp: eval $GIT_TEST_CMP
t5003: drop the subshell in test_lazy_prereq
t5003: skip conversion test if unzip -a is unavailable
t5616: use rev-parse instead to get HEAD's object_id
t7063: drop non-POSIX argument "-ls" from find(1)
t4124: fix test for non-compliant diff(1)
t5703: feed raw data into test-tool unpack-sideband
t/helper/test-pkt-line.c | 2 +-
t/t4061-diff-indent.sh | 2 +-
t/t4124-apply-ws-rule.sh | 6 ++++++
t/t5003-archive-zip.sh | 24 ++++++++++++------------
t/t5616-partial-clone.sh | 2 +-
t/t5703-upload-pack-ref-in-want.sh | 5 +----
t/t7063-status-untracked-cache.sh | 2 +-
t/test-lib-functions.sh | 2 +-
8 files changed, 24 insertions(+), 21 deletions(-)
Range-diff against v1:
1: 4830bd3aaf ! 1: 288e343d09 t4061: use POSIX compliance regex(7)
@@ Metadata
Author: Đoàn Trần Công Danh <congdanhqx@gmail.com>
## Commit message ##
- t4061: use POSIX compliance regex(7)
+ t4061: use POSIX compliant regex(7)
BRE interprets `+` literally, and
`\+` is undefined for POSIX BRE, from:
@@ Commit message
This test is failing with busybox sed, the default sed of Alpine Linux
- Fix it by using literal `+` instead.
+ We have 2 options here:
+
+ - Using literal `+` because BRE will interpret it as-is, or
+ - Using character class `[+]` to defend against a sed that expects ERE
+
+ ERE-expected sed is theoretical at this point,
+ but we haven't found it, yet.
+ And, we may run into other problems with that sed.
+ Let's go with first option and fix it later if that sed could be found.
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2: d3fafd61ec ! 2: 9d3823e849 test-lib-functions: test_cmp: eval $GIT_TEST_CMP
@@ Commit message
test-lib-functions: test_cmp: eval $GIT_TEST_CMP
Shell recognises first non-assignment token as command name.
- Thus, ` cd t/perf; ./p0000-perf-lib-sanity.sh -d -i -v` reports:
+ With /bin/sh linked to either /bin/bash or /bin/dash,
+ `cd t/perf && ./p0000-perf-lib-sanity.sh -d -i -v` reports:
> test_cmp:1: command not found: diff -u
-: ---------- > 3: 8e85b5c15c t5003: drop the subshell in test_lazy_prereq
3: ddeeefeae2 ! 4: 4f0ac0867c t5003: skip conversion test if unzip -a is unavailable
@@ Commit message
## t/t5003-archive-zip.sh ##
@@ t/t5003-archive-zip.sh: test_lazy_prereq UNZIP_SYMLINKS '
- )
+ test -h symlink
'
+test_lazy_prereq UNZIP_CONVERT '
-+ (
-+ mkdir unzip-convert &&
-+ cd unzip-convert &&
-+ "$GIT_UNZIP" -a "$TEST_DIRECTORY"/t5003/infozip-symlinks.zip
-+ )
++ "$GIT_UNZIP" -a "$TEST_DIRECTORY"/t5003/infozip-symlinks.zip
+'
+
check_zip() {
4: ce976e850c ! 5: ee7ef352a7 t5616: use rev-parse instead to get HEAD's object_id
@@ t/t5616-partial-clone.sh: test_expect_success 'do partial clone 1' '
ls pc1/.git/objects/pack/pack-*.promisor >promisorlist &&
test_line_count = 1 promisorlist &&
- git -C srv.bare rev-list HEAD >headhash &&
-+ git -C srv.bare rev-parse HEAD >headhash &&
++ git -C srv.bare rev-parse --verify HEAD >headhash &&
grep "$(cat headhash) HEAD" $(cat promisorlist) &&
grep "$(cat headhash) refs/heads/master" $(cat promisorlist)
'
5: 1993b28a12 ! 6: 59e3f73784 t7063: use POSIX find(1) syntax
@@ Metadata
Author: Đoàn Trần Công Danh <congdanhqx@gmail.com>
## Commit message ##
- t7063: use POSIX find(1) syntax
+ t7063: drop non-POSIX argument "-ls" from find(1)
Since commit 6b7728db81, (t7063: work around FreeBSD's lazy mtime
update feature, 2016-08-03), we started to use ls as a trick to update
@@ Commit message
However, `-ls` flag isn't required by POSIX's find(1), and
busybox(1) doesn't implement it.
- Use an equivalence `-exec ls -dils {} +` instead.
+ From the original conversation, it seems like find(1) with "-type d"
+ could trigger enough "lstat(2)" to ask FreeBSD update mtime.
+
+ Use only filter "-type d" for now.
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
@@ t/t7063-status-untracked-cache.sh: GIT_FORCE_UNTRACKED_CACHE=true
sync_mtime () {
- find . -type d -ls >/dev/null
-+ find . -type d -exec ls -dils {} + >/dev/null
++ find . -type d >/dev/null
}
avoid_racy() {
6: cd86febed9 ! 7: 10f39c3d30 t4124: fix test for non-compliance diff
@@ Metadata
Author: Đoàn Trần Công Danh <congdanhqx@gmail.com>
## Commit message ##
- t4124: fix test for non-compliance diff
+ t4124: fix test for non-compliant diff(1)
POSIX's diff(1) requires output in normal diff format.
However, busybox's diff's output is written in unified format.
@@ t/t4124-apply-ws-rule.sh: test_fix () {
# find touched lines
$DIFF file target | sed -n -e "s/^> //p" >fixed
++ # busybox's diff(1) output unified format
+ if ! test -s fixed; then
+ $DIFF file target |
-+ grep '^+' |
-+ grep -v '^+++' |
-+ sed -e "s/+//" >fixed
++ grep -v '^+++ target' |
++ sed -e "/^+/s/+//" >fixed
+ fi
# the changed lines are all expected to change
-: ---------- > 8: d4507d381e t5703: feed raw data into test-tool unpack-sideband
--
2.26.0.rc2.310.g2932bb562d
next reply other threads:[~2020-03-22 0:55 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-22 0:55 Đoàn Trần Công Danh [this message]
2020-03-22 0:55 ` [PATCH v2 1/8] t4061: use POSIX compliant regex(7) Đoàn Trần Công Danh
2020-03-22 0:55 ` [PATCH v2 2/8] test-lib-functions: test_cmp: eval $GIT_TEST_CMP Đoàn Trần Công Danh
2020-03-22 0:55 ` [PATCH v2 3/8] t5003: drop the subshell in test_lazy_prereq Đoàn Trần Công Danh
2020-03-22 0:55 ` [PATCH v2 4/8] t5003: skip conversion test if unzip -a is unavailable Đoàn Trần Công Danh
2020-03-22 0:55 ` [PATCH v2 5/8] t5616: use rev-parse instead to get HEAD's object_id Đoàn Trần Công Danh
2020-03-22 0:55 ` [PATCH v2 6/8] t7063: drop non-POSIX argument "-ls" from find(1) Đoàn Trần Công Danh
2020-03-23 14:11 ` Johannes Schindelin
2020-03-23 14:37 ` Torsten Bögershausen
2020-03-23 15:11 ` Danh Doan
2020-03-23 20:30 ` Junio C Hamano
2020-03-23 15:55 ` Junio C Hamano
2020-03-24 22:31 ` Johannes Schindelin
2020-03-24 23:46 ` Junio C Hamano
2020-03-22 0:55 ` [PATCH v2 7/8] t4124: fix test for non-compliant diff(1) Đoàn Trần Công Danh
2020-03-23 13:58 ` Johannes Schindelin
2020-03-23 15:04 ` Danh Doan
2020-03-23 20:50 ` Junio C Hamano
2020-03-24 3:40 ` Danh Doan
2020-03-24 18:47 ` Junio C Hamano
2020-03-25 14:24 ` Danh Doan
2020-03-24 22:29 ` Johannes Schindelin
2020-03-24 23:37 ` Junio C Hamano
2020-03-25 18:23 ` Johannes Schindelin
2020-03-22 0:55 ` [PATCH v2 8/8] t5703: feed raw data into test-tool unpack-sideband Đoàn Trần Công Danh
2020-03-22 6:08 ` [PATCH v2 0/8] fix test failure with busybox Jeff King
2020-03-26 4:37 ` [PATCH v4 " Đoàn Trần Công Danh
2020-03-26 4:37 ` [PATCH v4 1/8] t4061: use POSIX compliant regex(7) Đoàn Trần Công Danh
2020-03-26 4:37 ` [PATCH v4 2/8] test-lib-functions: test_cmp: eval $GIT_TEST_CMP Đoàn Trần Công Danh
2020-03-26 4:37 ` [PATCH v4 3/8] t5003: drop the subshell in test_lazy_prereq Đoàn Trần Công Danh
2020-03-26 4:37 ` [PATCH v4 4/8] t5003: skip conversion test if unzip -a is unavailable Đoàn Trần Công Danh
2020-03-26 4:37 ` [PATCH v4 5/8] t5616: use rev-parse instead to get HEAD's object_id Đoàn Trần Công Danh
2020-03-26 4:37 ` [PATCH v4 6/8] t7063: drop non-POSIX argument "-ls" from find(1) Đoàn Trần Công Danh
2020-03-26 4:37 ` [PATCH v4 7/8] t4124: fix test for non-compliant diff(1) Đoàn Trần Công Danh
2020-03-27 1:18 ` Junio C Hamano
2020-03-26 4:37 ` [PATCH v4 8/8] t5703: feed raw data into test-tool unpack-sideband Đoàn Trần Công Danh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1584838148.git.congdanhqx@gmail.com \
--to=congdanhqx@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.