NREL / OpenStudio

OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
https://www.openstudio.net/
Other
494 stars 188 forks source link

OpenStudio Workflow deletes the input osw when it is located in the run directory #5040

Closed kbenne closed 9 months ago

kbenne commented 9 months ago

Some of the openstudio-extension-gem tests perform workflow tests where the osw is located in the given run directory. The result is that the osw is deleted and in fact the extension gem tests are testing for the precense of the osw at the completion of thw workflow and those tests fail.

Here is an example of the osw, which sets the run_directory.

{
  "seed_file": null,
  "weather_file": "openstudio-extension-gem-test.epw",
  "measure_paths": [
    "/var/simdata/openstudio/openstudio-extension-gem/lib/measures"
  ],
  "file_paths": [
    "/var/simdata/openstudio/openstudio-extension-gem/lib/files"
  ],
  "run_directory": "/var/simdata/openstudio/openstudio-extension-gem/spec/test/runner",
  "steps": [
    {
      "measure_dir_name": "openstudio_extension_test_measure",
      "arguments": {
      }
    }
  ],
  "name": "Test File",
  "description": "Test File"
}

Here is the openstudio-extension-gem test that illustrates the problem. https://github.com/NREL/openstudio-extension-gem/blob/7819e99c43810bc518e8d050180fcc8cf7c4ab86/spec/openstudio/runner_spec.rb#L65

Here is where the run directory is blasted at the start of the workflow. https://github.com/NREL/OpenStudio/blob/3f35a4ce446e1e91a4ec0c559aeca226b2715099/src/workflow/OSWorkflow.cpp#L226

kbenne commented 9 months ago

Actually. Here is the key piece of missing magic that the new workflow does not have. https://github.com/NREL/OpenStudio-workflow-gem/blob/696306b5b24cd597edc6ab04faa1e618f99db190/lib/openstudio/workflow/run.rb#L122