unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#75118] [PATCH Cuirass] tests: Test properties in specifications.
@ 2024-12-26 14:57 Romain GARBAGE
  2024-12-26 17:57 ` bug#75118: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Romain GARBAGE @ 2024-12-26 14:57 UTC (permalink / raw)
  To: 75118; +Cc: ludovic.courtes, Romain GARBAGE

* tests/common.scm (specifications=?): Add testing of the properties field.
* tests/forgejo.scm (default-pull-request-json): Add missing fields.
(test): Add properties to expected specification.
* tests/gitlab.scm (default-mr-json, custom-mr-json,
custom-mr-json-multiple-packages, custom-mr-json-name-prefix,
custom-mr-json-build-all): Fix iid type. Add missing fields. Improve coherency
of values.
(tests): Add properties to expected specifications.
---
 tests/common.scm  |  4 ++-
 tests/forgejo.scm | 13 +++++++--
 tests/gitlab.scm  | 71 +++++++++++++++++++++++++++++++++++------------
 3 files changed, 66 insertions(+), 22 deletions(-)

diff --git a/tests/common.scm b/tests/common.scm
index 488d8db..479fef3 100644
--- a/tests/common.scm
+++ b/tests/common.scm
@@ -148,4 +148,6 @@ Return the socket on success and #f on failure."
        (equal? (map channel-branch
                     (specification-channels spec1))
                (map channel-branch
-                    (specification-channels spec2)))))
+                    (specification-channels spec2)))
+       (equal? (specification-properties spec1)
+               (specification-properties spec2))))
diff --git a/tests/forgejo.scm b/tests/forgejo.scm
index 62b22c6..2718bb3 100644
--- a/tests/forgejo.scm
+++ b/tests/forgejo.scm
@@ -47,7 +47,8 @@
         \"sha\": \"666af40e8a059fa05c7048a7ac4f2eccbbd0183b\",
         \"repo\": {
           \"name\": \"project-name\",
-          \"clone_url\": \"https://forgejo.instance.test/base-repo/project-name.git\"
+          \"clone_url\": \"https://forgejo.instance.test/base-repo/project-name.git\",
+          \"html_url\": \"https://forgejo.instance.test/base-repo/project-name\"
         }
       },
       \"head\": {
@@ -56,7 +57,8 @@
         \"sha\": \"582af40e8a059fa05c7048a7ac4f2eccbbd0183b\",
         \"repo\": {
           \"name\": \"fork-name\",
-          \"clone_url\": \"https://forgejo.instance.test/source-repo/fork-name.git\"
+          \"clone_url\": \"https://forgejo.instance.test/source-repo/fork-name.git\",
+          \"html_url\": \"https://forgejo.instance.test/source-repo/fork-name\"
         }
       }
     }
@@ -78,4 +80,9 @@
             %default-channels))
     (priority %default-jobset-options-priority)
     (period %default-jobset-options-period)
-    (systems %default-jobset-options-systems))))
+    (systems %default-jobset-options-systems)
+    (properties '((forge-type . forgejo)
+                  (pull-request-url . "https://forgejo.instance.test/base-repo/pulls/1")
+                  (pull-request-number . 1)
+                  (pull-request-target-repository-name . project-name)
+                  (pull-request-target-repository-home-page . "https://forgejo.instance.test/base-repo/project-name"))))))
diff --git a/tests/gitlab.scm b/tests/gitlab.scm
index 6df2af3..7d24a6a 100644
--- a/tests/gitlab.scm
+++ b/tests/gitlab.scm
@@ -44,7 +44,7 @@
     \"object_attributes\": {
         \"action\": \"open\",
         \"merge_status\": \"can_be_merged\",
-        \"iid\": \"1\",
+        \"iid\": 1,
         \"source_branch\": \"test-branch\",
         \"source\": {
             \"git_http_url\": \"https://gitlab.instance.test/source-repo/fork-name.git\",
@@ -52,11 +52,11 @@
             \"name\": \"test-project\"
         },
         \"target\": {
-            \"git_http_url\": \"https://gitlab.instance.test/source-repo/project-name.git\",
-            \"homepage\": \"https://gitlab.instance.test/source-repo/project-name\",
+            \"git_http_url\": \"https://gitlab.instance.test/target-repo/project-name.git\",
+            \"homepage\": \"https://gitlab.instance.test/target-repo/project-name\",
             \"name\": \"project-name\"
         },
-        \"url\": \"https://gitlab.instance.test/source-repo/-/merge_requests/1\"
+        \"url\": \"https://gitlab.instance.test/target-repo/-/merge_requests/1\"
     }
   }")
 
@@ -69,16 +69,19 @@
     \"object_attributes\": {
         \"action\": \"open\",
         \"merge_status\": \"can_be_merged\",
-        \"iid\": \"2\",
+        \"iid\": 2,
         \"source_branch\": \"test-branch\",
         \"source\": {
             \"git_http_url\": \"https://gitlab.instance.test/source-repo/fork-name.git\",
+            \"homepage\": \"https://gitlab.instance.test/source-repo/project-name\",
             \"name\": \"test-project\"
         },
         \"target\": {
-            \"git_http_url\": \"https://gitlab.instance.test/source-repo/project-name.git\",
+            \"git_http_url\": \"https://gitlab.instance.test/target-repo/project-name.git\",
+            \"homepage\": \"https://gitlab.instance.test/target-repo/project-name\",
             \"name\": \"project-name\"
         },
+        \"url\": \"https://gitlab.instance.test/target-repo/-/merge_requests/2\",
         \"cuirass\": {
             \"period\": 25,
             \"priority\": 3,
@@ -104,16 +107,19 @@
     \"object_attributes\": {
         \"action\": \"open\",
         \"merge_status\": \"can_be_merged\",
-        \"iid\": \"1\",
+        \"iid\": 1,
         \"source_branch\": \"test-branch\",
         \"source\": {
             \"git_http_url\": \"https://gitlab.instance.test/source-repo/fork-name.git\",
+            \"homepage\": \"https://gitlab.instance.test/source-repo/project-name\",
             \"name\": \"test-project\"
         },
         \"target\": {
-            \"git_http_url\": \"https://gitlab.instance.test/source-repo/project-name.git\",
+            \"git_http_url\": \"https://gitlab.instance.test/target-repo/project-name.git\",
+            \"homepage\": \"https://gitlab.instance.test/target-repo/project-name\",
             \"name\": \"project-name\"
         },
+        \"url\": \"https://gitlab.instance.test/target-repo/-/merge_requests/1\",
         \"cuirass\": {
             \"build\": {
                 \"packages\": [
@@ -135,16 +141,19 @@
     \"object_attributes\": {
         \"action\": \"open\",
         \"merge_status\": \"can_be_merged\",
-        \"iid\": \"1\",
+        \"iid\": 1,
         \"source_branch\": \"test-branch\",
         \"source\": {
             \"git_http_url\": \"https://gitlab.instance.test/source-repo/fork-name.git\",
+            \"homepage\": \"https://gitlab.instance.test/source-repo/project-name\",
             \"name\": \"test-project\"
         },
         \"target\": {
-            \"git_http_url\": \"https://gitlab.instance.test/source-repo/project-name.git\",
+            \"git_http_url\": \"https://gitlab.instance.test/target-repo/project-name.git\",
+            \"homepage\": \"https://gitlab.instance.test/target-repo/project-name\",
             \"name\": \"project-name\"
         },
+        \"url\": \"https://gitlab.instance.test/target-repo/-/merge_requests/1\",
         \"cuirass\": {
             \"name_prefix\": \"prefix\"
         }
@@ -160,7 +169,7 @@
     \"object_attributes\": {
         \"action\": \"open\",
         \"merge_status\": \"can_be_merged\",
-        \"iid\": \"2\",
+        \"iid\": 2,
         \"source_branch\": \"test-branch\",
         \"source\": {
             \"git_http_url\": \"https://gitlab.instance.test/source-repo/fork-name.git\",
@@ -168,10 +177,11 @@
             \"name\": \"test-project\"
         },
         \"target\": {
-            \"git_http_url\": \"https://gitlab.instance.test/source-repo/project-name.git\",
-            \"homepage\": \"https://gitlab.instance.test/source-repo/project-name\",
+            \"git_http_url\": \"https://gitlab.instance.test/target-repo/project-name.git\",
+            \"homepage\": \"https://gitlab.instance.test/target-repo/project-name\",
             \"name\": \"project-name\"
         },
+        \"url\": \"https://gitlab.instance.test/target-repo/-/merge_requests/2\",
         \"cuirass\": {
             \"period\": 25,
             \"priority\": 3,
@@ -201,7 +211,12 @@
             %default-channels))
     (priority %default-jobset-options-priority)
     (period %default-jobset-options-period)
-    (systems %default-jobset-options-systems))))
+    (systems %default-jobset-options-systems)
+    (properties '((forge-type . gitlab)
+                  (pull-request-url . "https://gitlab.instance.test/target-repo/-/merge_requests/1")
+                  (pull-request-number . 1)
+                  (pull-request-target-repository-name . project-name)
+                  (pull-request-target-repository-home-page . "https://gitlab.instance.test/target-repo/project-name"))))))
 
 (test-assert "custom-json"
   (specifications=?
@@ -221,7 +236,12 @@
     (priority 3)
     (period 25)
     (systems (list "x86_64-linux"
-                   "aarch64-linux")))))
+                   "aarch64-linux"))
+    (properties '((forge-type . gitlab)
+                  (pull-request-url . "https://gitlab.instance.test/target-repo/-/merge_requests/2")
+                  (pull-request-number . 2)
+                  (pull-request-target-repository-name . project-name)
+                  (pull-request-target-repository-home-page . "https://gitlab.instance.test/target-repo/project-name"))))))
 
 (test-assert "custom-json-multiple-packages"
   (specifications=?
@@ -240,7 +260,12 @@
             %default-channels))
     (priority %default-jobset-options-priority)
     (period %default-jobset-options-period)
-    (systems %default-jobset-options-systems))))
+    (systems %default-jobset-options-systems)
+    (properties '((forge-type . gitlab)
+                  (pull-request-url . "https://gitlab.instance.test/target-repo/-/merge_requests/1")
+                  (pull-request-number . 1)
+                  (pull-request-target-repository-name . project-name)
+                  (pull-request-target-repository-home-page . "https://gitlab.instance.test/target-repo/project-name"))))))
 
 (test-assert "custom-json-name-prefix"
   (specifications=?
@@ -259,7 +284,12 @@
             %default-channels))
     (priority %default-jobset-options-priority)
     (period %default-jobset-options-period)
-    (systems %default-jobset-options-systems))))
+    (systems %default-jobset-options-systems)
+    (properties '((forge-type . gitlab)
+                  (pull-request-url . "https://gitlab.instance.test/target-repo/-/merge_requests/1")
+                  (pull-request-number . 1)
+                  (pull-request-target-repository-name . project-name)
+                  (pull-request-target-repository-home-page . "https://gitlab.instance.test/target-repo/project-name"))))))
 
 (test-assert "custom-json-build-all"
   (specifications=?
@@ -279,4 +309,9 @@
     (priority 3)
     (period 25)
     (systems (list "x86_64-linux"
-                   "aarch64-linux")))))
+                   "aarch64-linux"))
+    (properties '((forge-type . gitlab)
+                  (pull-request-url . "https://gitlab.instance.test/target-repo/-/merge_requests/2")
+                  (pull-request-number . 2)
+                  (pull-request-target-repository-name . project-name)
+                  (pull-request-target-repository-home-page . "https://gitlab.instance.test/target-repo/project-name"))))))

base-commit: 774113d13bf6df5bc5d8c5b409ad51add91f4013
-- 
2.46.0





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-26 17:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-26 14:57 [bug#75118] [PATCH Cuirass] tests: Test properties in specifications Romain GARBAGE
2024-12-26 17:57 ` bug#75118: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).