Skip to content

Add tests for diff-based scanning in lightz

Summary

See MVC: Enable Diff-Based Scanning in MRs for Fast... (&17758 - closed) on how this issue fits in the whole plan.

Also read this thread for context on the changes needed here.

References

Main diff-based scanning epic: Faster Advanced SAST: Diff-based scanning in MRs (&16790 - closed)

MVC implementation epic: MVC: Enable Diff-Based Scanning in MRs for Fast... (&17758 - closed)

Implementation Plan

  1. Add tests in lightz to test the diff_scan_neighborhood_depth flag behavior with depth set to 0, 1, 2.
    • It should scan all the files specified in diff_scan_file_list_path and the neighbors of those files based on the configured depth
      • Here's an example code that I used to verify the behavior of these 2 flags

Note that for now, we do not plan to enable users to configure the diff_scan_neighborhood_depth which will be defaulted to 1(rationale see Implications for security approval section). However, we should still verify that this flag actually picks up the correct neighborhood depth with tests.

Edited by Shao Ming Tan