Skip to content

Disable JabLib tests not working on Windows#12869

Merged
subhramit merged 16 commits into
mainfrom
disable-win-tests
May 13, 2025
Merged

Disable JabLib tests not working on Windows#12869
subhramit merged 16 commits into
mainfrom
disable-win-tests

Conversation

@koppor

@koppor koppor commented Mar 31, 2025

Copy link
Copy Markdown
Member

With this PR, all tests in :test should work on Window

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • [/] Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • [/] Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • [/] Screenshots added in PR description (if change is visible to the user)
  • [/] Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • [/] Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

Comment on lines +50 to +52
void tearDown() {
this.indexer.closeAndWait();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The tearDown method is unnecessary when using @tempdir, as JUnit automatically handles cleanup of temporary directories. This violates the instruction to avoid redundant cleanup.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No. The indexer locks the directory!

@koppor

koppor commented Apr 1, 2025

Copy link
Copy Markdown
Member Author

Together with #12868, maybe we can get rid of this one?

image

@koppor koppor requested review from Siedlerchr and subhramit April 1, 2025 21:06
@subhramit

Copy link
Copy Markdown
Member

Together with #12868, maybe we can get rid of this one?

Yes, there is a lot of overlap right now between the bot texts and FAQ page.

@github-actions

github-actions Bot commented Apr 4, 2025

Copy link
Copy Markdown
Contributor

The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build.

@subhramit

Copy link
Copy Markdown
Member

I still get 31 failing tests
image
image

@Siedlerchr

Copy link
Copy Markdown
Member

What is the status here?

@koppor

koppor commented Apr 10, 2025

Copy link
Copy Markdown
Member Author

What is the status here?

Someone needs to go through the failing tests and decide whether they should be fixed or if it can be disabled.

I plan to do it as soon as I find time.

@koppor koppor marked this pull request as draft April 10, 2025 16:12
auto-merge was automatically disabled April 10, 2025 16:12

Pull request was converted to draft

@koppor

koppor commented Apr 17, 2025

Copy link
Copy Markdown
Member Author

Side track: These tests take really long - I don't understand why

grafik

@koppor

koppor commented Apr 17, 2025

Copy link
Copy Markdown
Member Author

I used gradle (!) to run the tests - result:

grafik

@koppor

koppor commented May 11, 2025

Copy link
Copy Markdown
Member Author

@subhramit Could you re-check. I tested "only" the "main" tests, not fetcher or database tests - and jablib only.

I cannot run jabkit tests on Windows - command line too long. 🙈


assertEquals("/home/user/test.blg;", serialized.get("blgFilePath-" + user));
// On Windows, the path separator is a backslash, which is escaped in JabRef (see org.jabref.logic.exporter.MetaDataSerializer.serializeMetaData)
assertEquals(blgPath.toString().replace("\\", "\\\\") + ";", serialized.get("blgFilePath-" + user));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The comment above the assertion is trivial as it restates the code logic. Comments should provide additional context or reasoning, not describe the code.

@koppor koppor added the dev: testing Related to tests label May 11, 2025
@koppor koppor changed the title Disable test not working on Windows Disable JabLib tests not working on Windows May 12, 2025
@koppor

koppor commented May 12, 2025

Copy link
Copy Markdown
Member Author

I also added separate Windows tests for the basic JabLib functionality on Windows to enable automated checking


public class DisabledOnCIServerWindowsCondition implements ExecutionCondition {

private static final ConditionEvaluationResult ENABLED = ConditionEvaluationResult.enabled("Running not on Windows or not on CI server");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The string message should be sentence case and end with a period to maintain consistency and readability across the codebase.

@koppor koppor marked this pull request as ready for review May 12, 2025 17:02
@koppor koppor enabled auto-merge May 12, 2025 17:02
@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 12, 2025
Map<String, String> serialized = MetaDataSerializer.getSerializedStringMap(metaData, pattern);

assertEquals("/home/user/test.blg;", serialized.get("blgFilePath-" + user));
// On Windows, the path separator is a backslash, which is escaped in JabRef (see org.jabref.logic.exporter.MetaDataSerializer.serializeMetaData)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The comment is trivial as it restates the code logic without adding new information or reasoning. Comments should provide insights not directly derivable from the code.

}

@Test
@DisabledOnOs(value = org.junit.jupiter.api.condition.OS.WINDOWS, disabledReason = "Assumed path separator is /")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The use of @DisabledOnOs annotation is correct, but the reason provided is trivial and does not add new information. It should provide a more meaningful explanation.

@koppor koppor added this pull request to the merge queue May 13, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 13, 2025
@subhramit subhramit enabled auto-merge May 13, 2025 16:12
@trag-bot

trag-bot Bot commented May 13, 2025

Copy link
Copy Markdown

@trag-bot didn't find any issues in the code! ✅✨

@subhramit subhramit added this pull request to the merge queue May 13, 2025
Merged via the queue into main with commit 56f6c89 May 13, 2025
2 checks passed
@subhramit subhramit deleted the disable-win-tests branch May 13, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev: testing Related to tests platform: windows status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants