Skip to content

[Compatibility] Fix platform dependent tests #2148

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

Merged
merged 3 commits into from
Oct 10, 2020

Conversation

kgeilmann
Copy link
Contributor

Is your pull request related to a problem? Please describe.

This should fix all remaining problems with building under windows #2104

Describe the solution you have implemented

  • Disabled scanForResourcesDirectorySymlink test on windows, because it suffers from the same problem as the already disabled scanForResourcesPathSymlink test

To make build work out of the box on windows the following two changes were done:

  • Set maven configuration, such that maven is always called with the file encoding set to UTF-8. This is needed, because in the generated I18N sourcefiles use UTF-8 based filenames, which are otherwise not correctly passed to the compiler.
  • Ensure, that git does not do end-of-line conversion on the resource files in the compatibility module. If it does, the feature file gets converted and comparing it bytewise to the provided expected values fails.

Kathrin Geilmann added 3 commits October 8, 2020 23:52
… only works if the repository was cloned with symlinks activated and windows being in developer mode.
… ensures that the generated sources with UTF-8 filenames like Når.java are correctly handled by maven, when running on operating system with another default encoding (e.g. windows)
…y fail.

The default configuration of git on windows is to let git do end-of-line conversion, i.e. converting between LF in the repository and CRLF in the working tree. If this happens on the feature files in this directory, tests fail, because the test will read the feature file (with crlf line endings) and compare it to the files describing the expected outcome (containing only lf).
@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.531% when pulling 8037a6c on kgeilmann:fix_build_on_windows into a858b7d on cucumber:main.

@mpkorstanje mpkorstanje changed the title Fix remaining build problems on windows [Acceptance] Fix platform dependent tests Oct 10, 2020
@mpkorstanje mpkorstanje changed the title [Acceptance] Fix platform dependent tests [Compatibility] Fix platform dependent tests Oct 10, 2020
@mpkorstanje mpkorstanje merged commit 5fd93e8 into cucumber:main Oct 10, 2020
@@ -0,0 +1 @@
-Dfile.encoding=UTF-8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty neat!

@@ -0,0 +1,3 @@
# Ensure that LF line endings are kept on checkout (even on windows). Tests will fail otherwise
*.ndjson text eol=lf
*.feature text eol=lf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@mpkorstanje
Copy link
Contributor

Thanks again. Much appreciated!

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 this pull request may close these issues.

3 participants