From 7b47cb43c13b495d61cc577dfc8f6050d1f9d0d2 Mon Sep 17 00:00:00 2001 From: oliverpool Date: Wed, 22 May 2024 10:09:32 +0200 Subject: [PATCH] test: sourcehut_builds trigger --- services/webhook/sourcehut/builds_test.go | 19 +++++++++++++----- .../01/16b5e2279b70e5f5b98240e8896331248f4463 | Bin 54 -> 0 bytes .../56/f276169b9766f805e5198fe7fb6698153fdb03 | 1 - .../99/fb389b232e5497f0dcdb1c1065eac1d10d3794 | Bin 0 -> 57 bytes .../a5/4082fdb8e55055382725f10a81bb4dc2b13029 | 4 ++++ .../b0/404943256a1f5a50c3726f4378756b4c1e5704 | Bin 0 -> 160 bytes .../bd/d74dba3f34542e480d56c2a91c9e2463180d3c | Bin 130 -> 0 bytes .../c2/30778a03511f546f532e79c8c14917c260e750 | Bin 84 -> 0 bytes .../c9/fa8be8c6f230e9529f8e546a3e6a354cbaf313 | Bin 56 -> 0 bytes .../cb/80b2628b69c86b6baea464e5f9fc28405fde4b | 1 - .../testdata/repo.git/refs/heads/main | 2 +- 11 files changed, 19 insertions(+), 8 deletions(-) delete mode 100644 services/webhook/sourcehut/testdata/repo.git/objects/01/16b5e2279b70e5f5b98240e8896331248f4463 delete mode 100644 services/webhook/sourcehut/testdata/repo.git/objects/56/f276169b9766f805e5198fe7fb6698153fdb03 create mode 100644 services/webhook/sourcehut/testdata/repo.git/objects/99/fb389b232e5497f0dcdb1c1065eac1d10d3794 create mode 100644 services/webhook/sourcehut/testdata/repo.git/objects/a5/4082fdb8e55055382725f10a81bb4dc2b13029 create mode 100644 services/webhook/sourcehut/testdata/repo.git/objects/b0/404943256a1f5a50c3726f4378756b4c1e5704 delete mode 100644 services/webhook/sourcehut/testdata/repo.git/objects/bd/d74dba3f34542e480d56c2a91c9e2463180d3c delete mode 100644 services/webhook/sourcehut/testdata/repo.git/objects/c2/30778a03511f546f532e79c8c14917c260e750 delete mode 100644 services/webhook/sourcehut/testdata/repo.git/objects/c9/fa8be8c6f230e9529f8e546a3e6a354cbaf313 delete mode 100644 services/webhook/sourcehut/testdata/repo.git/objects/cb/80b2628b69c86b6baea464e5f9fc28405fde4b diff --git a/services/webhook/sourcehut/builds_test.go b/services/webhook/sourcehut/builds_test.go index 9ab018df72..3818568f78 100644 --- a/services/webhook/sourcehut/builds_test.go +++ b/services/webhook/sourcehut/builds_test.go @@ -175,7 +175,7 @@ environment: p := &api.PushPayload{ Ref: "refs/heads/main", HeadCommit: &api.PayloadCommit{ - ID: "69b217caa89166a02b8cd368b64fb83a44720e14", + ID: "b0404943256a1f5a50c3726f4378756b4c1e5704", Message: "replace simple with complex", }, Repo: repo, @@ -187,15 +187,22 @@ environment: pl, err := pc.Push(p) require.NoError(t, err) - assert.Equal(t, buildsVariables{ - Manifest: `image: archlinux + assert.Equal(t, `image: archlinux packages: - nodejs - npm - rsync sources: - - http://localhost:3000/testdata/repo.git#69b217caa89166a02b8cd368b64fb83a44720e14 + - http://localhost:3000/testdata/repo.git#b0404943256a1f5a50c3726f4378756b4c1e5704 tasks: [] +triggers: + - condition: failure + action: email + to: Jim Jimson + # report back the status + - condition: always + action: webhook + url: https://hook.example.org environment: BUILD_SUBMITTER: forgejo BUILD_SUBMITTER_URL: https://example.forgejo.org/ @@ -203,7 +210,9 @@ environment: deploy: synapse@synapse-bt.org secrets: - 7ebab768-e5e4-4c9d-ba57-ec41a72c5665 -`, +`, pl.Variables.Manifest) + assert.Equal(t, buildsVariables{ + Manifest: pl.Variables.Manifest, // the manifest correctness is checked above, for nicer diff on error Note: "replace simple with complex", Tags: []string{"testdata/repo", "branch/main", "complex.yaml"}, Secrets: false, diff --git a/services/webhook/sourcehut/testdata/repo.git/objects/01/16b5e2279b70e5f5b98240e8896331248f4463 b/services/webhook/sourcehut/testdata/repo.git/objects/01/16b5e2279b70e5f5b98240e8896331248f4463 deleted file mode 100644 index c06eb842befe81109993560ca4832df776981b41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 54 zcmV-60LlM&0V^p=O;s?qU@$Z=Ff%bxD9+3+$Vt_!%*|mqWKiD494H@>AFNk-;-IJa Mp@ioF08HTz`Z}E#b^rhX diff --git a/services/webhook/sourcehut/testdata/repo.git/objects/56/f276169b9766f805e5198fe7fb6698153fdb03 b/services/webhook/sourcehut/testdata/repo.git/objects/56/f276169b9766f805e5198fe7fb6698153fdb03 deleted file mode 100644 index dca1d23ce9..0000000000 --- a/services/webhook/sourcehut/testdata/repo.git/objects/56/f276169b9766f805e5198fe7fb6698153fdb03 +++ /dev/null @@ -1 +0,0 @@ -xNKj0ZxBɶzQ[FQ?"=A3Ѳmk#*@L3&)'D$#Β 搊Ѽ,#/8OvzIN<u'[;J~{#'e;.x輋#[K[kyASq\DAkƵ؝~PkVO \ No newline at end of file diff --git a/services/webhook/sourcehut/testdata/repo.git/objects/99/fb389b232e5497f0dcdb1c1065eac1d10d3794 b/services/webhook/sourcehut/testdata/repo.git/objects/99/fb389b232e5497f0dcdb1c1065eac1d10d3794 new file mode 100644 index 0000000000000000000000000000000000000000..43dd8855100f4bdd80f4b317cab81831fef3c5a0 GIT binary patch literal 57 zcmV-90LK4#0V^p=O;s>4U@$Z=Ff%bxNY2kK$Vsixt4z$zVOZ+W^moV8fKUr{)sI|_ PyL}IBG|&V9h1U_+m5LcT literal 0 HcmV?d00001 diff --git a/services/webhook/sourcehut/testdata/repo.git/objects/a5/4082fdb8e55055382725f10a81bb4dc2b13029 b/services/webhook/sourcehut/testdata/repo.git/objects/a5/4082fdb8e55055382725f10a81bb4dc2b13029 new file mode 100644 index 0000000000..071f79e851 --- /dev/null +++ b/services/webhook/sourcehut/testdata/repo.git/objects/a5/4082fdb8e55055382725f10a81bb4dc2b13029 @@ -0,0 +1,4 @@ +xUn0 wk +l4z0 %fm~@Dc<(ŝ% m]NjDR +A閌9Xxu{;Nȅ4(Gy:QO?/9 lh|0cΌl8*$?dԻ**>7ȖXomUJItmKqrh8>)ҺڋF,77,8 {:0zZfya) +5 ʴ狉7ΑLܯ)z yivoQ78J}臤 \ No newline at end of file diff --git a/services/webhook/sourcehut/testdata/repo.git/objects/b0/404943256a1f5a50c3726f4378756b4c1e5704 b/services/webhook/sourcehut/testdata/repo.git/objects/b0/404943256a1f5a50c3726f4378756b4c1e5704 new file mode 100644 index 0000000000000000000000000000000000000000..a2cff639dcae5bff557b668be4c8ef35dfcd7fab GIT binary patch literal 160 zcmV;R0AK%j0gaAZ3PK?eK>KzT{s%FmbA3QWTN!n{36&SI*588`(C2}3;N*V0wW*Dv z-5er1#+q!1$yg%`MPH%hk}xB{u^_%Sbi=zeWa8C&mHeO%i-f4IpwY?aHQj*~`@&bkFC>OB|$mA{8m{%;quzgBT6 OdXBcPGSmxv?ME%KQc1f2 literal 0 HcmV?d00001 diff --git a/services/webhook/sourcehut/testdata/repo.git/objects/bd/d74dba3f34542e480d56c2a91c9e2463180d3c b/services/webhook/sourcehut/testdata/repo.git/objects/bd/d74dba3f34542e480d56c2a91c9e2463180d3c deleted file mode 100644 index 639f5c4784986454b8ae9dbd63253cd964128acc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 130 zcmV-|0Db>>0hNtQ3IZ_@1zqP9y%(fA|A2@q?~%-OG-8ZoB6xg9J%PJdi>f!ZTFU@( zelt2VAdyXmrF0=VWRpz_UTS3TgH?*8_E~GIM0}1*>u_rQ%-06{{2NDp#rnAMZpFiz kB}v99jj%1eb qjMSW*d@F?-unH6BhiZ6XT* diff --git a/services/webhook/sourcehut/testdata/repo.git/objects/c9/fa8be8c6f230e9529f8e546a3e6a354cbaf313 b/services/webhook/sourcehut/testdata/repo.git/objects/c9/fa8be8c6f230e9529f8e546a3e6a354cbaf313 deleted file mode 100644 index 291f0a422cd47a15406fcc943090863e297f0ce2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 56 zcmV-80LTA$0V^p=O;s?qWH2-^Ff%bxNY2kK$VsixtH{k^xb&b+r@LYLF7LZVQ*spC Orw3kUUjP7qI}#?9i5IB= diff --git a/services/webhook/sourcehut/testdata/repo.git/objects/cb/80b2628b69c86b6baea464e5f9fc28405fde4b b/services/webhook/sourcehut/testdata/repo.git/objects/cb/80b2628b69c86b6baea464e5f9fc28405fde4b deleted file mode 100644 index 891ace4651..0000000000 --- a/services/webhook/sourcehut/testdata/repo.git/objects/cb/80b2628b69c86b6baea464e5f9fc28405fde4b +++ /dev/null @@ -1 +0,0 @@ -x=Kn0 D)`k@Pd{P2-AQ] YIesmKoD)8p gg44lFQF9˜V,[UΤ`~[iVڕ 4+(0Y)$"ԠlZ-e5wԦʸNY?V4&tC9=a ,P \ No newline at end of file diff --git a/services/webhook/sourcehut/testdata/repo.git/refs/heads/main b/services/webhook/sourcehut/testdata/repo.git/refs/heads/main index 4e693a7464..a7ab41949f 100644 --- a/services/webhook/sourcehut/testdata/repo.git/refs/heads/main +++ b/services/webhook/sourcehut/testdata/repo.git/refs/heads/main @@ -1 +1 @@ -69b217caa89166a02b8cd368b64fb83a44720e14 +b0404943256a1f5a50c3726f4378756b4c1e5704