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

Test failures due to CRLF and Symlink in cucumber-jvm installation tests when running in windows #2104

Closed
jdpennell opened this issue Aug 26, 2020 · 9 comments
Labels
good first issue Good for newcomers platform: windows 🙏 help wanted Help wanted - not prioritized by core team ⚡ enhancement Request for new functionality

Comments

@jdpennell
Copy link

jdpennell commented Aug 26, 2020

Describe the bug
When building in Windows using jdk 11.0.2, several tests in BannerTest, CommandLineOptionsParserTest, NoPublishFormatterTest, ResourceScannerTest, and UrlReporterTest fail due to CRLF (carriage return line feed) issues and symlink issues. Maven was launched from git bash.

BannerTest.results.txt
CommandLineOptionsParserTest.results.txt
NoPublishFormatterTest.results.txt
ResourceScannerTest.results.txt
UrlReporterTest.results.txt

To Reproduce
Steps to reproduce the behavior:

  1. Add the JDK 11 toolchain to Maven
  2. Clone cucumber-jvm to a local disk with no UNC paths
  3. In a Git Bash terminal, cd to the cucumber-jvm repository
  4. Run either GnuWin32 Make or mvn clean install

Expected behavior
The Core project builds without errors, or with errors unrelated to CRLF/LF differences between operating environments
The Core project builds without errors, or with errors unrelated to symlinks not being reported, unless symlink availability is the behavior under test. If performance with symlinks is under test, this test should be skipped if the OS does not support symlinks.

Context & Motivation

As an automated test engineer, I would like to be able to build and deploy cucumber to a managed workstation with an unpredictable environment, and I would like test result failures to not exhibit false positives so that important issues can be revealed by included tests.

Your Environment

  • commit 26d1ad7
  • Operating system : Windows 10
  • Build tool : Apache Maven 3.6.0
@jdpennell jdpennell added the 🐛 bug Defect / Bug label Aug 26, 2020
@jdpennell jdpennell changed the title CRLF and Symlink in cucumber-jvm installation tests Test failures due to CRLF and Symlink in cucumber-jvm installation tests when running in windows Aug 26, 2020
@mpkorstanje mpkorstanje added ⚡ enhancement Request for new functionality Hacktoberfest 🙏 help wanted Help wanted - not prioritized by core team good first issue Good for newcomers and removed 🐛 bug Defect / Bug labels Aug 26, 2020
@mpkorstanje
Copy link
Contributor

As an automated test engineer, I would like to be able to build and deploy cucumber to a managed workstation with an unpredictable environment, and I would like test result failures to not exhibit false positives so that important issues can be revealed by included tests.

Typically you'd use the artefacts uploaded to Maven Central. Any reason you're building your Cucumber locally?

@kgeilmann
Copy link
Contributor

Hello,

May I work on this?

@mpkorstanje
Copy link
Contributor

Sure! To make things a bit more manageable please submit one PR per class of problem. So one for the platform specific line endings and one for the symlinks.

@kgeilmann
Copy link
Contributor

Looking into it and as usual the first question is not far away.

Which java version should the source be? Is it ok to use methods available in Java 10+ in Tests? I'm confused, because mvn install does not complain if I do, but I see there is a base.java.version of 1.8 set in the toplevel pom.xml.

@mpkorstanje
Copy link
Contributor

The minimum supported jdk is still 8. However the jdk needed to build is 11.

@kgeilmann
Copy link
Contributor

For the symlinks:

I was able to reproduce it, and to successfully fix it, but it is more a windows + git issue than a coding issue.
In order to make it work, one has to enable symlinks in git before cloning and put windows into developer mode (see stackoverflow), then it works out of the box. I tried to create the symlink programatically, to at least remove the dependency on the git part, but it keeps telling me, that I don't have the rights to do so.

So I would propose, to either disable the test on windows using @DisabledOnOs(value = OS.WINDOWS)` or to add some notes about building on windows to CONTRIBUTING.md.
Any preferred solution?

@mpkorstanje
Copy link
Contributor

Disabling is probably the least complicated.

@kgeilmann
Copy link
Contributor

The core module builds now, but it still does not build on windows.
At least one more test in module cucumber-compatibility fails with a message looking like a similar problem

@kgeilmann
Copy link
Contributor

#2148 being merged, main branch builds out of the box on windows. I think , this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers platform: windows 🙏 help wanted Help wanted - not prioritized by core team ⚡ enhancement Request for new functionality
Projects
None yet
Development

No branches or pull requests

3 participants