Skip to content
This repository was archived by the owner on Jun 3, 2023. It is now read-only.
This repository was archived by the owner on Jun 3, 2023. It is now read-only.

Update oj to a more up-to-date version #28

@paulkoegel

Description

@paulkoegel

Problem statement

  • we use transit-json in a large Rails application.
  • like transit-ruby, some of the other gems we use also rely on the oj gem.
  • we could not update some of those gems because they require at least version 3 of oj, which conflicts with transit-ruby's oj requirement ("~> 2.18").

Proposed solution


FYI: Related issue (this has been fixed, specs are green again with oj version 3.10.16, which my fork uses now, leaving only for reference in case someone encounters this issue / it reappears in the future)

  • The latest versions of oj, 3.10.5 and 3.10.6 (there is no 3.10.4), break the specs of transit-json. It looks to me like this might have been caused by this oj change: ohler55/oj@ebfc1ce and spec expectations in transit-ruby would have to be updated to work with the latest versions of oj.
Failures:

  1) JSON exemplars reads what we expect from ../transit-format/examples/0.8/simple/doubles_interesting.json
     Failure/Error: assert { exemplar.expected_value == actual_value }

       Expected (exemplar.expected_value == actual_value), but
       [-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626e-34            ]
       [-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626000000000001e-34]
                                                        ^

           exemplar.expected_value is [-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626e-34]
           exemplar is #<struct Exemplar name="doubles_interesting", expected_value=[-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626e-34]>
           actual_value is [-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626000000000001e-34]
     Shared Example Group: "exemplars" called from ./spec/transit/exemplar_spec.rb:146
     # ./spec/transit/exemplar_spec.rb:135:in `block (2 levels) in verify_exemplar'
     # ./spec/transit/exemplar_spec.rb:133:in `open'
     # ./spec/transit/exemplar_spec.rb:133:in `block in verify_exemplar'

  2) JSON-VERBOSE exemplars reads what we expect from ../transit-format/examples/0.8/simple/doubles_interesting.verbose.json
     Failure/Error: assert { exemplar.expected_value == actual_value }

       Expected (exemplar.expected_value == actual_value), but
       [-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626e-34            ]
       [-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626000000000001e-34]
                                                        ^

           exemplar.expected_value is [-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626e-34]
           exemplar is #<struct Exemplar name="doubles_interesting", expected_value=[-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626e-34]>
           actual_value is [-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626000000000001e-34]
     Shared Example Group: "exemplars" called from ./spec/transit/exemplar_spec.rb:150
     # ./spec/transit/exemplar_spec.rb:135:in `block (2 levels) in verify_exemplar'
     # ./spec/transit/exemplar_spec.rb:133:in `open'
     # ./spec/transit/exemplar_spec.rb:133:in `block in verify_exemplar'

Finished in 0.58072 seconds (files took 0.52754 seconds to load)
909 examples, 2 failures

Failed examples:

rspec './spec/transit/exemplar_spec.rb[1:23]' # JSON exemplars reads what we expect from ../transit-format/examples/0.8/simple/doubles_interesting.json
rspec './spec/transit/exemplar_spec.rb[2:23]' # JSON-VERBOSE exemplars reads what we expect from ../transit-format/examples/0.8/simple/doubles_interesting.verbose.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions