Fix #5125 - Add versionModified, repo, org, releaseTag to BCLSearchResult#5126
Merged
Fix #5125 - Add versionModified, repo, org, releaseTag to BCLSearchResult#5126
Conversation
…sult + shush some annoying warnings due to trying to parse VersionString with empty string
jmarrec
added a commit
to openstudiocoalition/OpenStudioApplication
that referenced
this pull request
Mar 26, 2024
jmarrec
commented
Mar 27, 2024
Comment on lines
+184
to
+187
| std::string org() const; | ||
| std::string repo() const; | ||
| std::string releaseTag() const; | ||
| boost::optional<openstudio::DateTime> versionModified() const; |
Collaborator
Author
There was a problem hiding this comment.
New functions for BCLSearchResults
Comment on lines
+450
to
+467
| 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_; | ||
| } | ||
| } | ||
| } |
Comment on lines
+421
to
+461
| 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); | ||
| } |
Collaborator
|
CI Results for 8dc8a9c:
|
joseph-robertson
requested changes
Mar 27, 2024
| EXPECT_EQ("NREL", response.org()); | ||
| EXPECT_FALSE(response.repo().empty()); | ||
| EXPECT_EQ("openstudio-common-measures-gem", response.repo()); | ||
| EXPECT_FALSE(response.releaseTag().empty()); |
Collaborator
There was a problem hiding this comment.
What does it equal then?
Collaborator
Author
There was a problem hiding this comment.
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
joseph-robertson
approved these changes
Mar 27, 2024
jmarrec
added a commit
to openstudiocoalition/OpenStudioApplication
that referenced
this pull request
May 13, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.