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 FS event notifier test on mac and consolidate fs tests. #7410

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,8 @@ jobs:
if: contains(matrix.os, 'macos') == false && success()
run: tar --zstd -xf build.tar.zst

- name: platform/masterfs.macosx
if: contains(matrix.os, 'macos') && success()
run: .github/retry.sh ant $OPTS -f platform/masterfs.macosx test
- name: platform/masterfs
run: .github/retry.sh ant $OPTS -f platform/masterfs test

- name: Commit Validation tests
run: .github/retry.sh ant $OPTS -Dcluster.config=$CLUSTER_CONFIG commit-validation
Expand Down Expand Up @@ -1048,12 +1047,6 @@ jobs:
- name: platform/libs.junit4
run: ant $OPTS -f platform/libs.junit4 test

- name: platform/masterfs
run: .github/retry.sh ant $OPTS -f platform/masterfs test

- name: platform/masterfs.linux
run: ant $OPTS -f platform/masterfs.linux test

- name: platform/o.n.core
run: ant $OPTS -f platform/o.n.core test-unit

Expand Down
14 changes: 0 additions & 14 deletions platform/masterfs.linux/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,6 @@
<compile-dependency/>
</dependency>
</module-dependencies>
<test-dependencies>
<test-type>
<name>unit</name>
<test-dependency>
<code-name-base>org.netbeans.libs.junit4</code-name-base>
<compile-dependency/>
</test-dependency>
<test-dependency>
<code-name-base>org.netbeans.modules.nbjunit</code-name-base>
<recursive/>
<compile-dependency/>
</test-dependency>
</test-type>
</test-dependencies>
<public-packages/>
</data>
</configuration>
Expand Down

This file was deleted.

17 changes: 0 additions & 17 deletions platform/masterfs.macosx/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,6 @@
<compile-dependency/>
</dependency>
</module-dependencies>
<test-dependencies>
<test-type>
<name>unit</name>
<test-dependency>
<code-name-base>org.netbeans.insane</code-name-base>
<compile-dependency/>
</test-dependency>
<test-dependency>
<code-name-base>org.netbeans.libs.junit4</code-name-base>
<compile-dependency/>
</test-dependency>
<test-dependency>
<code-name-base>org.netbeans.modules.nbjunit</code-name-base>
<compile-dependency/>
</test-dependency>
</test-type>
</test-dependencies>
<public-packages/>
</data>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.netbeans.modules.masterfs.watcher.macosx;
package org.netbeans.modules.masterfs;

import java.io.File;
import java.util.concurrent.atomic.AtomicBoolean;
Expand All @@ -36,23 +36,26 @@
import org.openide.util.Utilities;

/**
* Test based in the LinuxNotifier235632Test test class
* Test for bug 235632.
*
* @author jhavlin
* @author Hector Espert
*/
public class OSXNotifierTest extends NbTestCase {
public class NotifierTest extends NbTestCase {

private File folder1;
private File folder1text1Txt;
private FileObject folder2FO;
private FileObject folder2text2TxtFO;

public OSXNotifierTest(String name) {
public NotifierTest(String name) {
super(name);
}

@Override
public boolean canRun() {
return super.canRun() && Utilities.getOperatingSystem() == Utilities.OS_MAC;
// FSEvent order isn't predictable on mac causing frequent test failures
return super.canRun() && Utilities.getOperatingSystem() != Utilities.OS_MAC;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.logging.Logger;
import java.util.zip.ZipEntry;
import javax.swing.filechooser.FileSystemView;
import org.junit.Assume;
import org.netbeans.junit.RandomlyFails;
import org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj;
import org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObjectFactory;
Expand Down Expand Up @@ -605,6 +606,7 @@ public void testCreateFolderOrDataFile_ReadOnly() throws Exception {
}

public void testCannotLockReadOnlyFile() throws Exception {
Assume.assumeFalse(Utilities.isWindows()); // TODO fails on win
clearWorkDir();
final File wDir = getWorkDir();
final File data = new File(wDir,"c.data");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import org.junit.Assume;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.masterfs.filebasedfs.Statistics;
import org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem;
Expand Down Expand Up @@ -1782,6 +1783,7 @@ public void run() {
}

public void testVirtualFOs() throws IOException {
Assume.assumeFalse(Utilities.isWindows()); // TODO fails on win
final FileObject wd = FileBasedFileSystem.getFileObject(getWorkDir());
FileObject nonExisting = wd.getFileObject("non-existing-folder/non-existing-folder/non-existing-child.xyz", false);
assertFalse(nonExisting.isValid());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,16 @@ public void testLockFile() throws IOException {
monitor.reset();
final FileLock lock = fobj.lock();
try {
// TODO fragile
int expectedCount = 0;
if (Utilities.isUnix()) {
// called File.toURI() from FileUtil.normalizeFile()
expectedCount = 1;
expectedCount++;
// sun.awt.PlatformGraphicsInfo.getDefaultHeadlessProperty probes a .so or .dylib
// Runtime.version().feature() > 18
if (Integer.parseInt(System.getProperty("java.version").split("\\.")[0]) > 18) {
expectedCount++;
}
}
// we check canWrite once
monitor.getResults().assertResult(1, StatFiles.WRITE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.net.*;
import java.nio.charset.StandardCharsets;
import java.util.logging.Level;
import org.junit.Assume;
import org.openide.util.Lookup.Result;

/**
Expand Down Expand Up @@ -3522,6 +3523,7 @@ public void testNonExistingFileObjectInFolder() throws Exception {
}

public void testNonExistingDoubleFileObjectInFolder() throws Exception {
Assume.assumeFalse(Utilities.isWindows()); // TODO fails on win
nonExistingFileObject("non-existing-folder/non-existing-folder/non-existing-child.xyz", 2);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,17 @@ public void checkDelete(String file) {
}

private boolean canBeSkipped() {
boolean result = false;
Throwable th = new Throwable();
StackTraceElement[] elems = th.getStackTrace();
for (StackTraceElement stackTraceElement : elems) {
if (stackTraceElement.getClassName().endsWith("ClassLoader") &&
(stackTraceElement.getMethodName().endsWith("loadClass") ||
stackTraceElement.getMethodName().endsWith("getResource"))) {
result = true;
break;
(stackTraceElement.getMethodName().endsWith("loadClass")
|| stackTraceElement.getMethodName().endsWith("getResource")
|| stackTraceElement.getMethodName().endsWith("loadLibrary"))) {
return true;
}
}
return result;
return false;
}

/** Add current stack trace to given map or increase count if the stack trace
Expand Down
Loading