Skip to content

Fix tests failure due to CRLF mismatch on Windows in java.hints, java.source.base#7910

Merged
mbien merged 1 commit intoapache:masterfrom
sid-srini:fix_tests_crlf_mismatch_windows
Oct 29, 2024
Merged

Fix tests failure due to CRLF mismatch on Windows in java.hints, java.source.base#7910
mbien merged 1 commit intoapache:masterfrom
sid-srini:fix_tests_crlf_mismatch_windows

Conversation

@sid-srini
Copy link
Copy Markdown
Contributor

@sid-srini sid-srini commented Oct 26, 2024

Fixed tests failures in the modules java.hints and java.source.base on Windows due to CRLF-LF mismatches between the expected and actual outputs.

  1. VanillaCompileWorkerTest.java:
    • transform System.lineSeparator() to LF on the actual outputs.
  2. TreeRuleTestBase.java:
    • change the "ignore whitespace" transformation of the actual output to use \\s+ instead of only tabs and LFs.
  3. .gitattributes:
    • Mark all test golden files i.e. expected outputs, in the java.hints module to have only LF line endings.
    • This aids tests extending TreeRuleTestBase
    • Thanks to @mbien for guidance on this.

@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) tests labels Oct 26, 2024
@apache apache locked and limited conversation to collaborators Oct 26, 2024
@apache apache unlocked this conversation Oct 26, 2024
@mbien mbien added this to the NB25 milestone Oct 26, 2024
….source.base

Fixed tests failures in the modules java.hints and java.source.base on
Windows due to CRLF-LF mismatches between the expected and actual
outputs.

1. *VanillaCompileWorkerTest.java*:
    - transform `System.lineSeparator()` to LF on the actual outputs.
2. *TreeRuleTestBase.java*:
    - change the "ignore whitespace" transformation of the actual output
      to use `\\s+` instead of only tabs and LFs.
3. *.gitattributes*:
    - Mark all test golden files i.e. expected outputs, in the
      java.hints module to have only LF line endings.
    - This aids tests extending *TreeRuleTestBase*
    - Thanks to @mbien for guidance on this.

Signed-off-by: Siddharth Srinivasan <siddharth.srinivasan@oracle.com>
@sid-srini sid-srini force-pushed the fix_tests_crlf_mismatch_windows branch from 803dba7 to f7fe71f Compare October 28, 2024 02:44
Copy link
Copy Markdown
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

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

looks good, thanks!

@mbien mbien merged commit 635860e into apache:master Oct 29, 2024
@sid-srini sid-srini deleted the fix_tests_crlf_mismatch_windows branch October 30, 2024 02:44
Achal1607 pushed a commit to Achal1607/netbeans that referenced this pull request Feb 21, 2025
1. Adding the patch for netbeans PR apache#7910 to prevent tests failures
due to CRLF line endings.
2. Added the use of the extension configuration prefix "jdk" in
   ServerTest, as had been done for java.lsp.server/ AttachConfigurations.java
   and ProjectConfigurationCompletion.java, via the
   patch/rename-debugger.diff.

Signed-off-by: Siddharth Srinivasan <siddharth.srinivasan@oracle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants