Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/actions/setup-tools/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ inputs:
description: 'Whether to setup scarb'
required: false
default: 'true'
scarb-version:
description: 'Optional: Scarb version to install. If not set, uses version from .tool-versions'
required: false
default: ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why default value isn't a proper scarb version? Perhaps we could use a minimal supported version here.

setup-usc:
description: 'Whether to setup universal-sierra-compiler'
required: false
Expand All @@ -24,6 +28,8 @@ runs:

- uses: software-mansion/setup-scarb@v1
if: ${{ inputs.setup-scarb == 'true' }}
with:
scarb-version: ${{ inputs.scarb-version }}

- uses: software-mansion/setup-universal-sierra-compiler@v1
if: ${{ inputs.setup-usc == 'true' }}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,16 @@ jobs:
- name: Run Data Transformer tests
run: cargo test --profile ci -p data-transformer

test-forge-oracles:
name: Test Oracles in Forge
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
with:
scarb-version: '2.13.1'
- run: cargo test --profile ci -p forge --features run_test_for_scarb_since_2_13 e2e::oracles

test-forge-scarb-plugin:
name: Test Forge Scarb Plugin
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions crates/forge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ no_scarb_installed = []
non_exact_gas_assertions = []
skip_test_for_only_latest_scarb = []
skip_test_for_scarb_since_2_11 = []
run_test_for_scarb_since_2_13 = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch version indeed matters in this case, as oracles don't work with 2.13.0:

Suggested change
run_test_for_scarb_since_2_13 = []
run_test_for_scarb_since_2_13_1 = []

test_for_multiple_scarb_versions = []
cairo-native = ["cheatnet/cairo-native", "scarb-api/cairo-native"]

Expand Down
15 changes: 4 additions & 11 deletions crates/forge/tests/e2e/oracles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@ use crate::e2e::common::runner::{
BASE_FILE_PATTERNS, Package, setup_package_with_file_patterns, test_runner,
};
use indoc::indoc;
use scarb_api::version::scarb_version;
use shared::test_utils::output_assert::assert_stdout_contains;

fn scarb_supports_oracles() -> bool {
scarb_version().unwrap().scarb >= semver::Version::parse("2.12.3+nightly-2025-10-21").unwrap()
}

#[cfg_attr(
not(feature = "run_test_for_scarb_since_2_13"),
ignore = "Skipping test because feature skip_test_for_scarb_2_13 enabled"
)]
#[test]
fn wasm() {
// TODO use feature here
if !scarb_supports_oracles() {
eprintln!("skipping because scarb does not fully support oracles");
return;
}

let temp = setup_package_with_file_patterns(
Package::Name("wasm_oracles".to_string()),
&[BASE_FILE_PATTERNS, &["*.wasm"]].concat(),
Expand Down
Loading