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

Fix tests #5184

Merged
merged 7 commits into from
May 3, 2024
Merged

Fix tests #5184

merged 7 commits into from
May 3, 2024

Conversation

jmarrec
Copy link
Collaborator

@jmarrec jmarrec commented May 2, 2024

Pull request overview

Fixup failing tests on develop after the merge festival

Pull Request Author

  • Model API Changes / Additions
  • Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
  • Model API methods are tested (in src/model/test)
  • EnergyPlus ForwardTranslator Tests (in src/energyplus/Test)
  • If a new object or method, added a test in NREL/OpenStudio-resources: Add Link
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • Verified that C# bindings built fine on Windows, partial classes used as needed, etc.
  • All new and existing tests passes
  • If methods have been deprecated, update rest of code to use the new methods

Labels:

  • If change to an IDD file, add the label IDDChange
  • If breaking existing API, add the label APIChange
  • If deemed ready, add label Pull Request - Ready for CI so that CI builds your PR

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • Code Style, strip trailing whitespace, etc.
  • All related changes have been implemented: model changes, model tests, FT changes, FT tests, VersionTranslation, OS App
  • Labeling is ok
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified

@jmarrec jmarrec added Developer Issue component - CLI Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. component - Ruby bindings labels May 2, 2024
@jmarrec jmarrec requested a review from kbenne May 2, 2024 23:09
@jmarrec jmarrec self-assigned this May 2, 2024
Comment on lines +4 to +5
# gem 'openstudio-extension', git: 'https://github.com/NREL/openstudio-extension-gem.git', ref: 'v0.8.0'
gem 'simplecov', git: 'https://github.com/simplecov-ruby/simplecov', ref: 'v0.21.2'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Disable using openstudio-extension, cf comment below

Comment on lines +22 to +38
# TODO: until we have gems on rubygems, this is unpractical without forcing a
# download from git for all openstudio-extension, measure-tester, and workflow
# gems

# # test a github checkout gem
# require 'openstudio'
# require 'openstudio/extension'
# puts OpenStudio::Extension::VERSION
# raise "OpenStudio Extension version does not match" unless OpenStudio::Extension::VERSION.to_s == '0.8.0'

# did_fail = false
# begin
# require 'openstudio-standards'
# rescue LoadError
# did_fail = true
# end
# raise "Should allow to load the embedded openstudio-standards" unless did_fail == false
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note the comment here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@DavidGoldwasser was working on gettig all of the gems published yesterday. The plan is to have this done prior to an RC2. (maybe today?)

@@ -68,7 +68,7 @@ def run_file(
)

r = subprocess.run(
[str(args.ruby_or_cli_path), "-e", "at exit { exit 12 }"],
[str(args.ruby_or_cli_path), "-e", "at_exit { exit 12 }"],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

typo

Comment on lines +14 to +18
no_block_glob = Dir["*.txt", "*.cpp"]
assert_instance_of(Array, no_block_glob)
assert_includes(no_block_glob, 'CMakeLists.txt')
assert_includes(no_block_glob, 'embedded_help.rb')
puts no_block_glob.index('test_embedded_help.rb')
assert_nil(no_block_glob.index('test_embedded_help.rb'))
assert_includes(no_block_glob, 'main.cpp')
assert_nil(no_block_glob.index('test_main.cpp'))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

embedded_help.rb is no longer in the src/cli directory, but in the ruby/engine dir, so adjust the test. It must have been failing, silently, for a year and a half since 50f6c03

Comment on lines -140 to -150
def test_sdbm
require 'sdbm'

SDBM.open 'my_database' do |db|
db['apple'] = 'fruit'
db['pear'] = 'fruit'
db['carrot'] = 'vegetable'
db['tomato'] = 'vegetable'
end
assert(true)
end
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This gem has been gone for...? ever I would say.

@@ -234,6 +222,7 @@ def test_msgpack
end

def test_json_schemer
skip("Disabled due to unf_ext, see https://github.com/NREL/openstudio-gems/issues/72")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Disable with a comment

Comment on lines +49 to +50
if logLevel in ['Trace', 'Debug']:
assert f"[openstudio.CLI] <-2> Setting Log Level to {logLevel} ({loglevel_int_value})" in lines
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adjust test with recent changes

@@ -163,7 +163,7 @@ void OSWorkflow::runEnergyPlus() {
LOG(Info, "Running command '" << cmd << "'");

int result = 0;
detailedTimeBlock("Running ExpandObjects", [this, /*&cmd,*/ &result, &runDirPath, &runDirResults, &stdout_ofs] {
detailedTimeBlock("Running ExpandObjects", [this, /*&cmd,*/ &result, &runDirResults, &stdout_ofs] {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

clang 15 complains when unused lambda capture.

@jmarrec
Copy link
Collaborator Author

jmarrec commented May 3, 2024

The tests are passing on my mac. I think the issue is that the runner doesn't have ruby 3.2.2 activated with bundler installed when it tries to run the tests that match -R CLITest-test_bundle. @wenyikuang

ctest -R CLITest-test_bundle
Test project /Users/julien/Software/Others/OS-build-release
    Start 3894: CLITest-test_bundle-bundle
1/7 Test #3894: CLITest-test_bundle-bundle ...................   Passed    9.02 sec
    Start 3895: CLITest-test_bundle-bundle_git
2/7 Test #3895: CLITest-test_bundle-bundle_git ...............   Passed   10.66 sec
    Start 3896: CLITest-test_bundle-bundle_native
3/7 Test #3896: CLITest-test_bundle-bundle_native ............   Passed    6.66 sec
    Start 3897: CLITest-test_bundle-bundle_native_embedded
4/7 Test #3897: CLITest-test_bundle-bundle_native_embedded ...   Passed    9.97 sec
    Start 3898: CLITest-test_bundle-bundle_no_install
5/7 Test #3898: CLITest-test_bundle-bundle_no_install ........   Passed    6.89 sec
    Start 3899: CLITest-test_bundle-no_bundle
6/7 Test #3899: CLITest-test_bundle-no_bundle ................   Passed    7.89 sec
    Start 3900: CLITest-test_bundle-bundle_default
7/7 Test #3900: CLITest-test_bundle-bundle_default ...........   Passed    7.88 sec

100% tests passed, 0 tests failed out of 7

Total Test time (real) =  59.10 sec
$ ruby --version
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin23]

$ bundle --version
Bundler version 2.4.10

$ gem info bundler

*** LOCAL GEMS ***

bundler (2.5.5, 2.4.10, 2.1.4)
    Authors: André Arko, Samuel Giddins, Colby Swandale, Hiroshi
    Shibata, David Rodríguez, Grey Baker, Stephanie Morillo, Chris
    Morris, James Wen, Tim Moore, André Medeiros, Jessica Lynn Suttles,
    Terence Lee, Carl Lerche, Yehuda Katz
    Homepage: https://bundler.io
    License: MIT
    Installed at (default): /Users/julien/.rvm/rubies/ruby-3.2.2/lib/ruby/gems/3.2.0

    The best way to manage your application's dependencies

@wenyikuang
Copy link
Collaborator

Yeah, I am pushing the new cmake docker image comes with ruby3.

@wenyikuang
Copy link
Collaborator

wenyikuang commented May 3, 2024

Running (https://ci.openstudio.net/blue/organizations/jenkins/openstudio-incremental-ubuntu-20-04/detail/PR-5184/6/pipeline/49/) , need to update the CONAN_HOME in my docker image to /root/ to align with other docker images tomorrow.

@jmarrec jmarrec merged commit d671778 into develop May 3, 2024
2 of 6 checks passed
@jmarrec jmarrec deleted the fix_tests branch May 3, 2024 12:09
@wenyikuang
Copy link
Collaborator

Updated the image in the master after we merge the PR. Now all them should be align with the local environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component - CLI component - Ruby bindings Developer Issue Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants