Fixup comment formatting
This commit is contained in:
parent
ccf59f844b
commit
c3d17d9e25
|
@ -98,9 +98,8 @@ fn result_to_comment(result: &BuildResult) -> String {
|
|||
Some(ref s) => s,
|
||||
};
|
||||
|
||||
reply.push(format!(
|
||||
"<!--REQUEST_ID={}-->{} on {}{}",
|
||||
result.request_id,
|
||||
reply.push(format!("<!--REQUEST_ID={}-->", result.request_id));
|
||||
reply.push(format!("{} on {}{}",
|
||||
(match *status {
|
||||
BuildStatus::Skipped => "No attempt".into(),
|
||||
BuildStatus::Success => "Success".into(),
|
||||
|
@ -206,7 +205,8 @@ mod tests {
|
|||
|
||||
assert_eq!(
|
||||
&result_to_comment(&result),
|
||||
"<!--REQUEST_ID=bogus-request-id-->Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
|
||||
"<!--REQUEST_ID=bogus-request-id-->
|
||||
Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
|
||||
|
||||
Attempted: foo
|
||||
|
||||
|
@ -269,7 +269,8 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29
|
|||
|
||||
assert_eq!(
|
||||
&result_to_comment(&result),
|
||||
"<!--REQUEST_ID=bogus-request-id-->Failure on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
|
||||
"<!--REQUEST_ID=bogus-request-id-->
|
||||
Failure on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
|
||||
|
||||
Attempted: foo
|
||||
|
||||
|
@ -329,7 +330,8 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29
|
|||
|
||||
assert_eq!(
|
||||
&result_to_comment(&result),
|
||||
"<!--REQUEST_ID=bogus-request-id-->Timed out, unknown build status on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
|
||||
"<!--REQUEST_ID=bogus-request-id-->
|
||||
Timed out, unknown build status on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
|
||||
|
||||
Attempted: foo
|
||||
|
||||
|
@ -389,7 +391,8 @@ error: build of '/nix/store/l1limh50lx2cx45yb2gqpv7k8xl1mik2-gdb-8.1.drv' failed
|
|||
|
||||
assert_eq!(
|
||||
&result_to_comment(&result),
|
||||
"<!--REQUEST_ID=bogus-request-id-->Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
|
||||
"<!--REQUEST_ID=bogus-request-id-->
|
||||
Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
|
||||
|
||||
<details><summary>Partial log (click to expand)</summary><p>
|
||||
|
||||
|
@ -448,7 +451,8 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29
|
|||
|
||||
assert_eq!(
|
||||
&result_to_comment(&result),
|
||||
"<!--REQUEST_ID=bogus-request-id-->Failure on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
|
||||
"<!--REQUEST_ID=bogus-request-id-->
|
||||
Failure on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
|
||||
|
||||
<details><summary>Partial log (click to expand)</summary><p>
|
||||
|
||||
|
@ -496,7 +500,8 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29
|
|||
|
||||
assert_eq!(
|
||||
&result_to_comment(&result),
|
||||
"<!--REQUEST_ID=bogus-request-id-->No attempt on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=foo)
|
||||
"<!--REQUEST_ID=bogus-request-id-->
|
||||
No attempt on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=foo)
|
||||
|
||||
The following builds were skipped because they don't evaluate on x86_64-linux: not-attempted
|
||||
|
||||
|
@ -537,7 +542,8 @@ foo
|
|||
|
||||
assert_eq!(
|
||||
&result_to_comment(&result),
|
||||
"<!--REQUEST_ID=bogus-request-id-->No attempt on x86_64-linux
|
||||
"<!--REQUEST_ID=bogus-request-id-->
|
||||
No attempt on x86_64-linux
|
||||
|
||||
The following builds were skipped because they don't evaluate on x86_64-linux: not-attempted
|
||||
|
||||
|
@ -583,7 +589,8 @@ No partial log is available.
|
|||
|
||||
assert_eq!(
|
||||
&result_to_comment(&result),
|
||||
"<!--REQUEST_ID=bogus-request-id-->Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
|
||||
"<!--REQUEST_ID=bogus-request-id-->
|
||||
Success on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=neatattemptid)
|
||||
|
||||
Attempted: foo
|
||||
|
||||
|
|
Loading…
Reference in a new issue