Skip to content

Commit

Permalink
wip/test: experiments to test limits of gh actions failures
Browse files Browse the repository at this point in the history
  • Loading branch information
bogovicj committed Oct 8, 2024
1 parent bee3f16 commit e35efc0
Showing 1 changed file with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package org.janelia.saalfeldlab.n5.exps;

import static org.junit.Assert.assertNotNull;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;

import org.janelia.saalfeldlab.n5.DataType;
import org.janelia.saalfeldlab.n5.DatasetAttributes;
import org.janelia.saalfeldlab.n5.N5FSReader;
import org.janelia.saalfeldlab.n5.N5FSWriter;
import org.janelia.saalfeldlab.n5.RawCompression;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

public class GithubActionsIssues {

private static File baseDir;

@BeforeClass
public static void before() {

try {
baseDir = Files.createTempDirectory("n5-ij-tests-").toFile();
baseDir.deleteOnExit();
} catch (IOException e) {
e.printStackTrace();
}

}

@AfterClass
public static void after() {

baseDir.delete();
}

@Test
public void n5WriteRead() {

try (final N5FSWriter n5w = new N5FSWriter(baseDir.getAbsolutePath())) {

for (int i = 0; i < 50; i++) {

final String dset = String.format("%04d", i);
n5w.createDataset(dset,
new DatasetAttributes(new long[]{6, 5, 4}, new int[]{6, 5, 4}, DataType.FLOAT32, new RawCompression()));

try (final N5FSReader n5r = new N5FSReader(baseDir.getAbsolutePath())) {

final DatasetAttributes attrs = n5r.getDatasetAttributes(dset);
assertNotNull("null attrs for dataset: " + dset , attrs);
n5r.close();
n5w.remove(dset);
}
}
n5w.remove();
n5w.close();
}
}

}

0 comments on commit e35efc0

Please sign in to comment.