2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/guix-cuirass.git synced 2024-12-29 11:40:16 +01:00

tests: Test properties in specifications.

* 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.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Romain GARBAGE 2024-12-26 15:57:34 +01:00 committed by Ludovic Courtès
parent f9c951d95d
commit e1a4675ec4
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 66 additions and 22 deletions

View file

@ -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))))

View file

@ -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"))))))

View file

@ -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"))))))