NREL / openstudio-common-measures-gem

Other
7 stars 15 forks source link

ServerDirectoryCleanup test doesn't test whether the measure does what it's supposed to do #160

Open jmarrec opened 7 months ago

jmarrec commented 7 months ago

https://github.com/NREL/openstudio-common-measures-gem/blob/5be24c8e8e7b28be5b1cb57b5757858d54ec3fcf/lib/measures/ServerDirectoryCleanup/tests/ServerDirectoryCleanup_test.rb#L150-L157

It actually doesn't check that the files are indeed deleted (and they aren't), because the measure doesn't run with the right chdir. The measure assumes it's running from run_dir/000x_measure_name directory and looks up one path above to delete the extensions you requested to clean up.

https://github.com/NREL/openstudio-common-measures-gem/blob/5be24c8e8e7b28be5b1cb57b5757858d54ec3fcf/lib/measures/ServerDirectoryCleanup/measure.rb#L91