mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-30 17:03:57 +00:00
tests: k8s-job debug information
Log the output of "kubectl logs", to hopefully help understand test failures similar to: https://github.com/kata-containers/kata-containers/actions/runs/17709473340/job/50326984605?pr=11753 not ok 1 Run a job to completion (in test file k8s-job.bats, line 37) `kubectl logs "$pod_name" | grep "$pi_number"' failed Signed-off-by: Dan Mihai <dmihai@microsoft.com>
This commit is contained in:
committed by
Fabiano Fidêncio
parent
8854e69e28
commit
e2992b51ad
@@ -19,6 +19,11 @@ setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "Run a job to completion" {
|
@test "Run a job to completion" {
|
||||||
|
local cmd
|
||||||
|
local logs
|
||||||
|
local pi_number
|
||||||
|
local pod_name
|
||||||
|
|
||||||
# Create job
|
# Create job
|
||||||
kubectl apply -f "${yaml_file}"
|
kubectl apply -f "${yaml_file}"
|
||||||
|
|
||||||
@@ -33,8 +38,12 @@ setup() {
|
|||||||
waitForProcess "$wait_time" "$sleep_time" "$cmd"
|
waitForProcess "$wait_time" "$sleep_time" "$cmd"
|
||||||
|
|
||||||
# Verify the output of the pod
|
# Verify the output of the pod
|
||||||
|
bats_unbuffered_info "Getting logs for $pod_name"
|
||||||
|
logs=$(kubectl logs "$pod_name")
|
||||||
|
bats_unbuffered_info "Logs: $logs"
|
||||||
|
|
||||||
pi_number="3.14"
|
pi_number="3.14"
|
||||||
kubectl logs "$pod_name" | grep "$pi_number"
|
echo "$logs" | grep "$pi_number"
|
||||||
}
|
}
|
||||||
|
|
||||||
teardown() {
|
teardown() {
|
||||||
|
|||||||
Reference in New Issue
Block a user