Skip to content

Commit

Permalink
ChangesSinceV2 included directory tests
Browse files Browse the repository at this point in the history
Summary:
# Context

We are introducing EdenFS notifications to support scalable and ergonomic file system notifications for EdenFS mounts.

# This Diff
This diff is pt2 of tests covering include/exclude functionality.

# Technical Details
This test covers the following cases
included folder is in results
subdir of included folder is in results
folders not included are not in results

# Discussion Points

Reviewed By: jdelliot

Differential Revision: D66845880

fbshipit-source-id: c7751e651d0f358156c4d9a9d55f0075aff8651d
  • Loading branch information
Chris Dinh authored and facebook-github-bot committed Dec 7, 2024
1 parent cc55cec commit 58a7234
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions eden/integration/changes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,29 @@ def test_exclude_directory(self):
)
self.assertTrue(self.check_changes(changes.changes, expected_changes))

def test_include_directory(self):
expected_changes = []
oldPosition = self.client.getCurrentJournalPosition(self.mount_path_bytes)
self.mkdir("ignored_dir")
self.mkdir("ignored_dir2/nested_ignored_dir")
expected_changes += self.add_folder_expect("want_dir")
expected_changes += self.add_folder_expect("want_dir/ignored_dir")
self.add_file_expect("ignored_dir/test_file", "contents", add=False)
expected_changes += self.add_file_expect(
"want_dir/test_file", "contents", add=False
)
self.add_file_expect(
"ignored_dir2/nested_ignored_dir/test_file", "contents", add=False
)
expected_changes += self.add_file_expect(
"want_dir/ignored_dir/test_file", "contents", add=False
)
changes = self.getChangesSinceV2(
oldPosition,
included_roots=["want_dir"],
)
self.assertTrue(self.check_changes(changes.changes, expected_changes))

def test_modify_file(self):
self.repo_write_file("test_file", "", add=False)
position = self.client.getCurrentJournalPosition(self.mount_path_bytes)
Expand Down

0 comments on commit 58a7234

Please sign in to comment.