Skip to content

Commit

Permalink
t1404: annotate test cases with REFFILES
Browse files Browse the repository at this point in the history
* Reftable for now lacks detailed error messages for directory/file conflicts.
  Skip message comparisons.

* Mark tests that muck with .git directly as REFFILES.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
  • Loading branch information
hanwen committed Aug 17, 2021
1 parent f0b7b1e commit 3110d6e
Showing 1 changed file with 42 additions and 14 deletions.
56 changes: 42 additions & 14 deletions t/t1404-update-ref-errors.sh
Expand Up @@ -27,7 +27,9 @@ test_update_rejected () {
fi &&
printf "create $prefix/%s $C\n" $create >input &&
test_must_fail git update-ref --stdin <input 2>output.err &&
test_i18ngrep -F "$error" output.err &&
if test_have_prereq REFFILES ; then
test_i18ngrep -F "$error" output.err
fi &&
git for-each-ref $prefix >actual &&
test_cmp unchanged actual
}
Expand Down Expand Up @@ -101,7 +103,9 @@ df_test() {
printf "%s\n" "delete $delname" "create $addname $D"
fi >commands &&
test_must_fail git update-ref --stdin <commands 2>output.err &&
test_cmp expected-err output.err &&
if test_have_prereq REFFILES ; then
test_cmp expected-err output.err
fi &&
printf "%s\n" "$C $delref" >expected-refs &&
git for-each-ref --format="%(objectname) %(refname)" $prefix/r >actual-refs &&
test_cmp expected-refs actual-refs
Expand Down Expand Up @@ -336,7 +340,9 @@ test_expect_success 'missing old value blocks update' '
EOF
printf "%s\n" "update $prefix/foo $E $D" |
test_must_fail git update-ref --stdin 2>output.err &&
test_cmp expected output.err
if test_have_prereq REFFILES ; then
test_cmp expected output.err
fi
'

test_expect_success 'incorrect old value blocks update' '
Expand All @@ -347,7 +353,9 @@ test_expect_success 'incorrect old value blocks update' '
EOF
printf "%s\n" "update $prefix/foo $E $D" |
test_must_fail git update-ref --stdin 2>output.err &&
test_cmp expected output.err
if test_have_prereq REFFILES ; then
test_cmp expected output.err
fi
'

test_expect_success 'existing old value blocks create' '
Expand All @@ -358,7 +366,9 @@ test_expect_success 'existing old value blocks create' '
EOF
printf "%s\n" "create $prefix/foo $E" |
test_must_fail git update-ref --stdin 2>output.err &&
test_cmp expected output.err
if test_have_prereq REFFILES ; then
test_cmp expected output.err
fi
'

test_expect_success 'incorrect old value blocks delete' '
Expand All @@ -369,7 +379,9 @@ test_expect_success 'incorrect old value blocks delete' '
EOF
printf "%s\n" "delete $prefix/foo $D" |
test_must_fail git update-ref --stdin 2>output.err &&
test_cmp expected output.err
if test_have_prereq REFFILES ; then
test_cmp expected output.err
fi
'

test_expect_success 'missing old value blocks indirect update' '
Expand All @@ -380,7 +392,9 @@ test_expect_success 'missing old value blocks indirect update' '
EOF
printf "%s\n" "update $prefix/symref $E $D" |
test_must_fail git update-ref --stdin 2>output.err &&
test_cmp expected output.err
if test_have_prereq REFFILES ; then
test_cmp expected output.err
fi
'

test_expect_success 'incorrect old value blocks indirect update' '
Expand All @@ -392,7 +406,9 @@ test_expect_success 'incorrect old value blocks indirect update' '
EOF
printf "%s\n" "update $prefix/symref $E $D" |
test_must_fail git update-ref --stdin 2>output.err &&
test_cmp expected output.err
if test_have_prereq REFFILES ; then
test_cmp expected output.err
fi
'

test_expect_success 'existing old value blocks indirect create' '
Expand All @@ -404,7 +420,9 @@ test_expect_success 'existing old value blocks indirect create' '
EOF
printf "%s\n" "create $prefix/symref $E" |
test_must_fail git update-ref --stdin 2>output.err &&
test_cmp expected output.err
if test_have_prereq REFFILES ; then
test_cmp expected output.err
fi
'

test_expect_success 'incorrect old value blocks indirect delete' '
Expand All @@ -416,7 +434,9 @@ test_expect_success 'incorrect old value blocks indirect delete' '
EOF
printf "%s\n" "delete $prefix/symref $D" |
test_must_fail git update-ref --stdin 2>output.err &&
test_cmp expected output.err
if test_have_prereq REFFILES ; then
test_cmp expected output.err
fi
'

test_expect_success 'missing old value blocks indirect no-deref update' '
Expand All @@ -427,7 +447,9 @@ test_expect_success 'missing old value blocks indirect no-deref update' '
EOF
printf "%s\n" "option no-deref" "update $prefix/symref $E $D" |
test_must_fail git update-ref --stdin 2>output.err &&
test_cmp expected output.err
if test_have_prereq REFFILES ; then
test_cmp expected output.err
fi
'

test_expect_success 'incorrect old value blocks indirect no-deref update' '
Expand All @@ -439,7 +461,9 @@ test_expect_success 'incorrect old value blocks indirect no-deref update' '
EOF
printf "%s\n" "option no-deref" "update $prefix/symref $E $D" |
test_must_fail git update-ref --stdin 2>output.err &&
test_cmp expected output.err
if test_have_prereq REFFILES ; then
test_cmp expected output.err
fi
'

test_expect_success 'existing old value blocks indirect no-deref create' '
Expand All @@ -451,7 +475,9 @@ test_expect_success 'existing old value blocks indirect no-deref create' '
EOF
printf "%s\n" "option no-deref" "create $prefix/symref $E" |
test_must_fail git update-ref --stdin 2>output.err &&
test_cmp expected output.err
if test_have_prereq REFFILES ; then
test_cmp expected output.err
fi
'

test_expect_success 'incorrect old value blocks indirect no-deref delete' '
Expand All @@ -463,7 +489,9 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' '
EOF
printf "%s\n" "option no-deref" "delete $prefix/symref $D" |
test_must_fail git update-ref --stdin 2>output.err &&
test_cmp expected output.err
if test_have_prereq REFFILES ; then
test_cmp expected output.err
fi
'

test_expect_success REFFILES 'non-empty directory blocks create' '
Expand Down

0 comments on commit 3110d6e

Please sign in to comment.