Fix prepare application test failure caused by undefined variable app_dir