NREL / OpenStudio-measure-tester-gem

Other
3 stars 0 forks source link

Some measures that have successful unit tests, don't show in "Tests" column of dashboard #2

Closed DavidGoldwasser closed 6 years ago

DavidGoldwasser commented 6 years ago

screen shot 2018-02-28 at 10 40 40 am

For reference, here is the "TEST-My-Test.xml" file for one measure that doesn't report in the "tests" column.

<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="AddRooftopPVTest" tests="1" time="2.48831" failures="0" errors="0" skipped="0" assertions="2" timestamp="2018-02-27T22:39:37-07:00">
  <testcase name="test_good_argument_values" time="2.092101" assertions="2">
  </testcase>
  <system-err>
/Users/dgoldwas/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/ci_reporter-2.0.0/lib/ci/reporter/test_suite.rb:54: warning: instance variable @capture_out not initialized
/Users/dgoldwas/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/ci_reporter-2.0.0/lib/ci/reporter/test_suite.rb:55: warning: instance variable @capture_err not initialized
/Users/dgoldwas/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/ci_reporter-2.0.0/lib/ci/reporter/report_manager.rb:51: warning: File.exists? is a deprecated name, use File.exist? instead
  </system-err>
</testsuite>

And one that does report in tests column.

<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="AddCostPerAreaToConstruction_Test" tests="2" time="11.90005" failures="0" errors="0" skipped="0" assertions="22" timestamp="2018-02-27T22:46:44-07:00">
  <testcase name="test_AddCostPerAreaToConstruction_fail" time="0.003525" assertions="11">
  </testcase>
  <testcase name="test_AddCostPerAreaToConstruction_good" time="3.164984" assertions="11">
  </testcase>
  <system-out>
**MEASURE APPLICABILITY**
0 = Success
**INITIAL CONDITION**
Construction ASHRAE 189.1-2009 ExtWall SteelFrame ClimateZone 4-8 has 0 lifecycle cost objects.
**FINAL CONDITION**
A new lifecycle cost object was added to construction ASHRAE 189.1-2009 ExtWall SteelFrame ClimateZone 4-8 with an area of 1,377 (ft^2). Material and Installation costs are $6,885.
**INFO MESSAGES**
**WARNING MESSAGES**
**ERROR MESSAGES**
***Machine-Readable Attributes**
[
{
   "name" : "construction",
   "value" : "{d3f0263a-db9d-4775-bdee-fb25f77960c4}"
}
,{
   "name" : "remove_costs",
   "value" : true
}
,{
   "name" : "material_cost_ip",
   "value" : 5
}
,{
   "name" : "demolition_cost_ip",
   "value" : 1
}
,{
   "name" : "years_until_costs_start",
   "value" : 0
}
,{
   "name" : "demo_cost_initial_const",
   "value" : false
}
,{
   "name" : "expected_life",
   "value" : 20
}
,{
   "name" : "om_cost_ip",
   "value" : 0.25
}
,{
   "name" : "om_frequency",
   "value" : 1
}
]
***Files Generated**

  </system-out>
  <system-err>
/Users/dgoldwas/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/ci_reporter-2.0.0/lib/ci/reporter/test_suite.rb:54: warning: instance variable @capture_out not initialized
/Users/dgoldwas/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/ci_reporter-2.0.0/lib/ci/reporter/test_suite.rb:55: warning: instance variable @capture_err not initialized
/Users/dgoldwas/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/ci_reporter-2.0.0/lib/ci/reporter/report_manager.rb:51: warning: File.exists? is a deprecated name, use File.exist? instead
  </system-err>
</testsuite>

There are 15 of measures that don't report, although at least one represents a measure that doesn't have a measure test file.

nllong commented 6 years ago

@rpg777 was working on this if not mistaken. We need to enforce a convention that the class name of the test is def <MeasureName>Test

rpg777 commented 6 years ago

Yeah, should be all fixed up now (ASSuming convention is followed) with this commit. The parsers will now catch correctly [tT]Test, or _[tT]est, but Nick would like to standardize.