Skip to content

Commit b2b33ba

Browse files
Add test for ruby d2d mapping
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
1 parent 7bdb1b6 commit b2b33ba

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

55 KB
Binary file not shown.
10.5 KB
Binary file not shown.

scanpipe/tests/pipes/test_d2d.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,36 @@ def test_scanpipe_pipes_d2d_map_go_paths(self):
15311531
).count(),
15321532
)
15331533

1534+
def test_scanpipe_pipes_d2d_map_ruby(self):
1535+
input_dir = self.project1.input_path
1536+
input_resources = [
1537+
self.data / "d2d-ruby/to-sentry-delayed_job-5.22.1.gem",
1538+
self.data / "d2d-ruby/from-sentry-ruby-5.22.1.zip",
1539+
]
1540+
copy_inputs(input_resources, input_dir)
1541+
self.from_files, self.to_files = d2d.get_inputs(self.project1)
1542+
inputs_with_codebase_path_destination = [
1543+
(self.from_files, self.project1.codebase_path / d2d.FROM),
1544+
(self.to_files, self.project1.codebase_path / d2d.TO),
1545+
]
1546+
for input_files, codebase_path in inputs_with_codebase_path_destination:
1547+
for input_file_path in input_files:
1548+
scancode.extract_archive(input_file_path, codebase_path)
1549+
1550+
scancode.extract_archives(
1551+
self.project1.codebase_path,
1552+
recurse=True,
1553+
)
1554+
pipes.collect_and_create_codebase_resources(self.project1)
1555+
buffer = io.StringIO()
1556+
d2d.map_checksum(project=self.project1, checksum_field="sha1", logger=buffer.write)
1557+
self.assertEqual(
1558+
39,
1559+
CodebaseRelation.objects.filter(
1560+
project=self.project1, map_type="sha1"
1561+
).count(),
1562+
)
1563+
15341564
@skipIf(sys.platform == "darwin", "Test is failing on macOS")
15351565
def test_scanpipe_pipes_d2d_map_rust_symbols(self):
15361566
input_dir = self.project1.input_path

0 commit comments

Comments
 (0)