Subject: 27.0.50; Failing secrets tests on Cygwin

From: Ken Brown <[email-masked]>
Date: Sat, 1 Dec 2018 23:02:57 +0000

Two of the secrets tests fail on Cygwin (at least in my normal working
environment) because there is no "Login" collection.  Not knowing
anything about this, I'm inclined to take the easy way out, as in the
attached patch.  Is there a better way of handling it?

Ken

In GNU Emacs 27.0.50 (build 6, x86_64-pc-cygwin, GTK+ Version 3.22.28)
  of 2018-12-01 built on moufang2
Repository revision: 070ef95c1007cb3d54e04bc337d9fb5463912cc1
Repository branch: master
Windowing system distributor 'The Cygwin/X Project', version 11.0.12002000
From 3a4e7bf9de834ef30aa2642ef2fc9875840201ed Mon Sep 17 00:00:00 2001
From: Ken Brown <[email-masked]>
Date: Sat, 1 Dec 2018 17:54:59 -0500
Subject: [PATCH] Fix secrets tests on Cygwin

* test/lisp/net/secrets-tests.el (secrets-test02-collections):
(secrets-test03-items): Don't expect there to be a "Login"
collection on Cygwin.
---
 test/lisp/net/secrets-tests.el | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/test/lisp/net/secrets-tests.el b/test/lisp/net/secrets-tests.el
index de3ce731be..90728f081d 100644
--- a/test/lisp/net/secrets-tests.el
+++ b/test/lisp/net/secrets-tests.el
@@ -91,9 +91,11 @@ secrets--test-delete-all-session-items
       (progn
 	(should (secrets-open-session))
 
-	;; There must be at least the collections "Login" and "session".
-	(should (or (member "Login" (secrets-list-collections))
-                    (member "login" (secrets-list-collections))))
+	;; There must be at least the collections "Login" and "session"
+        ;; except on Cygwin, wehre there is no "Login" collection.
+        (when (not (eq system-type 'cygwin))
+	  (should (or (member "Login" (secrets-list-collections))
+                      (member "login" (secrets-list-collections)))))
 	(should (member "session" (secrets-list-collections)))
 
 	;; Create a random collection.  This asks for a password
@@ -160,9 +162,10 @@ secrets--test-delete-all-session-items
 
 	;; There shall be no items in the "session" collection.
 	(should-not (secrets-list-items "session"))
-	;; There shall be items in the "Login" collection.
-	(should (or (secrets-list-items "Login")
-                    (secrets-list-items "login")))
+	;; There shall be items in the "Login" collection except on Cygwin.
+	(when (not (eq system-type 'cygwin))
+	  (should (or (secrets-list-items "Login")
+		      (secrets-list-items "login"))))
 
 	;; Create a new item.
 	(should (setq item-path (secrets-create-item "session" "foo" "secret")))
-- 
2.17.0