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 fails downstream #9864

Closed
WhyNotHugo opened this issue Feb 6, 2024 · 7 comments · Fixed by #9866
Closed

Test display_default_settings fails downstream #9864

WhyNotHugo opened this issue Feb 6, 2024 · 7 comments · Fixed by #9866
Assignees
Labels
bug Something isn't working

Comments

@WhyNotHugo
Copy link
Contributor

Alpine's package runs the tests suite during builds to confirm some sanity.
The test display_default_settings fails downstream.

     Running tests/show_settings.rs (target/debug/deps/show_settings-bed726651286f822)

running 1 test
stored new snapshot /home/hugo/src/gitlab.alpinelinux.org/alpine/aports/testing/ruff/src/ruff-0.2.1/crates/ruff/tests/snapshots/show_settings__display_default_settings.snap.new
test display_default_settings ... FAILED

failures:

---- 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:26
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
program: ruff
args:
  - check
  - "--show-settings"
  - unformatted.py
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────
   51    51 │ 	"**/pyproject.toml",
   52    52 │ ]
   53    53 │ file_resolver.extend_include = []
   54    54 │ file_resolver.respect_gitignore = true
   55       │-file_resolver.project_root = "[BASEPATH]"
         55 │+file_resolver.project_root = "/home/hugo/src/gitlab.alpinelinux.org/alpine/aports/testing/ruff/src/ruff-0.2.1"
   56    56 │ 
   57    57 │ # Linter Settings
   58    58 │ linter.exclude = []
   59       │-linter.project_root = "[BASEPATH]"
         59 │+linter.project_root = "/home/hugo/src/gitlab.alpinelinux.org/alpine/aports/testing/ruff/src/ruff-0.2.1"
   60    60 │ linter.rules.enabled = [
   61    61 │ 	MultipleImportsOnOneLine,
   62    62 │ 	ModuleImportNotAtTopOfFile,
   63    63 │ 	MultipleStatementsOnOneLineColon,
┈┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
  194   194 │ linter.external = []
  195   195 │ linter.ignore_init_module_imports = false
  196   196 │ linter.logger_objects = []
  197   197 │ linter.namespace_packages = []
  198       │-linter.src = ["[BASEPATH]"]
        198 │+linter.src = ["/home/hugo/src/gitlab.alpinelinux.org/alpine/aports/testing/ruff/src/ruff-0.2.1"]
  199   199 │ linter.tab_size = 4
  200   200 │ linter.line_length = 88
  201   201 │ linter.task_tags = [
  202   202 │ 	TODO,
────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────
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 'snapshot assertion for 'display_default_settings' failed in line 26', /home/hugo/.local/state/cargo/registry/src/index.crates.io-6f17d22bba15001f/insta-1.34.0/src/runtime.rs:563:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    display_default_settings

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

error: test failed, to rerun pass `-p ruff --test show_settings`

Looks like this BASEPATH

I checked other distributions, and they seem to also skip this test:

Do you know what could be causing the above issue?

@charliermarsh
Copy link
Member

Thanks -- I'll take a look.

@charliermarsh
Copy link
Member

It looks like the filter assumes that the directory name is "ruff".

@charliermarsh
Copy link
Member

Should be fixed in the next release, but please let me know if not. I changed the test to use the current working directory rather than hard-coding "ruff".

@zanieb
Copy link
Member

zanieb commented Feb 7, 2024

Thanks for the report!

@WhyNotHugo
Copy link
Contributor Author

Thanks!

@WhyNotHugo
Copy link
Contributor Author

No issues with 0.2.2 👍

@charliermarsh
Copy link
Member

Thank you for following up! 🙏

nkxxll pushed a commit to nkxxll/ruff that referenced this issue Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants