mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-01-19 05:49:14 +02:00
2913fc4cd0
This commit improves the integration test setup by running tests inside the system's temporary directory instead of within ripgrep's `target` directory. The motivation here is to attempt to reduce the effect of unanticipated state on ripgrep's integration tests, such as the presence of `.gitignore` files in ripgrep's checkout directory hierarchy (including parent directories). This doesn't remove all possible state. For example, there's no guarantee that the system's temporary directory isn't itself within a git repository. Moreover, there may still be other ignore rules in the directory tree that might impact test behavior. Fixing this seems somewhat difficult. Conceptually, it seems like ripgrep should run each test in its own `chroot`-like environment, but doing this in a non-annoying and portable way (including Windows) doesn't appear to be possible. Another approach to take here might be to teach ripgrep itself that a particular directory should be treated as root, and therefore, never look at anything outside that directory. This also seems complex to implement, but tractable. Let's see how this approach works for now. Fixes #448, #996