MCPcopy Create free account
hub / github.com/apache/datafusion / test_backtrace_output

Function test_backtrace_output

datafusion-cli/tests/cli_integration.rs:425–441  ·  view source on GitHub ↗
(#[case] query: &str)

Source from the content-addressed store, hash-verified

423#[case("SELECT CAST('not_a_number' AS INTEGER);")]
424#[cfg(feature = "backtrace")]
425fn test_backtrace_output(#[case] query: &str) {
426 let mut cmd = cli();
427 // Use a command that will cause an error and trigger backtrace
428 cmd.args(["--command", query, "-q"])
429 .env("RUST_BACKTRACE", "1"); // Enable backtrace
430
431 let output = cmd.output().expect("Failed to execute command");
432 let stdout = String::from_utf8_lossy(&output.stdout);
433 let stderr = String::from_utf8_lossy(&output.stderr);
434 let combined_output = format!("{stdout}{stderr}");
435
436 // Assert that the output includes literal 'backtrace'
437 assert!(
438 combined_output.to_lowercase().contains("backtrace"),
439 "Expected output to contain 'backtrace', but got stdout: '{stdout}' stderr: '{stderr}'"
440 );
441}
442
443#[tokio::test]
444async fn test_s3_url_fallback() {

Callers

nothing calls this directly

Calls 2

cliFunction · 0.70
argsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…