fix: tests should create valid urls
All checks were successful
Test / build (map[name:nightly]) (push) Successful in 9m35s
Test / build (map[name:stable]) (push) Successful in 11m14s
Release Please / Release-plz (push) Successful in 15s
Release Please / Docker image (push) Successful in 2m26s

This commit is contained in:
Paul Campbell 2025-01-26 18:18:56 +00:00
parent b3b8c0ec90
commit 1ef76dd7be
2 changed files with 7 additions and 4 deletions

View file

@ -13,7 +13,8 @@ pub async fn status(
let repo_details = &github.repo_details;
let hostname = repo_details.forge.hostname();
let repo_path = &repo_details.repo_path;
let url = format!("https://api.{hostname}/repos/{repo_path}/commits/{commit}/statuses");
let url = format!("https://api.{hostname}.net/repos/{repo_path}/commits/{commit}/statuses");
tracing::debug!(?url, "get commit status");
let Ok(response) = github
.net
.get(url)

View file

@ -108,7 +108,7 @@ mod github {
macro_rules! status_tests{
($($name:ident: $value:expr, )*) => {
$(
#[tokio::test]
#[test_log::test(tokio::test)]
async fn $name() {
let (states, expected) = $value;
let repo_details = given::repo_details();
@ -557,8 +557,10 @@ mod github {
repo_details: &git::RepoDetails,
commit: &git::Commit,
) {
let url = a_commit_status_url(repo_details, commit);
tracing::debug!(?url, "mock request");
net.on()
.get(a_commit_status_url(repo_details, commit))
.get(url)
.respond(StatusCode::OK)
.body(
json!(states
@ -578,7 +580,7 @@ mod github {
) -> String {
let hostname = repo_details.forge.hostname();
let repo_path = &repo_details.repo_path;
format!("https://api.{hostname}/repos/{repo_path}/commits/{commit}/statuses")
format!("https://api.{hostname}.net/repos/{repo_path}/commits/{commit}/statuses")
}
pub fn a_webhook_auth() -> WebhookAuth {