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

Test failure on Arch Linux in a clean chroot #23

Closed
orhun opened this issue Aug 26, 2024 · 3 comments · Fixed by #29
Closed

Test failure on Arch Linux in a clean chroot #23

orhun opened this issue Aug 26, 2024 · 3 comments · Fixed by #29
Assignees

Comments

@orhun
Copy link
Contributor

orhun commented Aug 26, 2024

Hey, I got the following error while building the AUR package from the latest version:

failures:

---- backend::filter::test::filters_combined_work stdout ----
thread 'backend::filter::test::filters_combined_work' panicked at src/backend/filter.rs:349:34:
an error ocurred when setting preferred language
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    backend::filter::test::filters_combined_work

Also I get similar failures in other tests:

---- view::widgets::filter_widget::state::test::language_filter_list_works stdout ----
thread 'view::widgets::filter_widget::state::test::language_filter_list_works' panicked at src/backend/filter.rs:349:34:
an error ocurred when setting preferred language

---- view::widgets::filter_widget::state::test::filter_state stdout ----
thread 'view::widgets::filter_widget::state::test::filter_state' panicked at src/backend/filter.rs:349:34:
an error ocurred when setting preferred language
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- view::pages::search::test::search_page_key_events stdout ----
thread 'view::pages::search::test::search_page_key_events' panicked at src/backend/filter.rs:349:34:
an error ocurred when setting preferred language

---- view::pages::manga::test::handle_key_events stdout ----
thread 'view::pages::manga::test::handle_key_events' panicked at src/backend/filter.rs:349:34:
an error ocurred when setting preferred language


failures:
    view::pages::manga::test::handle_key_events
    view::pages::search::test::search_page_key_events
    view::widgets::filter_widget::state::test::filter_state
    view::widgets::filter_widget::state::test::language_filter_list_works

I'm not sure why it's failing but I thought it'd be best to report it here. Any ideas?

In the meantime I skipped the backend tests as a workaround.

@josueBarretogit josueBarretogit self-assigned this Aug 26, 2024
@josueBarretogit
Copy link
Owner

I'm using global variables with once_cell so this error are because the same variable is being set multiple times, I run cargo test -- --test-threads=1 and it works, of course this isn't correct seems like an anti-pattern so Im planning on using rstests and of course improve / add missing tests

@orhun
Copy link
Contributor Author

orhun commented Aug 26, 2024

Thanks for the tip! I used --test-threads=1 and re-pushed the package.

of course this isn't correct seems like an anti-pattern so Im planning on using rstests and of course improve / add missing tests

Yeah, definitely!

@josueBarretogit josueBarretogit linked a pull request Aug 28, 2024 that will close this issue
@josueBarretogit
Copy link
Owner

josueBarretogit commented Sep 26, 2024

Now running cargo test should be fine, there are some ignored tests they make a ./tests_results folder to test download functions and can be run with cargo test -- --ignored

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 a pull request may close this issue.

2 participants