Skip to content

Commit cea716c

Browse files
committed
WIP 03b3a
1 parent 5dcc3f6 commit cea716c

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

crates/turborepo-lib/src/turbo_json/mod.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -800,14 +800,13 @@ mod tests {
800800
use turborepo_unescape::UnescapedString;
801801

802802
use super::{
803-
validate_extends, validate_no_package_task_syntax, validate_no_root_syntax_in_global_deps,
804-
Pipeline, RawTaskDefinition, RawTurboJson, SpacesJson, Spanned, TaskName, TurboJson,
805-
UIMode,
803+
validate_no_root_syntax_in_global_deps, RawTaskDefinition, RawTurboJson, SpacesJson,
804+
Spanned, TaskName, TurboJson, UIMode,
806805
};
807806
use crate::{
808807
boundaries::BoundariesConfig,
809808
cli::OutputLogsMode,
810-
config::{Error, RootSyntaxInGlobalDepsError},
809+
config::Error,
811810
task_graph::{TaskDefinition, TaskOutputs},
812811
};
813812

crates/turborepo-scm/src/package_deps.rs

+15-14
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ mod tests {
639639

640640
#[test]
641641
fn test_root_relative_paths() -> Result<(), Error> {
642-
let (tmp_dir, repo_root) = tmp_dir();
642+
let (_, repo_root) = tmp_dir();
643643
setup_repository(&repo_root);
644644

645645
// Create a package with some files
@@ -656,57 +656,58 @@ mod tests {
656656

657657
commit_all(&repo_root);
658658

659-
let git = Git::new(&repo_root)?;
659+
let scm = SCM::new(&repo_root);
660+
660661
let pkg_path = AnchoredSystemPath::new("my-pkg")?;
661662

662663
// Test with $TURBO_ROOT$ and root-relative path
663-
let hashes = git.get_package_file_hashes(
664+
let hashes = scm.get_package_file_hashes(
664665
&repo_root,
665666
pkg_path,
666667
&["$TURBO_ROOT$", "root-file.txt"],
667-
false,
668+
None,
668669
)?;
669670

670671
assert!(
671-
hashes.contains_key("root-file.txt"),
672+
hashes.contains_key(&RelativeUnixPathBuf::new("root-file.txt").unwrap()),
672673
"Should include root file"
673674
);
674675
assert!(
675-
!hashes.contains_key("my-pkg/pkg-file.txt"),
676+
!hashes.contains_key(&RelativeUnixPathBuf::new("my-pkg/pkg-file.txt").unwrap()),
676677
"Should not include package file"
677678
);
678679

679680
// Test with $TURBO_ROOT$ and package-relative path
680-
let hashes = git.get_package_file_hashes(
681+
let hashes = scm.get_package_file_hashes(
681682
&repo_root,
682683
pkg_path,
683684
&["$TURBO_ROOT$", "pkg-file.txt"],
684-
false,
685+
None,
685686
)?;
686687

687688
assert!(
688-
hashes.contains_key("my-pkg/pkg-file.txt"),
689+
hashes.contains_key(&RelativeUnixPathBuf::new("my-pkg/pkg-file.txt").unwrap()),
689690
"Should include package file"
690691
);
691692
assert!(
692-
!hashes.contains_key("root-file.txt"),
693+
!hashes.contains_key(&RelativeUnixPathBuf::new("root-file.txt").unwrap()),
693694
"Should not include root file"
694695
);
695696

696697
// Test with $TURBO_ROOT$ and both root and package paths
697-
let hashes = git.get_package_file_hashes(
698+
let hashes = scm.get_package_file_hashes(
698699
&repo_root,
699700
pkg_path,
700701
&["$TURBO_ROOT$", "root-file.txt", "pkg-file.txt"],
701-
false,
702+
None,
702703
)?;
703704

704705
assert!(
705-
hashes.contains_key("root-file.txt"),
706+
hashes.contains_key(&RelativeUnixPathBuf::new("root-file.txt").unwrap()),
706707
"Should include root file"
707708
);
708709
assert!(
709-
hashes.contains_key("my-pkg/pkg-file.txt"),
710+
hashes.contains_key(&RelativeUnixPathBuf::new("my-pkg/pkg-file.txt").unwrap()),
710711
"Should include package file"
711712
);
712713

0 commit comments

Comments
 (0)