Extract file writer module to write to output files
Context
One of the many prerequisites of #390346 (closed).
In the detect-tests
CI job, we have many shell scripts that are writing to output files.
Some scripts are overwriting the output file, and some are appending to the output.
Some scripts assume that the file needs to be there beforehand, and others don't.
What does this MR do and why?
This MR adds a file_handler.rb
helper with two methods:
- A
read_array_from_file
method to have a standard way to read from input files (e.g. create the file if doesn't exist, and read data) - A
write_array_to_file
method to have a standard way to write to output files for all the scripts we call in thedetect-tests
job.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by David Dieulivol