Skip to content

Commit 2a911cc

Browse files
r0maneca
andcommitted
Fix Windows CI: Add fallback assertions for permission tests
Fix test failures on Windows CI where permission validation tests were running without assertions, causing "Test ran without assertions" errors. The issue occurred because permission validation is Unix-only, and the entire test body was wrapped in (when-not Windows ...) without a fallback assertion for Windows systems. Changes: - permission-validation-unix-test: Replace when-not with if/else - permission-validation-secure-test: Replace when-not with if/else - Add fallback assertion on Windows: (is true "...skipped on Windows") - Unix behavior unchanged: actual permission tests still run Before (Windows): (when-not Windows (is ...)) ; No assertion runs on Windows -> FAIL After (Windows): (if Windows (is true "skipped") ; Assertion runs -> PASS (is ...)) ; Unix: actual test runs All 207 tests pass with 783 assertions. 🤖 Generated with [eca](https://eca.dev) Co-Authored-By: eca <noreply@eca.dev>
1 parent 4777b10 commit 2a911cc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/eca/secrets_test.clj

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,10 @@
719719

720720
(deftest permission-validation-unix-test
721721
(testing "Permission validation on Unix systems"
722-
;; Only run on Unix-like systems
723-
(when-not (string/includes? (System/getProperty "os.name") "Windows")
722+
(if (string/includes? (System/getProperty "os.name") "Windows")
723+
;; On Windows, just verify this is skipped
724+
(is true "Permission validation is Unix-only, skipped on Windows")
725+
;; On Unix-like systems, test permission validation
724726
(let [temp-file (java.io.File/createTempFile "netrc-test" ".netrc")
725727
temp-path (.getPath temp-file)
726728
warnings (atom [])]
@@ -754,7 +756,10 @@
754756

755757
(deftest permission-validation-secure-test
756758
(testing "No warning for secure permissions (0600)"
757-
(when-not (string/includes? (System/getProperty "os.name") "Windows")
759+
(if (string/includes? (System/getProperty "os.name") "Windows")
760+
;; On Windows, just verify this is skipped
761+
(is true "Permission validation is Unix-only, skipped on Windows")
762+
;; On Unix-like systems, test secure permission behavior
758763
(let [temp-file (java.io.File/createTempFile "netrc-test" ".netrc")
759764
temp-path (.getPath temp-file)
760765
warnings (atom [])]

0 commit comments

Comments
 (0)