Skip to content

Commit f2f17b2

Browse files
committed
test(url): make url_exists tests deterministic and offline
Fix flaky network-dependent URL tests in the shell test suite. Root cause: - tests used external hosts (facebook.com, google.com) - DNS/network availability varies by environment, causing false negatives Changes: - app/test-url-exists-ok now checks local file URLs: file:///etc/hosts and file:///etc/passwd - app/test-url-exists-no now checks one failing and one passing local URL: file:///definitely-not-here and file:///etc/hosts - update SPDX copyright year to 2026 in both files Validation: - shellcheck -s sh app/test-url-exists-ok app/test-url-exists-no - redo test (passes across available shells)
1 parent dd1d755 commit f2f17b2

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

app/test-url-exists-no

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/sh
22
# vi:et lbr noet sw=2 ts=2 tw=79 wrap
3-
# SPDX-FileCopyrightText: 2022-2025 David Rabkin
3+
# SPDX-FileCopyrightText: 2022-2026 David Rabkin
44
# SPDX-License-Identifier: 0BSD
55
# shellcheck disable=SC1090,SC1091 # File not following.
66
. "$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)"/../lib/base.sh
77
url_exists \
8-
doesnotexist.c0m \
9-
google.com
8+
file:///definitely-not-here \
9+
file:///etc/hosts

app/test-url-exists-ok

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/sh
22
# vi:et lbr noet sw=2 ts=2 tw=79 wrap
3-
# SPDX-FileCopyrightText: 2022-2025 David Rabkin
3+
# SPDX-FileCopyrightText: 2022-2026 David Rabkin
44
# SPDX-License-Identifier: 0BSD
55
# shellcheck disable=SC1090,SC1091 # File not following.
66
. "$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)"/../lib/base.sh
77
url_exists \
8-
facebook.com \
9-
google.com
8+
file:///etc/hosts \
9+
file:///etc/passwd

0 commit comments

Comments
 (0)