Closed Alex-Tsvetanov closed 5 months ago
Original Ruby console logs on startup:
Error: #<Gem::Requirement::BadRequirementError: Illformed requirement [">=>= 0"]>
/Applications/SketchUp 2024/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/3.2.2/lib/ruby/3.2.0/rubygems/requirement.rb:106:in `parse'
/Applications/SketchUp 2024/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/3.2.2/lib/ruby/3.2.0/rubygems/requirement.rb:138:in `block in initialize'
/Applications/SketchUp 2024/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/3.2.2/lib/ruby/3.2.0/rubygems/requirement.rb:138:in `map!'
/Applications/SketchUp 2024/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/3.2.2/lib/ruby/3.2.0/rubygems/requirement.rb:138:in `initialize'
/Applications/SketchUp 2024/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/3.2.2/lib/ruby/3.2.0/rubygems/requirement.rb:68:in `new'
/Applications/SketchUp 2024/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/3.2.2/lib/ruby/3.2.0/rubygems/requirement.rb:68:in `create'
/Applications/SketchUp 2024/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/3.2.2/lib/ruby/3.2.0/rubygems/dependency.rb:56:in `initialize'
/Applications/SketchUp 2024/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_gem.rb:51:in `new'
/Applications/SketchUp 2024/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_gem.rb:51:in `gem'
/Users/alextsvetanov/Library/Application Support/SketchUp 2024/SketchUp/Plugins/testup/gem_helper.rb:17:in `require'
/Users/alextsvetanov/Library/Application Support/SketchUp 2024/SketchUp/Plugins/testup/json_ci_reporter.rb:13:in `<module:TestUp>'
/Users/alextsvetanov/Library/Application Support/SketchUp 2024/SketchUp/Plugins/testup/json_ci_reporter.rb:11:in `<top (required)>'
<internal:/Applications/SketchUp 2024/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/Applications/SketchUp 2024/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/Users/alextsvetanov/Library/Application Support/SketchUp 2024/SketchUp/Plugins/testup/api.rb:49:in `run_suite_without_gui'
Dev setup:
file(GENERATE OUTPUT Run_Tests.rb CONTENT "require 'testup'
TestUp::API.run_suite_without_gui('${CMAKE_CURRENT_BINARY_DIR}')")
add_custom_target(Tests ALL)
add_dependencies(Tests ${tests})
set_target_properties(Tests PROPERTIES
VS_DEBUGGER_COMMAND "C:/Program Files/SketchUp/SketchUp ${SKETCHUP_VERSION}/SketchUp.exe"
VS_DEBUGGER_COMMAND_ARGUMENTS "-RubyStartup \"${CMAKE_CURRENT_BINARY_DIR}/Run_Tests.rb\""
XCODE_SCHEME_EXECUTABLE "/Applications/SketchUp ${SKETCHUP_VERSION}/SketchUp.app"
XCODE_SCHEME_ARGUMENTS "-RubyStartup '${CMAKE_CURRENT_BINARY_DIR}/Run_Tests.rb'"
)
This should be fixed by this hotfix: https://github.com/SketchUp/testup-2/pull/234
Released 2.5.2 that should fix this. https://github.com/SketchUp/testup-2/releases
The following line is causing Ruby Error on
run_tests_without_gui
: https://github.com/SketchUp/testup-2/blob/b5a28cd780977c2ccf8c13cc25025aa2e980fe48/src/testup/gem_helper.rb#L17The fix would have to be applied for line 27 as well: https://github.com/SketchUp/testup-2/blob/b5a28cd780977c2ccf8c13cc25025aa2e980fe48/src/testup/gem_helper.rb#L27
The error is as follows:
This is caused because the default value of the keyword argument
version
isGem::Requirement.default
which is#<Gem::Requirement:0x00000002bf5d7688 @requirements=[[">=", #<Gem::Version "0">]]>
. Therefore when the">="
is added manually on lines 17 and 27 it becomes">=>= 0"
which causes the error.This is reproducible with the latest release (2.5.1 using the .rbz file) on both Sketchup 2023 and Sketchup 2024 using Ruby 2.7 and Ruby 3.2 respectively.
Found while running the testup-2 using
-RubyStartupArgs
setup from the ReadMe. Apparentlyrun_tests_without_gui
is being called and it reaches line 17 where it all goes down. Confirmed the source by doingTestUp::GemHelper.require('minitest-reporters-json_reporter', 'minitest/reporters/json_reporter')
(as written here https://github.com/SketchUp/testup-2/blob/b5a28cd780977c2ccf8c13cc25025aa2e980fe48/src/testup/json_ci_reporter.rb#L13 required here https://github.com/SketchUp/testup-2/blob/b5a28cd780977c2ccf8c13cc25025aa2e980fe48/src/testup/api.rb#L49)