Skip to content

Commit 1e9152f

Browse files
committed
tests/compose: Fix unified rev-parse test
We were hitting the classic "negative test passes for the wrong reason". It was failing not because it didn't have a parent, but because we didn't pass `--repo`. Fix this and also explicitly check for the error message we expect.
1 parent 9142595 commit 1e9152f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/compose-tests/test-basic-unified.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ assert_not_streq "${origrev}" "${newrev}"
7272
echo "ok rerun"
7373

7474
# And check that --no-parent worked.
75-
if ostree rev-parse ${newrev}^; then
75+
if ostree --repo "${repobuild}" rev-parse ${newrev}^ 2>error.txt; then
7676
assert_not_reached "New revision has a parent even with --no-parent?"
7777
fi
78+
assert_file_has_content_literal error.txt 'has no parent'
7879
echo "ok --no-parent"

0 commit comments

Comments
 (0)