Skip to content

Commit

Permalink
Enable CI logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Sep 13, 2024
1 parent 3260a93 commit 349efe7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions crates/agones/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ pub fn gameserver_address(gs: &GameServer) -> String {
// Useful for determining why something is failing in CI without having to run a cluster.
// Requires quilkin::test::enable_log("agones=debug"); to enable debug logging within
// the test
pub async fn debug_pods(client: &Client, labels: String) {
pub async fn debug_pods(client: &Client, labels: Option<String>) {
debug!(labels, "🪓 Debug output for Selector");
let pods: Api<Pod> = client.namespaced_api();
let events: Api<Event> = client.namespaced_api();
Expand All @@ -698,7 +698,7 @@ pub async fn debug_pods(client: &Client, labels: String) {
let event_list = events.list(&params).await.unwrap();
let pod_list = pods
.list(&ListParams {
label_selector: Some(labels),
label_selector: labels,
..Default::default()
})
.await
Expand Down
6 changes: 3 additions & 3 deletions crates/agones/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ mod tests {
.await
.is_err()
{
debug_pods(&client, format!("role={PROXY_DEPLOYMENT}")).await;
debug_pods(&client, Some(format!("role={PROXY_DEPLOYMENT}"))).await;
panic!("Quilkin proxy deployment should be ready");
}

Expand Down Expand Up @@ -157,8 +157,8 @@ mod tests {
}
}
if !failed {
debug_pods(&client, format!("role={PROXY_DEPLOYMENT}")).await;
debug_pods(&client, "role=xds".into()).await;
debug_pods(&client, Some(format!("role={PROXY_DEPLOYMENT}"))).await;
debug_pods(&client, Some("role=xds".into())).await;
}
assert!(failed, "Packet should have failed");

Expand Down
11 changes: 6 additions & 5 deletions crates/agones/src/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ mod tests {
/// for this test, we should only run Agones integration test in a serial manner, since they
/// could easily collide with each other.
async fn agones_token_router() {
quilkin::test::enable_log("agones=debug");

run_test(true, true, true, 0).await;
run_test(true, true, false, 1).await;
run_test(true, false, true, 2).await;
Expand Down Expand Up @@ -121,7 +123,7 @@ mod tests {
.await
.is_err()
{
debug_pods(&client, format!("role={relay_proxy_name}")).await;
debug_pods(&client, None).await;
panic!("Quilkin proxy deployment should be ready");
}

Expand Down Expand Up @@ -169,8 +171,7 @@ mod tests {
}
}
if !failed {
debug_pods(&client, format!("role={relay_proxy_name}")).await;
debug_pods(&client, "role=xds".into()).await;
debug_pods(&client, None).await;
}
assert!(failed, "Packet should have failed");

Expand Down Expand Up @@ -334,7 +335,7 @@ mod tests {
)
.await;
if result.is_err() {
debug_pods(client, "role=relay".into()).await;
debug_pods(client, Some("role=relay".into())).await;

panic!("Relay Deployment should be ready");
}
Expand Down Expand Up @@ -391,7 +392,7 @@ mod tests {
)
.await;
if result.is_err() {
debug_pods(client, "role=agent".into()).await;
debug_pods(client, Some("role=agent".into())).await;
panic!("Agent Deployment should be ready");
}
result.unwrap().expect("Should have an agent deployment");
Expand Down

0 comments on commit 349efe7

Please sign in to comment.