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

mvn package runs into test failures on Windows #259

Closed
markusschuh opened this issue Sep 25, 2019 · 3 comments
Closed

mvn package runs into test failures on Windows #259

markusschuh opened this issue Sep 25, 2019 · 3 comments
Labels
bug Something isn't working java related to Java code, the Java Virtual Machine and directly related tooling (OpenJDK, Adoptium) test related to testing and QA windows specific for Microsoft Windows OS
Milestone

Comments

@markusschuh
Copy link
Member

Expected behavior

As a developer, I want to generate my own package including execution of included tests so that I can rely on a behavior of the software being compliant to the realized tests.

Actual behavior

A mvn package runs into test failures due to use of different conventions for path names during com.devonfw.tools.ide.configurator.ConfiguratorTest

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. Use windows 10 as build environment
  2. use mvn 3.6.1
  3. git clone ...
  4. cd ide
  5. mvn clean package

This results in errors as listed at end of issue.

Related/Dependent Issues

Comments/Hints:

As a workaround I can skip the tests. ( -Dmaven.test.skip=true)

As far as I understand the ConfiguratorTest code, this mismatch originates from the following difference:

  • The expecting value is generated from the Java code using the value as read from
private static final String DEVON_IDE_HOME = new File("").getAbsolutePath();
  • The compared value is generated by maven via expansion of the falling variable from the template for settings.json: ${client.env.home}

The first one generates - on windows - pathname using a single back slash, the second pathname (by maven) using double back slashes- valid in context, where back slash is an escape string. If there were some "compare canonical pathname" instead of a string compare, both would match. Currently they do not - on Windows only.

Affected version:

  • OS: Windows/Linux/Mac?
    Windows 10 (1903)
  • Browser: Chrome/Firefox/Safari?
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T21:00:29+02:00)
Maven home: ...
Java version: 11.0.4, vendor: AdoptOpenJDK, runtime: C:\Program Files\AdoptOpenJDK\jdk-11.0.4+11
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

An except of the output:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.devonfw.tools.ide.configurator.ConfiguratorTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.312 sec <<< FAILURE!
testConfigurator(com.devonfw.tools.ide.configurator.ConfiguratorTest)  Time elapsed: 0.24 sec  <<< FAILURE!
java.lang.AssertionError:
File:
  <C:\Users\auser\AppData\Local\Temp\.test.workspace\2019-09-25T11_30_14.044Z\json\settings.json>
read with charset <windows-1252> does not have the expected content:

Changed content at line 3:
expecting:
  ["    "java.home": "C:\work\devonfw-ide-test\configurator/software/java","]
but was:
  ["    "java.home": "C:\\work\\devonfw-ide-test\\configurator/software/java","]

Changed content at line 5:
expecting:
  ["        "bar": "C:\work\devonfw-ide-test\configurator/bar","]
but was:
  ["        "bar": "C:\\work\\devonfw-ide-test\\configurator/bar","]

Changed content at line 9:
expecting:
  ["            "C:\work\devonfw-ide-test\configurator""]
but was:
  ["            "C:\\work\\devonfw-ide-test\\configurator""]

Changed content at line 11:
expecting:
  ["        "foo": "C:\work\devonfw-ide-test\configurator/foo""]
but was:
  ["        "foo": "C:\\work\\devonfw-ide-test\\configurator/foo""]

        at com.devonfw.tools.ide.configurator.ConfiguratorTest.testConfigurator(ConfiguratorTest.java:67)
...
@markusschuh markusschuh added bug Something isn't working windows specific for Microsoft Windows OS test related to testing and QA java related to Java code, the Java Virtual Machine and directly related tooling (OpenJDK, Adoptium) labels Sep 25, 2019
@hohwille
Copy link
Member

hohwille commented Nov 1, 2019

Lovely, @markusschuh thanks for the feedback. As I switched to MacOS and the CI runs on linux, I got a black spot for windows here. Will fix that after the release is complete as it is "only" an internal issue.

@markusschuh
Copy link
Member Author

Sure - I might even better have used (small) enhancement than bug as label for this ...

@hohwille
Copy link
Member

hohwille commented Jan 9, 2020

Fixed with PR #334

@hohwille hohwille closed this as completed Jan 9, 2020
@hohwille hohwille added this to the release:3.3.0 milestone Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working java related to Java code, the Java Virtual Machine and directly related tooling (OpenJDK, Adoptium) test related to testing and QA windows specific for Microsoft Windows OS
Projects
None yet
Development

No branches or pull requests

2 participants