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 on on Windows: editorconfig returned a nonzero exit code #28

Closed
xuhdev opened this issue Jul 1, 2019 · 13 comments
Closed
Assignees
Labels

Comments

@xuhdev
Copy link
Member

xuhdev commented Jul 1, 2019

After 3d439da, multiline tests start to fail.

Example:

118/190 Testing: tab_width_default_ML
118/190 Test: tab_width_default_ML
Command: "C:/Program Files (x86)/CMake/bin/cmake.exe" "-D" "EDITORCONFIG_CMD=C:/projects/editorconfig-core-c/bin/x64-static/core/bin/editorconfig" "-D" "ECARGS:LIST=-f;tab_width_default.in;C:/projects/editorconfig-core-c/tests/properties/test.c" "-P" "C:/projects/editorconfig-core-c/tests/cmake/ec_sort.cmake"
Directory: C:/projects/editorconfig-core-c/bin/x64-static/core/tests/properties
"tab_width_default_ML" start time: Jul 01 01:11 Coordinated Universal Time
Output:
----------------------------------------------------------
CMake Error at C:/projects/editorconfig-core-c/tests/cmake/ec_sort.cmake:55 (message):
  C:/projects/editorconfig-core-c/bin/x64-static/core/bin/editorconfig
  -f;tab_width_default.in;C:/projects/editorconfig-core-c/tests/properties/test.c
  returned a nonzero exit code
<end of output>
Test time =   0.02 sec
----------------------------------------------------------
Test Fail Reason:
Required regular expression not found.Regex=[^[
]*indent_size=4[ 	]*[
]+indent_style=space[ 	]*[
]+tab_width=4[	
]*$
]
"tab_width_default_ML" end time: Jul 01 01:11 Coordinated Universal Time
"tab_width_default_ML" time elapsed: 00:00:00
----------------------------------------------------------

Here shows two Windows CI tests on editorconfig-core-c, one with the test submodule right before the commit, and one right after the commit.

@cxw42 Could you look into this, please?

@xuhdev
Copy link
Member Author

xuhdev commented Jul 2, 2019

@cxw42 #9 is likely a different issue, but this issue seems more urgent (CMake starts to fail on Windows after this commit)

@cxw42
Copy link
Member

cxw42 commented Jul 2, 2019

@xuhdev I see this is on the test-windows branch. What is the purpose of this branch? I'd like to know what the end goal is.

Both of the links you sent show as failures when I look at them -

I see the tab_width_default_ML failure in the second, but I don't see that test in the first at all.

Would you please double-check and let me know if those are the correct builds to look at? Thanks!

@xuhdev
Copy link
Member Author

xuhdev commented Jul 3, 2019

@cxw42 Because tab_width_default_ML was renamed from tab_width_default in 3d439da -- The first one succeeded but the second one failed. These two links correspond to two PRs:

Now it looks like the first link also failed one multiline test (which I did not notice before), but the second failed a lot of them.

@cxw42
Copy link
Member

cxw42 commented Jul 3, 2019

Thanks for the extra info. Is the test-windows branch just updating editorconfig-core-c to the latest tests?

@xuhdev
Copy link
Member Author

xuhdev commented Jul 3, 2019

@cxw42 No, the master has the latest test code. test-windows is a branch used in one of the above PRs.

@cxw42
Copy link
Member

cxw42 commented Jul 15, 2019

@xuhdev Would you please assign this to me? Thanks!

@xuhdev
Copy link
Member Author

xuhdev commented Jul 15, 2019

@cxw42 Done. Would like to be a developer of EditorConfig? I can add you in the Developer Team.

@cxw42
Copy link
Member

cxw42 commented Jul 18, 2019

@xuhdev Thank you for asking! I would be honored.

This problem seems to be related to the path to editorconfig.exe in some tests - it is in build\bin and core\bin\Release, but the meta test is looking in core\bin (example). I will see if I can figure out why.

@cxw42
Copy link
Member

cxw42 commented Jul 20, 2019

@xuhdev I have a proposed fix at https://github.com/cxw42/editorconfig-core-test/tree/cxwtest . It is not ready for a PR yet. However, would you be willing to try it out with a few cores and see what you find?

In the C core and core tests, I had to change the way EDITORCONFIG_CMD works in order to handle Debug vs. Release builds. In the new tests, =foo tells the core tests to use the result of CMake target foo as the editorconfig executable. Any name not starting with = has the old behaviour. I then use that = to switch to the COMMAND mode of add_test(), in which CMake itself figures out the executable name. The C core now uses the '=' form (https://github.com/cxw42/editorconfig-core-c/tree/cxwtest).

I also had to change the backslash escaping in the filetree test path_separator_backslash_in_cmd_line_regex. Edit That at least needs some sort of fixing (see here), but I am not completely sure yet what the right fix should be.

If you have any questions or comments, please let me know. Otherwise, I will clean up the repos in question and submit PRs (core-test first, then core-c).

@cxw42 cxw42 changed the title Multiline tests start failing on Windows after 3d439da3d03b1a28c3a2fe6d7172e8f6aa23ee74 Test failures on on Windows: editorconfig returned a nonzero exit code Jul 20, 2019
@cxw42 cxw42 added the bug label Jul 20, 2019
@xuhdev
Copy link
Member Author

xuhdev commented Jul 21, 2019

@cxw42 Sure. Could you send a WIP PR? We can look at the changes together there and it's probably easier.

@cxw42
Copy link
Member

cxw42 commented Oct 20, 2019

An example of the backslash problem - with cmake 3.14.5, on Cygwin, CMake generates the test differently for the C core than for the Vim plugin+core (!) (scroll right):

editorconfig-vim/tests/core/build/tests/filetree/CTestTestfile.cmake
36:add_test(path_separator_backslash_in_cmd_line "/home/cxw/proj/editorconfig-vim/tests/core/editorconfig" "-f" "path_separator.in" "/home/cxw/proj/editorconfig-vim/tests/core/tests/filetree\\path\\separator")
                                                                                                                                                                                              ^^ two backslashes
37:set_tests_properties(path_separator_backslash_in_cmd_line PROPERTIES  PASS_REGULAR_EXPRESSION "^[

editorconfig-core-c/build/tests/filetree/CTestTestfile.cmake
36:add_test(path_separator_backslash_in_cmd_line "/home/cxw/proj/editorconfig-core-c/build/bin/editorconfig.exe" "-f" "path_separator.in" "/home/cxw/proj/editorconfig-core-c/tests/filetree\\\\path\\\\separator")
                                                                                                                                                                                            ^^^^ four backslashes
37:set_tests_properties(path_separator_backslash_in_cmd_line PROPERTIES  PASS_REGULAR_EXPRESSION "^[
(END)

I am going to try generating the path string by concatenating strings with fixed ASCII values and see what happens.

cxw42 added a commit to cxw42/editorconfig-core-test that referenced this issue Oct 20, 2019
Fixes:
- editorconfig#28
- The warning at https://ci.appveyor.com/project/xuhdev/editorconfig-core-c/builds/28235086/job/u9ebs7f3b9u3gowk#L1660

Major changes:
- Always use add_test(NAME ... COMMAND ...)
  This is for consistency - add_test(NAME ... COMMAND ...)
  escapes differently than add_test(<name> <command>...).
- Fix backslash escaping
  Now that we are using the add_test(NAME ... COMMAND ...) form,
  backslash escaping works differently.  In my tests, backslashes
  are not collapsed in that form.
- Specify `-C Debug` on the `ctest` command line for the sake of
  the Visual Studio generator
cxw42 added a commit to cxw42/editorconfig-core-c that referenced this issue Oct 20, 2019
cxw42 added a commit to cxw42/editorconfig-core-test that referenced this issue Oct 20, 2019
Fixes:
- editorconfig#28
- The warning at https://ci.appveyor.com/project/xuhdev/editorconfig-core-c/builds/28235086/job/u9ebs7f3b9u3gowk#L1660

Major changes:
- Always use add_test(NAME ... COMMAND ...):
  This is for consistency - add_test(NAME ... COMMAND ...)
  escapes differently than add_test(<name> <command>...).
- Fix backslash escaping:
  Now that we are using the add_test(NAME ... COMMAND ...) form,
  backslash escaping works differently.  In my tests, backslashes
  are not collapsed in that form.
- Specify `-C Debug` on the `ctest` command line:
  This permits the Visual Studio generator to run tests.
cxw42 added a commit to cxw42/editorconfig-core-c that referenced this issue Oct 20, 2019
cxw42 added a commit to cxw42/editorconfig-core-test that referenced this issue Oct 21, 2019
Fixes:
- editorconfig#28
- The warning at https://ci.appveyor.com/project/xuhdev/editorconfig-core-c/builds/28235086/job/u9ebs7f3b9u3gowk#L1660

Major changes:
- Always use add_test(NAME ... COMMAND ...):
  This is for consistency - add_test(NAME ... COMMAND ...)
  escapes differently than add_test(<name> <command>...).
- Fix backslash escaping:
  Now that we are using the add_test(NAME ... COMMAND ...) form,
  backslash escaping works differently.  In my tests, backslashes
  are not collapsed in that form.
- Specify `-C Debug` on the `ctest` command line:
  This permits the Visual Studio generator to run tests.
cxw42 added a commit to cxw42/editorconfig-core-c that referenced this issue Oct 21, 2019
xuhdev pushed a commit that referenced this issue Oct 21, 2019
Fixes:
- #28
- The warning at https://ci.appveyor.com/project/xuhdev/editorconfig-core-c/builds/28235086/job/u9ebs7f3b9u3gowk#L1660

Major changes:
- Always use add_test(NAME ... COMMAND ...):
  This is for consistency - add_test(NAME ... COMMAND ...)
  escapes differently than add_test(<name> <command>...).
- Fix backslash escaping:
  Now that we are using the add_test(NAME ... COMMAND ...) form,
  backslash escaping works differently.  In my tests, backslashes
  are not collapsed in that form.
- Specify `-C Debug` on the `ctest` command line:
  This permits the Visual Studio generator to run tests.
@xuhdev
Copy link
Member Author

xuhdev commented Oct 21, 2019

Fixed by 48610d4

@xuhdev xuhdev closed this as completed Oct 21, 2019
cxw42 added a commit to cxw42/editorconfig-core-c that referenced this issue Oct 22, 2019
xuhdev pushed a commit to editorconfig/editorconfig-core-c that referenced this issue Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@xuhdev @cxw42 and others