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 stale File status in tests #15030

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Fix stale File status in tests #15030

merged 1 commit into from
Dec 17, 2024

Conversation

MichaReiser
Copy link
Member

Summary

Fixes #15027

The MemoryFileSystem::write_file API automatically creates non-existing ancestor directoryes
but we failed to update the status of the now created ancestor directories in the Files data structure.

Test Plan

Tested that the case in #15027 now passes regardless of whether the Simple case is commented out or not

@MichaReiser MichaReiser added the red-knot Multi-file analysis & type inference label Dec 17, 2024
@@ -124,7 +124,6 @@ pub(crate) fn infer_definition_types<'db>(
let file = definition.file(db);
let _span = tracing::trace_span!(
"infer_definition_types",
definition = ?definition.as_id(),
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think the definition id gives us much here and it resulted in very long tracing lines but I'll revert if this ends up being controverisal

Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Contributor

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

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

Thank you!

@MichaReiser MichaReiser merged commit dcb99cc into main Dec 17, 2024
21 checks passed
@MichaReiser MichaReiser deleted the micha/fix-test-isolation branch December 17, 2024 11:45
dcreager added a commit that referenced this pull request Dec 17, 2024
* main:
  [red-knot] Explicitly test diagnostics are emitted for unresolvable submodule imports (#15035)
  Fix stale File status in tests (#15030)
  [red-knot] Basic support for other legacy `typing` aliases (#14998)
  feat(AIR302): extend the following rules (#15015)
  [`perflint`] Simplify finding the loop target in `PERF401` (#15025)
  [red-knot] Avoid undeclared path when raising conflicting declarations (#14958)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import-related mdtests aren't isolated
2 participants