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

Disable/fix some tests on Windows #9811

Merged
merged 3 commits into from May 18, 2023
Merged

Conversation

zbynek
Copy link
Contributor

@zbynek zbynek commented Mar 24, 2023

Disables tests that fail on Windows because of filesystem specifics, fixes one test.

public void testIgnoresHiddenDirectories() throws IOException {
// Setup a /tmp/.svn/ShouldNotBeFound.java folder structure.
File tempDir = Files.createTempDir();
File nestedHiddenDir = new File(tempDir, ".svn");
nestedHiddenDir.mkdir();
File javaFile = new File(nestedHiddenDir, "ShouldNotBeFound.java");
javaFile.createNewFile();
// windows needs the hidden attribute to be set on file (not parent directory)
java.nio.file.Files.setAttribute(javaFile.toPath(), "dos:hidden", Boolean.TRUE);
Copy link
Member

Choose a reason for hiding this comment

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

How about using Files.getFileAttributeView(javaFile.toPath(), DosFileAttributeView.class) and if it's non-null then call setHidden(true)?

import java.util.Set;

/**
* Tests for ResourceAccumulator.
*/
public class ResourceAccumulatorTest extends TestCase {

private final static boolean IS_WINDOWS = System.getProperty("os.name")
Copy link
Member

Choose a reason for hiding this comment

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

Do we have commons-lang3 in the classpath? We could use SystemUtils.IS_OS_WINDOWS then.

@niloc132 niloc132 requested a review from tbroyer May 17, 2023 14:16
@niloc132
Copy link
Contributor

There are two new style warnings, could you fix those?

Copy link
Member

@tbroyer tbroyer left a comment

Choose a reason for hiding this comment

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

LGTM (besides style issues)

@niloc132 niloc132 merged commit 4f49137 into gwtproject:main May 18, 2023
2 checks passed
@zbynek zbynek deleted the win-tests branch May 18, 2023 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants