NREL / conan-openstudio-ruby

3 stars 5 forks source link

Fix or remove bundle_tests in test_package #21

Open jmarrec opened 4 years ago

jmarrec commented 4 years ago

Either we need to fix these or just disable/remove them.

Appveyor reports four failing tests on windows:

openstudio_ruby/2.5.5@nrel/testing (test package): ERROR: 4 tests Failed:
 * test\test_bundle.rb: test_bundle
 * test\test_bundle.rb: test_bundle_git
 * test\test_bundle.rb: test_bundle_no_install
 * test\test_bundle.rb: test_no_bundle

Travis reports 3 on both linux and mac:

openstudio_ruby/2.5.5@nrel/testing (test package): ERROR: 3 tests Failed:
 * test/test_bundle.rb: test_bundle
 * test/test_bundle.rb: test_bundle_git
 * test/test_bundle.rb: test_no_bundle
jmarrec commented 4 years ago

On unix, failure is this:

Writing lockfile to /Users/travis/build/NREL/conan-openstudio-ruby/test_package/test/bundle/Gemfile.lock
sh: : command not found

Locally I get:

Writing lockfile to /home/julien/Software/Others/conan/conan-openstudio-ruby/test_package/test/bundle/Gemfile.lock
sh: 1: : Permission denied

I reproduced this steps manually

    # This creates the Gemfile.lock already
    assert(system('bundle install --path ./test_gems'))
    # This does nothing, ruby platform is already there
    assert(system('bundle lock --add_platform ruby'))
    # fails because of bundler version
    assert(system("'#{OpenStudio::getOpenStudioCLI}' --bundle Gemfile --bundle_path './test_gems' --verbose test.rb"))

If I look at the Gemfile.lock before the CLI is called:

GEM
  remote: http://rubygems.org/
  specs:
    json_pure (2.1.0)
    openstudio-standards (0.2.0)
    tilt (2.0.8)

PLATFORMS
  ruby

DEPENDENCIES
  json_pure (= 2.1.0)
  openstudio-standards (= 0.2.0)
  tilt (= 2.0.8)

BUNDLED WITH
   2.0.2

When you call the CLI you get Error: You must use Bundler 2 or greater with this lockfile. in :/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/lockfile_parser.rb:108:inwarn_for_outdated_bundler_version'`

$ /home/julien/Software/Others/conan/conan-openstudio-ruby/test_package/build/3ab9e807845e983564d20e53042ddfcbb6c691b9/bin/openstudio --bundle Gemfile --bundle_path './test_gems' --verbose test.rb
I, [2019-12-18T11:34:27.447613 #3164]  INFO -- : CLI Parsed Inputs: ["--bundle", "Gemfile", "--bundle_path", "./test_gems", "--verbose"] "execute_ruby_script" ["test.rb"]
D, [2019-12-18T11:34:27.447655 #3164] DEBUG -- : Main arguments are ["--bundle", "Gemfile", "--bundle_path", "./test_gems", "--verbose"]
D, [2019-12-18T11:34:27.447667 #3164] DEBUG -- : Sub-command is execute_ruby_script
D, [2019-12-18T11:34:27.447675 #3164] DEBUG -- : Sub-arguments are ["test.rb"]
D, [2019-12-18T11:34:27.447688 #3164] DEBUG -- : Parsing main_args ["--bundle", "Gemfile", "--bundle_path", "./test_gems", "--verbose"]
I, [2019-12-18T11:34:27.447701 #3164]  INFO -- : Setting BUNDLE_GEMFILE to Gemfile
I, [2019-12-18T11:34:27.447712 #3164]  INFO -- : Setting BUNDLE_PATH to ./test_gems
W, [2019-12-18T11:34:27.447722 #3164]  WARN -- : Bundle activated but ENV['BUNDLE_WITHOUT'] is not set
I, [2019-12-18T11:34:27.447729 #3164]  INFO -- : Setting BUNDLE_WITHOUT to 'test'
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.556226 #3164] DEBUG -- : Found system gem ansi 1.5.0, overrides embedded gem
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.556990 #3164] DEBUG -- : Found system gem ast 2.4.0, overrides embedded gem
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.557424 #3164] DEBUG -- : Found system gem builder 3.2.3, overrides embedded gem
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.558890 #3164] DEBUG -- : Found system gem diff-lcs 1.3, overrides embedded gem
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.559447 #3164] DEBUG -- : Found system gem docile 1.3.2, overrides embedded gem
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.560683 #3164] DEBUG -- : Found system gem json 2.2.0, overrides embedded gem
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.563210 #3164] DEBUG -- : Found system gem parallel 1.12.1, overrides embedded gem
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.563876 #3164] DEBUG -- : Found system gem parser 2.6.5.0, overrides embedded gem
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.564386 #3164] DEBUG -- : Found system gem powerpack 0.1.2, overrides embedded gem
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.570332 #3164] DEBUG -- : Found system gem rubocop 0.54.0, overrides embedded gem
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.570863 #3164] DEBUG -- : Found system gem rubocop-checkstyle_formatter 0.4.0, overrides embedded gem
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.571451 #3164] DEBUG -- : Found system gem ruby-progressbar 1.10.1, overrides embedded gem
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.572003 #3164] DEBUG -- : Found system gem simplecov 0.16.1, overrides embedded gem
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.572481 #3164] DEBUG -- : Found system gem simplecov-html 0.10.2, overrides embedded gem
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
D, [2019-12-18T11:34:27.572999 #3164] DEBUG -- : Found system gem unicode-display_width 1.6.0, overrides embedded gem
Error executing argv: ["--bundle", "Gemfile", "--bundle_path", "./test_gems", "--verbose", "test.rb"]
Error: You must use Bundler 2 or greater with this lockfile. in :/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/lockfile_parser.rb:95:in `initialize'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/definition.rb:83:in `new'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/definition.rb:83:in `initialize'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/dsl.rb:234:in `new'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/dsl.rb:234:in `to_definition'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/dsl.rb:13:in `evaluate'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/definition.rb:34:in `build'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler.rb:244:in `definition'
:/openstudio_cli.rb:539:in `parse_main_args'
:/openstudio_cli.rb:718:in `execute'
:/openstudio_cli.rb:1175:in `<main>'
eval:119:in `eval'
eval:119:in `require_embedded_absolute'
eval:93:in `block in require'
eval:87:in `each'
eval:87:in `require'
eval:3:in `<main>'
jmarrec commented 4 years ago

On Windows, another problem happens: we hit the 260 MAX_PATH limitation, which makes Appveyor crash during the upload...

Exporting package recipe
Traceback (most recent call last):
  File "build.py", line 54, in <module>
    builder.run()
  File "C:\Python37\lib\site-packages\cpt\packager.py", line 517, in run
    self.run_builds(base_profile_name=base_profile_name)
  File "C:\Python37\lib\site-packages\cpt\packager.py", line 605, in run_builds
    r.run()
  File "C:\Python37\lib\site-packages\cpt\runner.py", line 122, in run
    update=self._update_dependencies)
  File "C:\Python37\lib\site-packages\conans\client\conan_api.py", line 81, in wrapper
    return f(api, *args, **kwargs)
  File "C:\Python37\lib\site-packages\conans\client\conan_api.py", line 344, in create
    ignore_dirty=ignore_dirty)
  File "C:\Python37\lib\site-packages\conans\client\cmd\export.py", line 120, in cmd_export
    export_source(conanfile, origin_folder, package_layout.export_sources())
  File "C:\Python37\lib\site-packages\conans\client\cmd\export.py", line 422, in export_source
    copier(pattern, links=True, excludes=excluded_sources)
  File "C:\Python37\lib\site-packages\conans\client\file_copier.py", line 81, in __call__
    keep_path, excluded_folders=excluded)
  File "C:\Python37\lib\site-packages\conans\client\file_copier.py", line 99, in _copy
    copied_files = self._copy_files(files_to_copy, src, dst, keep_path, symlinks)
  File "C:\Python37\lib\site-packages\conans\client\file_copier.py", line 227, in _copy_files
    shutil.copy2(abs_src_name, abs_dst_name)
  File "C:\Python37\lib\shutil.py", line 266, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "C:\Python37\lib\shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\appveyor\\.conan\\data\\openstudio_ruby\\2.5.5\\nrel\\testing\\export_source\\test_package\\test\\bundle_git\\test_gems\\ruby\\1.9.1\\cache\\bundler\\git\\simplecov-ccc6d2b841ab267d711075e7d4def30914185542\\objects\\pack\\pack-fe0257764042e3794399fd067820a5ef1e8cfb5f.idx'
jmarrec commented 4 years ago

Ok, forgetting everything Above

NEW UP TO DATE FAILURES

All platforms:

TL:DR

Error: The git source git://github.com/rtomayko/tilt.git is not yet checked out. Please run `bundle install` before trying to start your application in :/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/source
Running 'bundle_git' test in '/tmp/bundle_git20191218-26737-105bx18'
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path './test_gems'`, and stop using this flag
Fetching https://github.com/rtomayko/tilt.git
Fetching https://github.com/NREL/simplecov.git
Fetching gem metadata from http://rubygems.org/...
Resolving dependencies...
Using bundler 2.1.1
Fetching docile 1.3.2
Installing docile 1.3.2
Fetching json_pure 2.2.0
Installing json_pure 2.2.0
Fetching simplecov-html 0.10.2
Installing simplecov-html 0.10.2
Using simplecov 0.16.1 from https://github.com/NREL/simplecov.git (at master@98c33ff)
Using tilt 2.0.8 from https://github.com/rtomayko/tilt.git (at abe77ea@abe77ea)
Fetching xml-simple 1.1.5
Installing xml-simple 1.1.5
Bundle complete! 4 Gemfile dependencies, 7 gems now installed.
Bundled gems are installed into `./test_gems`
Fetching gem metadata from http://rubygems.org/..
Writing lockfile to /tmp/bundle_git20191218-26737-105bx18/Gemfile.lock
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
Gem::Specification.add_spec is deprecated and will be removed in RubyGems 3.0
I, [2019-12-18T15:25:07.906910 #27278]  INFO -- : CLI Parsed Inputs: ["--bundle", "Gemfile", "--bundle_path", "./test_gems", "--verbose"] "execute_ruby_script" ["test.rb"]
D, [2019-12-18T15:25:07.906940 #27278] DEBUG -- : Main arguments are ["--bundle", "Gemfile", "--bundle_path", "./test_gems", "--verbose"]
D, [2019-12-18T15:25:07.906948 #27278] DEBUG -- : Sub-command is execute_ruby_script
D, [2019-12-18T15:25:07.906956 #27278] DEBUG -- : Sub-arguments are ["test.rb"]
D, [2019-12-18T15:25:07.906965 #27278] DEBUG -- : Parsing main_args ["--bundle", "Gemfile", "--bundle_path", "./test_gems", "--verbose"]
I, [2019-12-18T15:25:07.906976 #27278]  INFO -- : Setting BUNDLE_GEMFILE to Gemfile
I, [2019-12-18T15:25:07.906987 #27278]  INFO -- : Setting BUNDLE_PATH to ./test_gems
W, [2019-12-18T15:25:07.906996 #27278]  WARN -- : Bundle activated but ENV['BUNDLE_WITHOUT'] is not set
I, [2019-12-18T15:25:07.907001 #27278]  INFO -- : Setting BUNDLE_WITHOUT to 'test'
D, [2019-12-18T15:25:08.019204 #27278] DEBUG -- : Found system gem ansi 1.5.0, overrides embedded gem
D, [2019-12-18T15:25:08.019981 #27278] DEBUG -- : Found system gem ast 2.4.0, overrides embedded gem
D, [2019-12-18T15:25:08.020426 #27278] DEBUG -- : Found system gem builder 3.2.3, overrides embedded gem
D, [2019-12-18T15:25:08.021955 #27278] DEBUG -- : Found system gem diff-lcs 1.3, overrides embedded gem
D, [2019-12-18T15:25:08.022527 #27278] DEBUG -- : Found system gem docile 1.3.2, overrides embedded gem
D, [2019-12-18T15:25:08.024051 #27278] DEBUG -- : Found system gem json 2.2.0, overrides embedded gem
D, [2019-12-18T15:25:08.026734 #27278] DEBUG -- : Found system gem parallel 1.12.1, overrides embedded gem
D, [2019-12-18T15:25:08.027375 #27278] DEBUG -- : Found system gem parser 2.6.5.0, overrides embedded gem
D, [2019-12-18T15:25:08.027907 #27278] DEBUG -- : Found system gem powerpack 0.1.2, overrides embedded gem
D, [2019-12-18T15:25:08.034431 #27278] DEBUG -- : Found system gem rubocop 0.54.0, overrides embedded gem
D, [2019-12-18T15:25:08.034975 #27278] DEBUG -- : Found system gem rubocop-checkstyle_formatter 0.4.0, overrides embedded gem
D, [2019-12-18T15:25:08.035575 #27278] DEBUG -- : Found system gem ruby-progressbar 1.10.1, overrides embedded gem
D, [2019-12-18T15:25:08.036111 #27278] DEBUG -- : Found system gem simplecov 0.16.1, overrides embedded gem
D, [2019-12-18T15:25:08.036588 #27278] DEBUG -- : Found system gem simplecov-html 0.10.2, overrides embedded gem
D, [2019-12-18T15:25:08.037104 #27278] DEBUG -- : Found system gem unicode-display_width 1.6.0, overrides embedded gem
I, [2019-12-18T15:25:08.133843 #27278]  INFO -- : without_groups = test
I, [2019-12-18T15:25:08.133866 #27278]  INFO -- : g = default
I, [2019-12-18T15:25:08.133875 #27278]  INFO -- : Bundling with groups [default]
Error executing argv: ["--bundle", "Gemfile", "--bundle_path", "./test_gems", "--verbose", "test.rb"]
Error: The git source git://github.com/rtomayko/tilt.git is not yet checked out. Please run `bundle install` before trying to start your application in :/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/source/git/git_proxy.rb:235:in `allowed_in_path'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/source/git/git_proxy.rb:192:in `find_local_revision'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/source/git/git_proxy.rb:64:in `revision'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/source/git.rb:227:in `revision'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/source/git.rb:95:in `install_path'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/source/path.rb:128:in `expanded_path'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/source/path.rb:165:in `load_spec_files'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/source/git.rb:202:in `load_spec_files'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/source/path.rb:102:in `local_specs'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/source/git.rb:169:in `specs'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/definition.rb:758:in `block in converge_locked_specs'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/definition.rb:744:in `each'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/definition.rb:744:in `converge_locked_specs'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/definition.rb:247:in `resolve'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/definition.rb:170:in `specs'
:/ruby/2.5.0/gems/bundler-1.17.1/lib/bundler/definition.rb:237:in `specs_for'
:/openstudio_cli.rb:555:in `parse_main_args'
:/openstudio_cli.rb:718:in `execute'
:/openstudio_cli.rb:1175:in `<main>'
eval:119:in `eval'
eval:119:in `require_embedded_absolute'
eval:93:in `block in require'
eval:87:in `each'
eval:87:in `require'
eval:3:in `<main>'

Windows Only

On windows, same message for bundle_git

for "bundle":

# Running:
Running 'bundle' test in 'C:/Users/appveyor/AppData/Local/Temp/1/bundle20191218-4492-1qfrprg'
Fetching gem metadata from http://rubygems.org/....
Resolving dependencies...
RubyGems 1.8.29 is not threadsafe, so your gems will be installed one at a time. Upgrade to RubyGems 2.1.0 or higher to enable parallel gem installation.
Using bundler 1.17.3
Fetching json_pure 2.1.0
Installing json_pure 2.1.0
Fetching openstudio-standards 0.2.0
Installing openstudio-standards 0.2.0
Gem::InstallError: openstudio-standards requires Ruby version >= 2.0.0.
An error occurred while installing openstudio-standards (0.2.0), and Bundler
cannot continue.
Make sure that `gem install openstudio-standards -v '0.2.0' --source
'http://rubygems.org/'` succeeds before bundling.
In Gemfile:
  openstudio-standards
F