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 display_default_settings is failing on 32 bits archs #10359

Closed
raspbeguy opened this issue Mar 12, 2024 · 1 comment · Fixed by #10370
Closed

Test display_default_settings is failing on 32 bits archs #10359

raspbeguy opened this issue Mar 12, 2024 · 1 comment · Fixed by #10370
Assignees
Labels
bug Something isn't working testing Related to testing Ruff itself

Comments

@raspbeguy
Copy link

Hi,

I'm trying to fix Alpine's packages for ruff which is broken on 32 bits architectures because of failing test display_default_settings.

Here is the output on x86:

---- display_default_settings stdout ----
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot file: crates/ruff/tests/snapshots/show_settings__display_default_settings.snap
Snapshot: display_default_settings
Source: crates/ruff/tests/show_settings.rs:30
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
program: ruff
args:
  - check
  - "--show-settings"
  - unformatted.py
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────
  230   230 │ 	gettext,
  231   231 │ 	ngettext,
  232   232 │ ]
  233   233 │ linter.flake8_implicit_str_concat.allow_multiline = true
  234       │-linter.flake8_import_conventions.aliases = {"matplotlib": "mpl", "matplotlib.pyplot": "plt", "pandas": "pd", "seaborn": "sns", "tensorflow": "tf", "networkx": "nx", "plotly.express": "px", "polars": "pl", "numpy": "np", "panel": "pn", "pyarrow": "pa", "altair": "alt", "tkinter": "tk", "holoviews": "hv"}
        234 │+linter.flake8_import_conventions.aliases = {"pandas": "pd", "panel": "pn", "plotly.express": "px", "seaborn": "sns", "tensorflow": "tf", "numpy": "np", "matplotlib": "mpl", "matplotlib.pyplot": "plt", "tkinter": "tk", "polars": "pl", "pyarrow": "pa", "networkx": "nx", "altair": "alt", "holoviews": "hv"}
  235   235 │ linter.flake8_import_conventions.banned_aliases = {}
  236   236 │ linter.flake8_import_conventions.banned_from = []
  237   237 │ linter.flake8_pytest_style.fixture_parentheses = true
  238   238 │ linter.flake8_pytest_style.parametrize_names_type = tuple
────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────
To update snapshots run `cargo insta review`
Stopped on the first failure. Run `cargo insta test` to run all snapshots.
thread 'display_default_settings' panicked at /home/alpine/.cargo/registry/src/index.crates.io-1cd66030c949c28d/insta-1.35.1/src/runtime.rs:563:9:
snapshot assertion for 'display_default_settings' failed in line 30
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@charliermarsh
Copy link
Member

Looks like the test is reliant on the order, can fix.

@charliermarsh charliermarsh self-assigned this Mar 12, 2024
@charliermarsh charliermarsh added the bug Something isn't working label Mar 12, 2024
@zanieb zanieb added the testing Related to testing Ruff itself label Mar 12, 2024
charliermarsh added a commit that referenced this issue Mar 12, 2024
## Summary

We had a report of a test failure on a specific architecture, and
looking into it, I think the test assumes that the hash keys are
iterated in a specific order. This PR thus adds a variant to our
settings display macro specifically for maps and sets. Like `CacheKey`,
it sorts the keys when printing.

Closes #10359.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working testing Related to testing Ruff itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants