You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// - `TempDir`: The temporary directory containing the modified Go project. This directory will be automatically deleted when dropped (only in tests).
29
+
/// - `PathBuf`: The path to the generated runner.go file. This should be passed to the `build_binary` function to build
30
+
/// the binary that will execute the benchmarks.
31
+
pubfnrun<P:AsRef<Path>>(
32
+
package:&BenchmarkPackage,
33
+
profile_dir:P,
34
+
) -> anyhow::Result<(TempDir,PathBuf)>{
31
35
// Create a temporary target directory for building the modified Go project.
32
-
// NOTE: We don't want to spend time cleanup any temporary files since the code is only
36
+
letmut target_dir = TempDir::new()?;
37
+
38
+
// We don't want to spend time cleanup any temporary files since the code is only
33
39
// run on CI servers which clean up themselves.
34
-
let target_dir = TempDir::new()?.keep();
40
+
// However, when running tests we don't want to fill the disk with temporary files, which
41
+
// can cause the tests to fail due to lack of disk space.
42
+
ifcfg!(not(test)){
43
+
target_dir.disable_cleanup(true);
44
+
}
35
45
36
46
// 1. Copy the whole git repository to a build directory
37
47
let git_root = ifletOk(git_dir) = utils::get_parent_git_repo_path(&package.module.dir){
0 commit comments