fix(test): clean big files on clean recipe#849
fix(test): clean big files on clean recipe#849qlrd wants to merge 1 commit intogetfloresta:masterfrom
clean recipe#849Conversation
csgui
left a comment
There was a problem hiding this comment.
Just some NITs about scripts portability. There are constrained environments that doesn't have bash by default.
3f7379b to
34524c5
Compare
Applied some POSIX procedures on |
This commit add a bash command to `clean` recipe and try to improve the clean process through some big temporary files. In some local tests, those jumped from 0 to 51G in /tmp/folder. Also, it add `--preserve-data-dir` to `tests/run.sh` in `.github/workflows/functional.yml`, so it can log the failures when a test fail in CI. Fix getfloresta#848.
34524c5 to
31b8cdb
Compare
|
Cool! It seems reasonable that scripts should be POSIX compatible unless there is a specific need that force them to use some other shell. |
|
ACK 31b8cdb |
yeah, CI will be unless we define in a job |
moisesPompilio
left a comment
There was a problem hiding this comment.
I don't think these modifications are safe: contrib/clean_data.sh is intended to clean project tmp files (./tmp), but your change removes items from the system /tmp, which can interfere with other applications.
| - name: Run functional tests tasks | ||
| run: | | ||
| tests/run.sh | ||
| run: tests/run.sh --preserve-data-dir |
There was a problem hiding this comment.
Why use the --preserve-data-dir flag?
There was a problem hiding this comment.
because if not set, they will delete logs and the logs job in CI will show an error
There was a problem hiding this comment.
That doesn't make sense, because run.sh deletes the log before running the tests
| if [ "$PRESERVE_DATA" = false ]; then | ||
| echo "Cleaning up test directories before running tests..." | ||
| rm -rf "$FLORESTA_TEMP_DIR/logs" | ||
| sh contrib/clean_data.sh |
There was a problem hiding this comment.
humm, I think this won't work if FLORESTA_TEMP_DIR is set.
There was a problem hiding this comment.
It wont, FLORESTA_TEMP_DIR is being ignored in clean_data.sh. If one needs to set FLORESTA_TEMP_DIR to another place, the script will fail to find it.
|
Approach NACK The presented changes introduce unnecessary logic to filter out big files, it would be easier to just delete everything thats test-generated if the objective is to have clean environments to re run tests. In #306, when |
unnecessary is to need manually remove every time i do a test in local machine with 51 GB in my |
Are you run locally or just push to CI? I bet the second because if you do the first (and if you did the first IDK why it was ignored), every time you do it, you could see AFAIK 51GB on whatever could be |
|
NACK I think the proposed changes don't add improvement to the project; changing |
|
PR closed since it is not actually need. Reopen discussion if need. |
Description and Notes
This commit add a bash command to
cleanrecipe and try to improve the clean process through some big temporary files. In some local tests, those jumped from 0 to 51G in /tmp/folderHow to verify the changes you have done?
See #848