rspec failing after ruby upgrade.
!5261 (merged) was merged earlier today to upgrade from Ruby 3.1.3 to Ruby 3.2.0.
Once that was upgraded, and running rspec-parameterized 0.51, you get this off master:
stejacks@atlas~/projects/gitlab-com/runbooks (master) $ bundle exec rspec
warning: parser/current is loading parser/ruby32, which recognizes3.2.0-dev-compliant syntax, but you are running 3.2.0.
Please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
An error occurred while loading ./spec/libsonnet/toolinglinks/grafana_spec.rb.
Failure/Error: using RSpec::Parameterized::TableSyntax
TypeError:
Refinement#include has been removed
# ./vendor/bundle/ruby/3.2.0/gems/rspec-parameterized-0.5.1/lib/rspec/parameterized/table_syntax.rb:29:in `include'
# ./vendor/bundle/ruby/3.2.0/gems/rspec-parameterized-0.5.1/lib/rspec/parameterized/table_syntax.rb:29:in `block in <module:TableSyntax>'
# ./vendor/bundle/ruby/3.2.0/gems/rspec-parameterized-0.5.1/lib/rspec/parameterized/table_syntax.rb:28:in `refine'
# ./vendor/bundle/ruby/3.2.0/gems/rspec-parameterized-0.5.1/lib/rspec/parameterized/table_syntax.rb:28:in `<module:TableSyntax>'
# ./vendor/bundle/ruby/3.2.0/gems/rspec-parameterized-0.5.1/lib/rspec/parameterized/table_syntax.rb:27:in `<module:Parameterized>'
# ./vendor/bundle/ruby/3.2.0/gems/rspec-parameterized-0.5.1/lib/rspec/parameterized/table_syntax.rb:5:in `<module:RSpec>'
# ./vendor/bundle/ruby/3.2.0/gems/rspec-parameterized-0.5.1/lib/rspec/parameterized/table_syntax.rb:4:in `<top (required)>'
# ./spec/libsonnet/toolinglinks/grafana_spec.rb:6:in `require'
# ./spec/libsonnet/toolinglinks/grafana_spec.rb:6:in `block (2 levels) in <top (required)>'
# ./spec/libsonnet/toolinglinks/grafana_spec.rb:5:in `block in <top (required)>'
# ./spec/libsonnet/toolinglinks/grafana_spec.rb:4:in `<top (required)>'
Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeReadIO` instead!
Top level ::Parts is deprecated, require 'multipart/post' and use `Multipart::Post::Parts` instead!
WARNING: cannot load such file -- /opt/gitlab/embedded/service/gitlab-rails/config/environment
/Users/stejacks/projects/gitlab-com/runbooks/scripts/storage_rebalance.rb:130: warning: already initialized constant Storage::UserError
/Users/stejacks/projects/gitlab-com/runbooks/scripts/storage_project_selector.rb:56: warning: previous definition of UserError was here
/Users/stejacks/projects/gitlab-com/runbooks/scripts/storage_rebalance.rb:320: warning: already initialized constant Storage::Helpers::ISO8601_FRACTIONAL_SECONDS_LENGTH
/Users/stejacks/projects/gitlab-com/runbooks/scripts/storage_project_selector.rb:98: warning: previous definition of ISO8601_FRACTIONAL_SECONDS_LENGTH was here
WARNING: cannot load such file -- /opt/gitlab/embedded/service/gitlab-rails/config/environment
Finished in 0.00005 seconds (files took 0.77062 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples
I went and dug around and found that there's a newer version of rspec-parameterized that appears to fix this issue:
Installing debug_inspector 1.1.0 with native extensions
Installing rspec-parameterized-core 1.0.0
Fetching binding_of_caller 1.0.0
Installing binding_of_caller 1.0.0
Fetching rspec-parameterized-table_syntax 1.0.0
Installing rspec-parameterized-table_syntax 1.0.0
Fetching rspec-parameterized 1.0.0 (was 0.5.1)
Installing rspec-parameterized 1.0.0 (was 0.5.1)
Bundle complete! 17 Gemfile dependencies, 113 gems now installed.
Gems in the group 'production' were not installed.
Bundled gems are installed into `./vendor/bundle`
stejacks@atlas~/projects/gitlab-com/runbooks (master) $ bundle exec rspec
warning: parser/current is loading parser/ruby32, which recognizes3.2.0-dev-compliant syntax, but you are running 3.2.0.
Please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeReadIO` instead!
Top level ::Parts is deprecated, require 'multipart/post' and use `Multipart::Post::Parts` instead!
WARNING: cannot load such file -- /opt/gitlab/embedded/service/gitlab-rails/config/environment
/Users/stejacks/projects/gitlab-com/runbooks/scripts/storage_rebalance.rb:130: warning: already initialized constant Storage::UserError
/Users/stejacks/projects/gitlab-com/runbooks/scripts/storage_project_selector.rb:56: warning: previous definition of UserError was here
/Users/stejacks/projects/gitlab-com/runbooks/scripts/storage_rebalance.rb:320: warning: already initialized constant Storage::Helpers::ISO8601_FRACTIONAL_SECONDS_LENGTH
/Users/stejacks/projects/gitlab-com/runbooks/scripts/storage_project_selector.rb:98: warning: previous definition of ISO8601_FRACTIONAL_SECONDS_LENGTH was here
WARNING: cannot load such file -- /opt/gitlab/embedded/service/gitlab-rails/config/environment
...................foobar.yml
foo-bar.yml
foo_bar.yml
..Validating YAML on valid-yaml
.Validating YAML on invalid-yaml
Validation Failed on invalid-yaml:
error
.Validating Rule(s) on valid-rules
.Validating Rule(s) on invalid-rules
foo: {} is the incorrect type, must be string
.Validating Rule(s) on string-skip
............................................................................................./Users/stejacks/.asdf/shims/jsonnetfmt --string-style s -n 2 -i /var/folders/8k/cjghd0k93372hl0fnphz5f680000gn/T/d20230110-97975-g1u7s5/stage-group-mapping.jsonnet
./Users/stejacks/.asdf/shims/jsonnetfmt --string-style s -n 2 -i /var/folders/8k/cjghd0k93372hl0fnphz5f680000gn/T/d20230110-97975-agcogv/stage-group-mapping.jsonnet
./Users/stejacks/.asdf/shims/jsonnetfmt --string-style s -n 2 -i /var/folders/8k/cjghd0k93372hl0fnphz5f680000gn/T/d20230110-97975-x2dhlo/stage-group-mapping.jsonnet
.....
Finished in 12.02 seconds (files took 0.9004 seconds to load)
125 examples, 0 failures
I'm putting in an MR to potentially fix this, but I wanted to document this all in an issue and tag the people who might know a better solution?
@reprazent @f_santos -- feel free to just merge my MR if you think that's the right solution.