From: Romain GARBAGE <romain.garbage@inria.fr>
To: 75118@debbugs.gnu.org
Cc: ludovic.courtes@inria.fr, Romain GARBAGE <romain.garbage@inria.fr>
Subject: [bug#75118] [PATCH Cuirass] tests: Test properties in specifications.
Date: Thu, 26 Dec 2024 15:57:34 +0100 [thread overview]
Message-ID: <20241226145734.15331-1-romain.garbage@inria.fr> (raw)
* 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
next reply other threads:[~2024-12-26 14:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-26 14:57 Romain GARBAGE [this message]
2024-12-26 17:57 ` bug#75118: [PATCH Cuirass] tests: Test properties in specifications Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241226145734.15331-1-romain.garbage@inria.fr \
--to=romain.garbage@inria.fr \
--cc=75118@debbugs.gnu.org \
--cc=ludovic.courtes@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.