Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix creating package with snfoundry test runner #1843

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ddoktorski
Copy link

@ddoktorski ddoktorski commented Dec 11, 2024

Closes #1759

Note: Foundry change released in version 0.35.0

@ddoktorski ddoktorski marked this pull request as ready for review December 16, 2024 12:08
@ddoktorski ddoktorski requested a review from a team as a code owner December 16, 2024 12:08
#[ignore = "run this test by name"]
fn new_simple() {
fn new_simple(package_name: Option<&str>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test fails with (when run with cargo test --profile=ci --package scarb --test snforge_init new_simple -- --ignored):

running 2 tests
test new_simple::none_expects ... FAILED
test new_simple::some_simple_project_expects ... FAILED

failures:

---- new_simple::none_expects stdout ----
thread 'new_simple::none_expects' panicked at scarb/tests/snforge_init.rs:34:5:
assertion failed: t.child("tests").is_dir()

---- new_simple::some_simple_project_expects stdout ----
thread 'new_simple::some_simple_project_expects' panicked at scarb/tests/snforge_init.rs:34:5:
assertion failed: t.child("tests").is_dir()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    new_simple::none_expects
    new_simple::some_simple_project_expects

test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.58s

Note it's currently not run as part of our CI, it's only run once per day from main and during release ->

snforge-init:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: foundry-rs/setup-snfoundry@v3
- run: cargo test --profile=ci --package scarb --test snforge_init new_simple -- --ignored

Would you mind adding it to the CI pipeline as well? 🙏 https://github.com/software-mansion/scarb/blob/main/.github/workflows/ci.yml

Copy link
Contributor

Choose a reason for hiding this comment

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

This should be fixed by the next foundry release, right?

Copy link
Author

Choose a reason for hiding this comment

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

This test fails with (when run with cargo test --profile=ci --package scarb --test snforge_init new_simple -- --ignored)

Are you sure you have the latest snfoundry version installed (0.35.0)? It was released yesterday

Would you mind adding it to the CI pipeline as well?

Can we simply remove #[ignore] so it can be run with all other tests?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we simply remove #[ignore] so it can be run with all other tests?

The other tests run without Foundry installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scarb init with Starknet Foundry doesn't work if directory name is differnt
2 participants