Skip to content
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

Python Measure Unit Test Action #19

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open

Python Measure Unit Test Action #19

wants to merge 37 commits into from

Conversation

jslane-h
Copy link
Collaborator

  • Action to run tests on Python measures
  • Fixed bug in GenerateConStrainReport measure

@jslane-h jslane-h requested a review from lymereJ November 20, 2024 17:57
@jslane-h jslane-h self-assigned this Nov 20, 2024
Copy link
Contributor

@lymereJ lymereJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jslane-h - Could we perhaps also run a measure check using the openstudio measure -t <path/to/lib/measures> after installing openstudio with pip? I know that some error are expected but perhaps we could filter the ones that are expected and fail the build if other appears.

@jslane-h
Copy link
Collaborator Author

Looks good!

@jslane-h - Could we perhaps also run a measure check using the openstudio measure -t <path/to/lib/measures> after installing openstudio with pip? I know that some error are expected but perhaps we could filter the ones that are expected and fail the build if other appears.

It looks like the CLI isn't installed when pip installing openstudio. I tried manually installing openstudio and got an error that I'm guessing is due to its size. Using docker might be a good strategy here. Any suggestions?

Comment on lines +4 to +6
RUN wget https://github.com/NREL/OpenStudio/releases/download/v3.9.0/OpenStudio-3.9.0+c77fbb9569-Ubuntu-22.04-x86_64.tar.gz && \
tar -xvzf OpenStudio-3.9.0+c77fbb9569-Ubuntu-22.04-x86_64.tar.gz && \
cp -r OpenStudio-3.9.0+c77fbb9569-Ubuntu-22.04-x86_64/usr/local/openstudio-3.9.0 /usr/local/openstudio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weilixu - should we always test using the latest version of OpenStudio?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure - I guess it should depends on the measure dependency. If all measures move at the same pace, we can use the latest OS version for testing.

@jslane-h
Copy link
Collaborator Author

@lymereJ @weilixu I found a way to add an auto-commit if we run 'openstudio measure -t ...' and changes are made to the XML's. Would this be helpful?

I originally wanted to fail if changes are detected, but this ran into an issue with the python measure XMLs since <error>Failed to infer measure name from ...</error> depends on where the machine is storing the measure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants