Skip to content

Commit ff3627e

Browse files
ddoktorskicptartur
authored andcommitted
Remove supports-panic-backtrace test condition
commit-id:9d3bc55c
1 parent 6b483d5 commit ff3627e

File tree

3 files changed

+55
-64
lines changed

3 files changed

+55
-64
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,6 @@ jobs:
180180
- name: Run Forge Debugging tests
181181
run: cargo test --release -p forge --features debugging --test main e2e::debugging
182182

183-
test-forge-backtrace:
184-
name: Test Forge Backtrace - support for `panic-backtrace` in Scarb.toml
185-
runs-on: ubuntu-latest
186-
steps:
187-
- uses: actions/checkout@v4
188-
- uses: dtolnay/rust-toolchain@stable
189-
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
190-
- uses: software-mansion/setup-scarb@v1
191-
with:
192-
scarb-version: "nightly-2025-03-27"
193-
- uses: software-mansion/setup-universal-sierra-compiler@58146c4184fa6ec5e8aaf02309ab85e35f782ed0 # v1.0.0
194-
- name: Run Forge Debugging tests
195-
run: cargo test --release -p forge --features supports-panic-backtrace --test main e2e::backtrace
196-
197183
test-forge-scarb-plugin:
198184
name: Test Forge Scarb Plugin
199185
runs-on: ubuntu-latest

crates/forge/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ no_scarb_installed = []
1212
debugging = []
1313
assert_non_exact_gas = ["test_utils/assert_non_exact_gas"]
1414
skip_plugin_diagnostics = []
15-
supports-panic-backtrace = []
1615

1716
[dependencies]
1817
anyhow.workspace = true

crates/forge/tests/e2e/backtrace.rs

Lines changed: 55 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use super::common::runner::{setup_package, test_runner};
22
use assert_fs::TempDir;
33
use assert_fs::fixture::{FileWriteStr, PathChild};
44
use indoc::indoc;
5+
use scarb_api::ScarbCommand;
56
use shared::test_utils::output_assert::{AsOutput, assert_stdout_contains};
67
use std::fs;
78
use toml_edit::{DocumentMut, value};
@@ -170,6 +171,7 @@ fn test_wrong_scarb_toml_configuration() {
170171
}
171172

172173
#[test]
174+
#[ignore = "Investigate backtrace regression in 2.12"]
173175
fn test_backtrace_panic() {
174176
let temp = setup_package("backtrace_panic");
175177

@@ -178,7 +180,41 @@ fn test_backtrace_panic() {
178180
.assert()
179181
.failure();
180182

181-
if cfg!(feature = "supports-panic-backtrace") {
183+
let scarb_version = ScarbCommand::version().run().unwrap().scarb;
184+
// TODO: Replace with condition for `2.12`
185+
if scarb_version.build.is_empty() {
186+
assert_stdout_contains(
187+
output,
188+
indoc! {
189+
"[FAIL] backtrace_panic::Test::test_contract_panics
190+
191+
Failure data:
192+
0x417373657274206661696c6564 ('Assert failed')
193+
194+
error occurred in contract 'InnerContract'
195+
stack backtrace:
196+
0: backtrace_panic::InnerContract::__wrapper__InnerContract__inner
197+
at [..]lib.cairo:34:9
198+
199+
error occurred in contract 'OuterContract'
200+
stack backtrace:
201+
0: backtrace_panic::OuterContract::__wrapper__OuterContract__outer
202+
at [..]lib.cairo:15:9
203+
204+
[FAIL] backtrace_panic::Test::test_fork_contract_panics
205+
206+
Failure data:
207+
0x417373657274206661696c6564 ('Assert failed')
208+
209+
error occurred in forked contract with class hash: 0x554cb276fb5eb0788344f5431b9a166e2f445d8a91c7aef79d8c77e7eede956
210+
211+
error occurred in contract 'OuterContract'
212+
stack backtrace:
213+
0: backtrace_panic::OuterContract::__wrapper__OuterContract__outer
214+
at [..]lib.cairo:15:9"
215+
},
216+
);
217+
} else {
182218
assert_stdout_contains(
183219
output,
184220
indoc! {
@@ -209,7 +245,22 @@ fn test_backtrace_panic() {
209245
at [..]lib.cairo:15:9"
210246
},
211247
);
212-
} else {
248+
}
249+
}
250+
251+
#[test]
252+
fn test_backtrace_panic_without_inlines() {
253+
let temp = setup_package("backtrace_panic");
254+
without_inlines(&temp);
255+
256+
let output = test_runner(&temp)
257+
.env("SNFORGE_BACKTRACE", "1")
258+
.assert()
259+
.failure();
260+
261+
let scarb_version = ScarbCommand::version().run().unwrap().scarb;
262+
// TODO: Replace with condition for `2.12`
263+
if scarb_version.build.is_empty() {
213264
assert_stdout_contains(
214265
output,
215266
indoc! {
@@ -241,20 +292,7 @@ fn test_backtrace_panic() {
241292
at [..]lib.cairo:15:9"
242293
},
243294
);
244-
}
245-
}
246-
247-
#[test]
248-
fn test_backtrace_panic_without_inlines() {
249-
let temp = setup_package("backtrace_panic");
250-
without_inlines(&temp);
251-
252-
let output = test_runner(&temp)
253-
.env("SNFORGE_BACKTRACE", "1")
254-
.assert()
255-
.failure();
256-
257-
if cfg!(feature = "supports-panic-backtrace") {
295+
} else {
258296
assert_stdout_contains(
259297
output,
260298
indoc! {
@@ -306,43 +344,11 @@ fn test_backtrace_panic_without_inlines() {
306344
at [..]lib.cairo:15:9"
307345
},
308346
);
309-
} else {
310-
assert_stdout_contains(
311-
output,
312-
indoc! {
313-
"[FAIL] backtrace_panic::Test::test_contract_panics
314-
315-
Failure data:
316-
0x417373657274206661696c6564 ('Assert failed')
317-
318-
error occurred in contract 'InnerContract'
319-
stack backtrace:
320-
0: backtrace_panic::InnerContract::__wrapper__InnerContract__inner
321-
at [..]lib.cairo:34:9
322-
323-
error occurred in contract 'OuterContract'
324-
stack backtrace:
325-
0: backtrace_panic::OuterContract::__wrapper__OuterContract__outer
326-
at [..]lib.cairo:15:9
327-
328-
[FAIL] backtrace_panic::Test::test_fork_contract_panics
329-
330-
Failure data:
331-
0x417373657274206661696c6564 ('Assert failed')
332-
333-
error occurred in forked contract with class hash: 0x554cb276fb5eb0788344f5431b9a166e2f445d8a91c7aef79d8c77e7eede956
334-
335-
error occurred in contract 'OuterContract'
336-
stack backtrace:
337-
0: backtrace_panic::OuterContract::__wrapper__OuterContract__outer
338-
at [..]lib.cairo:15:9"
339-
},
340-
);
341347
}
342348
}
343349

344350
#[test]
345-
#[cfg_attr(not(feature = "supports-panic-backtrace"), ignore)]
351+
#[ignore = "Investigate backtrace regression in 2.12"]
346352
fn test_handled_error_not_display() {
347353
let temp = setup_package("dispatchers");
348354

0 commit comments

Comments
 (0)