-
Notifications
You must be signed in to change notification settings - Fork 222
Fix #5125 - Add versionModified, repo, org, releaseTag to BCLSearchResult #5126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…sult + shush some annoying warnings due to trying to parse VersionString with empty string
| std::string org() const; | ||
| std::string repo() const; | ||
| std::string releaseTag() const; | ||
| boost::optional<openstudio::DateTime> versionModified() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New functions for BCLSearchResults
| if (auto orgElement = componentElement.child("org")) { | ||
| m_org = orgElement.text().as_string(); | ||
| } | ||
| if (auto repoElement = componentElement.child("repo")) { | ||
| m_repo = repoElement.text().as_string(); | ||
| } | ||
| if (auto release_tagElement = componentElement.child("release_tag")) { | ||
| m_releaseTag = release_tagElement.text().as_string(); | ||
| } | ||
| if (auto versionModifiedElement = componentElement.child("version_modified")) { | ||
| const std::string versionModified = versionModifiedElement.text().as_string(); | ||
| if (!versionModified.empty()) { | ||
| // fromXsdDateTime forwards to fromISO8601 and handles both formats | ||
| if (auto dt_ = openstudio::DateTime::fromXsdDateTime(versionModified)) { | ||
| m_versionModified = *dt_; | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grab 'em
| TEST_F(BCLFixture, RemoteBCL_BCLSearchResult) { | ||
| RemoteBCL remoteBCL; | ||
|
|
||
| const std::string openstudio_results_uid = "a25386cd-60e4-46bc-8b11-c755f379d916"; | ||
| // get openstudio_results | ||
| // std::vector<BCLSearchResult> responses = remoteBCL.searchMeasureLibrary("openstudio_results", 980); | ||
| std::vector<BCLSearchResult> responses = remoteBCL.searchMeasureLibrary(openstudio_results_uid, 980); | ||
|
|
||
| ASSERT_EQ(1, responses.size()); | ||
| auto& response = responses.front(); | ||
|
|
||
| EXPECT_FALSE(response.name().empty()); | ||
| EXPECT_EQ("Openstudio results", response.name()); | ||
|
|
||
| EXPECT_FALSE(response.uid().empty()); | ||
| EXPECT_EQ(openstudio_results_uid, response.uid()); | ||
|
|
||
| EXPECT_FALSE(response.versionId().empty()); | ||
| EXPECT_FALSE(response.description().empty()); | ||
| EXPECT_FALSE(response.modelerDescription().empty()); | ||
| EXPECT_TRUE(response.fidelityLevel().empty()); | ||
| EXPECT_EQ("measure", response.componentType()); | ||
|
|
||
| EXPECT_TRUE(response.provenanceRequired()); | ||
| EXPECT_TRUE(response.provenances().empty()); | ||
| EXPECT_FALSE(response.tags().empty()); | ||
| EXPECT_FALSE(response.attributes().empty()); | ||
| EXPECT_FALSE(response.files().empty()); | ||
| EXPECT_TRUE(response.costs().empty()); | ||
|
|
||
| EXPECT_FALSE(response.org().empty()); | ||
| EXPECT_EQ("NREL", response.org()); | ||
| EXPECT_FALSE(response.repo().empty()); | ||
| EXPECT_EQ("openstudio-common-measures-gem", response.repo()); | ||
| EXPECT_FALSE(response.releaseTag().empty()); | ||
|
|
||
| auto dt_ = response.versionModified(); | ||
| ASSERT_TRUE(dt_); | ||
| const openstudio::DateTime dateTime(Date(MonthOfYear::Nov, 14, 2022)); | ||
| EXPECT_GT(*dt_, dateTime); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New test
|
CI Results for 8dc8a9c:
|
| EXPECT_EQ("NREL", response.org()); | ||
| EXPECT_FALSE(response.repo().empty()); | ||
| EXPECT_EQ("openstudio-common-measures-gem", response.repo()); | ||
| EXPECT_FALSE(response.releaseTag().empty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it equal then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://bcl.nrel.gov/api/search/?fq=uuid:a25386cd-60e4-46bc-8b11-c755f379d916&all_content_versions=1
Currently that's v0.9.0. But this is going to change every time the openstudio_results is updated, so I don't want to pin it and have to update the test
Pull request overview
Pull Request Author
src/model/test)src/energyplus/Test)src/osversion/VersionTranslator.cpp)Labels:
IDDChangeAPIChangePull Request - Ready for CIso that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.