Skip to content

Add tests for find_sources, gen-source-db, run-tree#7

Closed
msullivan wants to merge 3 commits into
facebook:mainfrom
msullivan:fs-test
Closed

Add tests for find_sources, gen-source-db, run-tree#7
msullivan wants to merge 3 commits into
facebook:mainfrom
msullivan:fs-test

Conversation

@msullivan

Copy link
Copy Markdown
Contributor

Most of the tests test the shared find_sources code directly, but also
add a smoke test each for run-tree and gen-source-db that verify they
are both supporting site-packages.

Most of the tests test the shared find_sources code directly, but also
add a smoke test each for run-tree and gen-source-db that verify they
are both supporting site-packages.
@meta-cla meta-cla Bot added the cla signed label Apr 21, 2026

@martindemello martindemello left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good, just move the helper function to the existing test lib

Comment thread tests/common/mod.rs Outdated
@msullivan msullivan force-pushed the fs-test branch 3 times, most recently from bc15663 to ba13172 Compare April 21, 2026 22:51
@meta-codesync

meta-codesync Bot commented Apr 22, 2026

Copy link
Copy Markdown

@martindemello has imported this pull request. If you are a Meta employee, you can view this in D102024363.

Comment thread tests/run_tree.rs Outdated
run(args).unwrap();

let content = fs::read_to_string(&output).unwrap();
let value: serde_json::Value = serde_json::from_str(&content).unwrap();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lint: use serde_json::Value

Comment thread src/test_lib.rs
use pyrefly_python::module::Module;
use pyrefly_python::module_name::ModuleName;
use rayon::prelude::*;
use tempfile::TempDir;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

error[[E0432](https://www.internalfb.com/servicelab/experiment/0432)]: unresolved import `tempfile`
  --> fbcode/safer_lazy_imports/lifeguard/src/test_lib.rs:19:5
   |
19 | use tempfile::TempDir;
   |     ^^^^^^^^ use of unresolved module or unlinked crate `tempfile`
   |
   = help: you might be missing a crate named `tempfile`

@meta-codesync

meta-codesync Bot commented Apr 23, 2026

Copy link
Copy Markdown

@brittanyrey merged this pull request in 26fb058.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants