list of files/directory which are listed in ".gitignore" file are excluded in pushing into git repository. ".gitignore" file accepts static list of files/directories. Hence solutions availalbe:
i) you can create a directory "temp_success" so that your test cases tries to generate directories/files in "temp_success". Add this directory "temp_success" into .gitignore file temp_success/* .
ii) After running your test cases, write a script/code to check directories having SUCCESS file and execute following script to stop pushing into git repository
git update-index --assume-unchanged path/to/file.txt
Follow the reference at: