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

3 to_yaml spec failures with 0.16.3 and ruby2.7 #483

Closed
boutil opened this issue Jul 28, 2020 · 1 comment · May be fixed by #536
Closed

3 to_yaml spec failures with 0.16.3 and ruby2.7 #483

boutil opened this issue Jul 28, 2020 · 1 comment · May be fixed by #536

Comments

@boutil
Copy link

boutil commented Jul 28, 2020

Hi!

Trying to run the specs on Debian, with ruby2.7, I get the following failures:

Failures:

  1) IceCube::Schedule to_yaml should make a monthly round trip with to_yaml [#47]
     Failure/Error: expect(Schedule.from_yaml(schedule.to_yaml).first(3).inspect).to eq(schedule.first(3).inspect)
     
       expected: "[2020-07-28 23:56:21.505886873 +0200, 2020-10-28 23:56:21.505886873 +0100, 2021-01-28 23:56:21.505886873 +0100]"                                                        
            got: "[2020-07-28 23:56:21.505886873 +0200, 2020-10-28 23:56:21.505886873 +0200, 2021-01-28 23:56:21.505886873 +0200]"                                                        
     
       (compared using ==)
     # ./spec/examples/to_yaml_spec.rb:15:in `block (3 levels) in <module:IceCube>'
     # ./spec/spec_helper.rb:68:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:67:in `block (2 levels) in <top (required)>'

  2) IceCube::Schedule to_yaml should be able to make a round-trip to YAML with .day_of_month
     Failure/Error: expect(schedule.first(10).map { |r| r.to_s }).to eq(schedule2.first(10).map { |r| r.to_s })
     
       expected: ["2020-08-10 23:56:21 +0200", "2020-08-20 23:56:21 +0200", "2020-09-10 23:56:21 +0200", "2020-09-20 2...56:21 +0200", "2020-11-20 23:56:21 +0200", "2020-12-10 23:56:21 +0200", "2020-12-20 23:56:21 +0200"]                                                          
            got: ["2020-08-10 23:56:21 +0200", "2020-08-20 23:56:21 +0200", "2020-09-10 23:56:21 +0200", "2020-09-20 2...56:21 +0100", "2020-11-20 23:56:21 +0100", "2020-12-10 23:56:21 +0100", "2020-12-20 23:56:21 +0100"]
     
       (compared using ==)
     # ./spec/examples/to_yaml_spec.rb:67:in `block (2 levels) in <module:IceCube>'
     # ./spec/spec_helper.rb:68:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:67:in `block (2 levels) in <top (required)>'

  3) IceCube::Schedule to_yaml should be able to make a round-trip to YAML with .day_of_week
     Failure/Error: expect(schedule.first(10).map { |r| r.to_s }).to eq(schedule2.first(10).map { |r| r.to_s })
     
       expected: ["2020-08-03 23:56:21 +0200", "2020-08-24 23:56:21 +0200", "2020-09-07 23:56:21 +0200", "2020-09-21 2...56:21 +0200", "2020-11-23 23:56:21 +0200", "2020-12-07 23:56:21 +0200", "2020-12-21 23:56:21 +0200"]
            got: ["2020-08-03 23:56:21 +0200", "2020-08-24 23:56:21 +0200", "2020-09-07 23:56:21 +0200", "2020-09-21 2...56:21 +0100", "2020-11-23 23:56:21 +0100", "2020-12-07 23:56:21 +0100", "2020-12-21 23:56:21 +0100"]
     
       (compared using ==)
     # ./spec/examples/to_yaml_spec.rb:78:in `block (2 levels) in <module:IceCube>'
     # ./spec/spec_helper.rb:68:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:67:in `block (2 levels) in <top (required)>'

Finished in 1.59 seconds (files took 0.46885 seconds to load)
1075 examples, 3 failures

Failed examples:

rspec ./spec/examples/to_yaml_spec.rb[1:2] # IceCube::Schedule to_yaml should make a monthly round trip with to_yaml [#47]
rspec ./spec/examples/to_yaml_spec.rb:59 # IceCube::Schedule to_yaml should be able to make a round-trip to YAML with .day_of_month
rspec ./spec/examples/to_yaml_spec.rb:70 # IceCube::Schedule to_yaml should be able to make a round-trip to YAML with .day_of_week

They seem to be all related to time zone management in YAML.

@boutil
Copy link
Author

boutil commented Jul 28, 2020

This is because the time span of a few months for these tests from now include a change of time from Summer time to Winter time.

boutil added a commit to boutil/ice_cube that referenced this issue Nov 16, 2022
In some Debian environment two of the round trips in to_yaml_spec.rb were failing (those using `.month_of_year` and `day_of_year`. Applying the same fix as the one used in 4bf1718 to fix ice-cube-ruby#483 solved the issue.

This patch proposes that corresponding change to `/spec/examples/to_yaml_spec.rb`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant