Skip to content

Commit

Permalink
chore(tests) enable rust backtrace
Browse files Browse the repository at this point in the history
Add `env RUST_BACKTRACE=full;` to nginx.conf when
`---disable_rust_backtrace` is not defined in a test block.
  • Loading branch information
casimiro committed Jul 28, 2023
1 parent 5fa024f commit f3258a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions t/03-proxy_wasm/003-on_tick.t
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ ok
=== TEST 5: proxy_wasm - multiple ticks
--- disable_rust_backtrace
'daemon off' must be set to check exit_code is 2
Valgrind mode already writes 'daemon off'
HUP mode does not catch the worker exit_code
Expand Down
11 changes: 8 additions & 3 deletions t/TestWasm.pm
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,15 @@ add_block_preprocessor(sub {
# --- env variables

my $main_config = $block->main_config || '';
my $disable_rust_backtrace = $block->disable_rust_backtrace;

$block->set_value("main_config",
"env WASMTIME_BACKTRACE_DETAILS=1;\n"
. $main_config);
my @env_vars = ("env WASMTIME_BACKTRACE_DETAILS=1");
if (!defined $disable_rust_backtrace) {
push @env_vars, "env RUST_BACKTRACE=full";
}
my $env_section = join(";\n", @env_vars) . ";\n\n";

$block->set_value("main_config", $env_section . $main_config);

# --- load_nginx_modules: ngx_http_echo_module

Expand Down

0 comments on commit f3258a0

Please sign in to comment.