Unit test: detect hard-coded absolute paths in the code
Hi @abatalla,
This issue is for a new unit test to avoid having hard-coded paths in the code that interfere with user's results or with running SUNSET in environments where /esarchive/ is not available.
This test will require a script but it shouldn't require a recipe. The idea is to sweep through the *.R
files in the code (in all the subdirectories inside modules/
and tools/
) and check line by line to see if the code contains the substring "/esarchive/"
. It would be a plus if we can find a way to exclude commented lines of code (the lines that start with #
) from this check.
If "/esarchive/"
is found in any of the files, the test should fail, and it should pass otherwise.
You can use R or bash to develop this test, whichever is more practical. In R, maybe a combination of functions like readLines()
and grepl()
would work nicely, but you can do some research to see what tools we have available. If you find any interesting package that we could use and you need to have it installed, just open an issue in the Requests Gitlab and Stamen will install it for you.
As always, let me know if you need anything.
Victòria