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

Fix Appveyor with DST-aware cucumber steps #5961

Merged
merged 2 commits into from Mar 27, 2017

Conversation

Projects
None yet
4 participants
@ashmaroli
Member

ashmaroli commented Mar 17, 2017

Fix recent failures in AppVeyor that occurred due to ENV["TZ"] being set on Windows with tzinfo gem with DST-aware cucumber steps.

@DirtyF DirtyF added the tests label Mar 20, 2017

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli Mar 22, 2017

Member

/cc @parkr since you're back in office..

Member

ashmaroli commented Mar 22, 2017

/cc @parkr since you're back in office..

And I should see "Post Layout: <p>content for entry1.</p>\n built at 2013-04-09T23:22:00-04:00" in "_site/2013/04/09/entry1.html" unless Windows
And I should see "Post Layout: <p>content for entry1.</p>\n built at 2013-04-09T22:22:00-05:00" in "_site/2013/04/09/entry1.html" if on Windows
And I should see "Post Layout: <p>content for entry2.</p>\n built at 2013-04-10T03:14:00-04:00" in "_site/2013/04/10/entry2.html" unless Windows
And I should see "Post Layout: <p>content for entry2.</p>\n built at 2013-04-10T02:14:00-05:00" in "_site/2013/04/10/entry2.html" if on Windows

This comment has been minimized.

@parkr

parkr Mar 23, 2017

Member

We also want to see the Post Layout: <p> content for entry... here. Feel free to add that assertion above each of these to ensure we don't accidentally cause regressions.

@parkr

parkr Mar 23, 2017

Member

We also want to see the Post Layout: <p> content for entry... here. Feel free to add that assertion above each of these to ensure we don't accidentally cause regressions.

This comment has been minimized.

@ashmaroli

ashmaroli Mar 23, 2017

Member

okay, will do.

@ashmaroli

ashmaroli Mar 23, 2017

Member

okay, will do.

step %(the "#{file}" file should exist)
regexp = Regexp.new(text)
if Jekyll::Utils::Platforms.really_windows? && !dst_active?
expect(file_contents(file)).not_to match regexp

This comment has been minimized.

@parkr

parkr Mar 23, 2017

Member

Why are you using the negative here?

@parkr

parkr Mar 23, 2017

Member

Why are you using the negative here?

This comment has been minimized.

@ashmaroli

ashmaroli Mar 23, 2017

Member

Because the regex 2013-04-10T03:14:00-04:00 will match actual value when:

  • The Platform is Windows and in an active DST Zone.
  • The Platform is not Windows.

So this step is:

if !Jekyll::Utils::Platforms.really_windows?
  expect(file_contents(file)).to match regexp
elsif Jekyll::Utils::Platforms.really_windows? && dst_active?
  expect(file_contents(file)).to match regexp
else
  expect(file_contents(file)).not_to match regexp
end

which could be shortened to ( but may hamper readability ):

if (!Jekyll::Utils::Platforms.really_windows?) ||
  (Jekyll::Utils::Platforms.really_windows? && dst_active?)
  expect(file_contents(file)).to match regexp
else
  expect(file_contents(file)).not_to match regexp
end

which could be alternatively written in the negative as:

if Jekyll::Utils::Platforms.really_windows? && !dst_active?
  expect(file_contents(file)).not_to match regexp
else
  expect(file_contents(file)).to match regexp
end
@ashmaroli

ashmaroli Mar 23, 2017

Member

Because the regex 2013-04-10T03:14:00-04:00 will match actual value when:

  • The Platform is Windows and in an active DST Zone.
  • The Platform is not Windows.

So this step is:

if !Jekyll::Utils::Platforms.really_windows?
  expect(file_contents(file)).to match regexp
elsif Jekyll::Utils::Platforms.really_windows? && dst_active?
  expect(file_contents(file)).to match regexp
else
  expect(file_contents(file)).not_to match regexp
end

which could be shortened to ( but may hamper readability ):

if (!Jekyll::Utils::Platforms.really_windows?) ||
  (Jekyll::Utils::Platforms.really_windows? && dst_active?)
  expect(file_contents(file)).to match regexp
else
  expect(file_contents(file)).not_to match regexp
end

which could be alternatively written in the negative as:

if Jekyll::Utils::Platforms.really_windows? && !dst_active?
  expect(file_contents(file)).not_to match regexp
else
  expect(file_contents(file)).to match regexp
end
@parkr

parkr approved these changes Mar 27, 2017

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Mar 27, 2017

Member

@jekyllbot: merge +dev

Member

parkr commented Mar 27, 2017

@jekyllbot: merge +dev

@jekyllbot jekyllbot merged commit e5317ce into jekyll:master Mar 27, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

jekyllbot added a commit that referenced this pull request Mar 27, 2017

Crissov added a commit to Crissov/jekyll that referenced this pull request Mar 27, 2017

parkr added a commit that referenced this pull request Mar 28, 2017

add /_data/*.tsv support (#5985)
* Update data.feature

- add .tsv
- add .csv with `\t`
- add .csv with `;`

* Fix Appveyor with dst-aware cucumber steps

* Check for given content in posts

* mention Ruby > 2.1.0 in docs

* Update history to reflect merge of #5983 [ci skip]

* Update history to reflect merge of #5961 [ci skip]

* Update data_reader.rb

- add .tsv support with tab separated columns
- not adding support for auto-detecting `:col_sep`

ftp://ftp.iana.org/assignments/media-types/text/tab-separated-values
https://www.ietf.org/rfc/rfc4180.txt (CSV)
https://ruby-doc.org/stdlib-2.4.1/libdoc/csv/rdoc/CSV.html

* Update data.feature

don't do semicolons and tabs in .csv within this patch

* Update data.feature

I don't know which component replaced my tab characters by space before.

* Update data.feature

t

* Update data_reader.rb

add a single space to satisfy format checker

@ashmaroli ashmaroli deleted the ashmaroli:cucumber-win-fix branch Mar 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment