Skip to content

Commit

Permalink
Merge pull request #20 from fizzed/feature/cross-tests
Browse files Browse the repository at this point in the history
Feature/cross tests
  • Loading branch information
jjlauer authored Jan 9, 2025
2 parents a06f701 + f325739 commit 69060b4
Show file tree
Hide file tree
Showing 27 changed files with 159 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .blaze/blaze.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
blaze.dependencies = [
"com.fizzed:blaze-ssh"
"com.fizzed:buildx:1.0.7"
"com.fizzed:jne:4.1.1"
]

Expand Down
24 changes: 24 additions & 0 deletions .blaze/blaze.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import com.fizzed.blaze.Config;
import com.fizzed.blaze.Contexts;
import com.fizzed.blaze.Task;
import com.fizzed.buildx.Buildx;
import com.fizzed.buildx.Target;
import com.fizzed.jne.HardwareArchitecture;
import com.fizzed.jne.JavaHome;
import com.fizzed.jne.JavaHomeFinder;
Expand Down Expand Up @@ -87,4 +89,26 @@ public void test_all_jdks() throws Exception {
jdks.forEach(jdk -> log.info(" {}", jdk));
}

private final List<Target> crossTestTargets = asList(
new Target("linux", "x64").setTags("test").setHost("build-x64-linux-latest"),
new Target("linux", "arm64").setTags("test").setHost("build-arm64-linux-latest"),
new Target("linux", "riscv64").setTags("test").setHost("build-riscv64-linux-latest"),
new Target("macos", "x64").setTags("test").setHost("build-x64-macos-latest"),
new Target("macos", "arm64").setTags("test").setHost("build-arm64-macos-latest"),
new Target("windows", "x64").setTags("test").setHost("build-x64-windows-latest"),
new Target("windows", "arm64").setTags("test").setHost("build-arm64-windows-latest"),
new Target("freebsd", "x64").setTags("test").setHost("build-x64-freebsd-latest"),
new Target("openbsd", "x64").setTags("test").setHost("build-x64-openbsd-latest")
);

@Task(order = 1)
public void cross_tests() throws Exception {
new Buildx(crossTestTargets)
.tags("test")
.execute((target, project) -> {
project.action("mvn", "clean", "test")
.run();
});
}

}
10 changes: 10 additions & 0 deletions .blaze/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@
<artifactId>zt-exec</artifactId>
<version>1.12</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>blaze-ssh</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>buildx</artifactId>
<version>1.0.7</version>
</dependency>
<dependency>
<groupId>com.fizzed</groupId>
<artifactId>jne</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MacOS x64
name: MacOS arm64
on:
- push
- workflow_dispatch
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ target
*.iml
nb-configuration.xml
.idea
.buildx
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,28 @@

[![Maven Central](https://img.shields.io/maven-central/v/com.fizzed/bigmap?color=blue&style=flat-square)](https://mvnrepository.com/artifact/com.fizzed/bigmap)

## Automated Testing

The following Java versions and platforms are tested using GitHub workflows:

[![Java 8](https://img.shields.io/github/actions/workflow/status/fizzed/bigmap/java8.yaml?branch=master&label=Java%208&style=flat-square)](https://github.com/fizzed/bigmap/actions/workflows/java8.yaml)
[![Java 11](https://img.shields.io/github/actions/workflow/status/fizzed/bigmap/java11.yaml?branch=master&label=Java%2011&style=flat-square)](https://github.com/fizzed/bigmap/actions/workflows/java11.yaml)
[![Java 17](https://img.shields.io/github/actions/workflow/status/fizzed/bigmap/java17.yaml?branch=master&label=Java%2017&style=flat-square)](https://github.com/fizzed/bigmap/actions/workflows/java17.yaml)
[![Java 21](https://img.shields.io/github/actions/workflow/status/fizzed/bigmap/java21.yaml?branch=master&label=Java%2021&style=flat-square)](https://github.com/fizzed/bigmap/actions/workflows/java21.yaml)

[![Linux x64](https://img.shields.io/github/actions/workflow/status/fizzed/bigmap/java11.yaml?branch=master&label=Linux%20x64&style=flat-square)](https://github.com/fizzed/bigmap/actions/workflows/java11.yaml)
[![MacOS x64](https://img.shields.io/github/actions/workflow/status/fizzed/bigmap/macos-x64.yaml?branch=master&label=MacOS%20x64&style=flat-square)](https://github.com/fizzed/bigmap/actions/workflows/macos-x64.yaml)
[![MacOS arm64](https://img.shields.io/github/actions/workflow/status/fizzed/bigmap/macos-arm64.yaml?branch=master&label=MacOS%20arm64&style=flat-square)](https://github.com/fizzed/bigmap/actions/workflows/macos-arm64.yaml)
[![Windows x64](https://img.shields.io/github/actions/workflow/status/fizzed/bigmap/windows-x64.yaml?branch=master&label=Windows%20x64&style=flat-square)](https://github.com/fizzed/bigmap/actions/workflows/windows-x64.yaml)

The following platforms are tested using the [Fizzed, Inc.](http://fizzed.com) build system:

![Linux arm64](https://img.shields.io/badge/Linux%20arm64-passing-green)
![Linux riscv64](https://img.shields.io/badge/Linux%20riscv64-passing-green)
![MacOS x64](https://img.shields.io/badge/MacOS%20x64-passing-green)
![Windows arm64](https://img.shields.io/badge/Windows%20arm64-passing-green)
![FreeBSD x64](https://img.shields.io/badge/FreeBSD%20x64-passing-green)
![OpenBSD x64](https://img.shields.io/badge/OpenBSD%20x64-passing-green)

## Overview

Lightweight Map, SortedMap, LinkedMap, Set, and SortedSet implementation(s) with minimal 3rd party dependencies that alleviates memory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.fizzed.bigmap;

import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.nio.file.Files;
import java.util.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,25 @@
package com.fizzed.bigmap;

import com.fizzed.bigmap.rocksdb.RocksBigLinkedMapBuilder;
import com.fizzed.jne.HardwareArchitecture;
import com.fizzed.jne.NativeTarget;
import com.fizzed.jne.OperatingSystem;
import org.junit.jupiter.api.condition.DisabledIf;

import java.nio.file.Paths;
import java.util.Map;

@DisabledIf("isUnsupportedOs")
public class RocksBigLinkedMapTest extends AbstractBigLinkedMapTest {

static public boolean isUnsupportedOs() {
final NativeTarget current = NativeTarget.detect();
return current.getOperatingSystem() == OperatingSystem.FREEBSD
|| current.getOperatingSystem() == OperatingSystem.OPENBSD
|| (current.getOperatingSystem() == OperatingSystem.WINDOWS && current.getHardwareArchitecture() == HardwareArchitecture.ARM64)
|| (current.getOperatingSystem() == OperatingSystem.LINUX && current.getHardwareArchitecture() == HardwareArchitecture.RISCV64);
}

@Override
public <K,V> Map<K, V> newMap(Class<K> keyType, Class<V> valueType) {
return new RocksBigLinkedMapBuilder<K,V>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,25 @@
package com.fizzed.bigmap;

import com.fizzed.bigmap.rocksdb.RocksBigLinkedSetBuilder;
import com.fizzed.jne.HardwareArchitecture;
import com.fizzed.jne.NativeTarget;
import com.fizzed.jne.OperatingSystem;
import org.junit.jupiter.api.condition.DisabledIf;

import java.nio.file.Paths;
import java.util.Set;

@DisabledIf("isUnsupportedOs")
public class RocksBigLinkedSetTest extends AbstractBigLinkedSetTest {

static public boolean isUnsupportedOs() {
final NativeTarget current = NativeTarget.detect();
return current.getOperatingSystem() == OperatingSystem.FREEBSD
|| current.getOperatingSystem() == OperatingSystem.OPENBSD
|| (current.getOperatingSystem() == OperatingSystem.WINDOWS && current.getHardwareArchitecture() == HardwareArchitecture.ARM64)
|| (current.getOperatingSystem() == OperatingSystem.LINUX && current.getHardwareArchitecture() == HardwareArchitecture.RISCV64);
}

@Override
public <V> Set<V> newSet(Class<V> valueType) {
return new RocksBigLinkedSetBuilder<V>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,25 @@
package com.fizzed.bigmap;

import com.fizzed.bigmap.rocksdb.RocksBigMapBuilder;
import com.fizzed.jne.HardwareArchitecture;
import com.fizzed.jne.NativeTarget;
import com.fizzed.jne.OperatingSystem;
import org.junit.jupiter.api.condition.DisabledIf;

import java.nio.file.Paths;
import java.util.Map;

@DisabledIf("isUnsupportedOs")
public class RocksBigMapTest extends AbstractBigMapTest {

static public boolean isUnsupportedOs() {
final NativeTarget current = NativeTarget.detect();
return current.getOperatingSystem() == OperatingSystem.FREEBSD
|| current.getOperatingSystem() == OperatingSystem.OPENBSD
|| (current.getOperatingSystem() == OperatingSystem.WINDOWS && current.getHardwareArchitecture() == HardwareArchitecture.ARM64)
|| (current.getOperatingSystem() == OperatingSystem.LINUX && current.getHardwareArchitecture() == HardwareArchitecture.RISCV64);
}

@Override
public <K,V> Map<K, V> newMap(Class<K> keyType, Class<V> valueType) {
return new RocksBigMapBuilder<K,V>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,25 @@
package com.fizzed.bigmap;

import com.fizzed.bigmap.rocksdb.RocksBigSetBuilder;
import com.fizzed.jne.HardwareArchitecture;
import com.fizzed.jne.NativeTarget;
import com.fizzed.jne.OperatingSystem;
import org.junit.jupiter.api.condition.DisabledIf;

import java.nio.file.Paths;
import java.util.Set;

@DisabledIf("isUnsupportedOs")
public class RocksBigSetTest extends AbstractBigSetTest {

static public boolean isUnsupportedOs() {
final NativeTarget current = NativeTarget.detect();
return current.getOperatingSystem() == OperatingSystem.FREEBSD
|| current.getOperatingSystem() == OperatingSystem.OPENBSD
|| (current.getOperatingSystem() == OperatingSystem.WINDOWS && current.getHardwareArchitecture() == HardwareArchitecture.ARM64)
|| (current.getOperatingSystem() == OperatingSystem.LINUX && current.getHardwareArchitecture() == HardwareArchitecture.RISCV64);
}

@Override
public <V> Set<V> newSet(Class<V> valueType) {
return new RocksBigSetBuilder<V>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
package com.fizzed.bigmap;

import com.fizzed.bigmap.tkrzw.TkrzwBigLinkedMapBuilder;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import java.nio.file.Paths;
import java.util.Map;

@DisabledOnOs({ OS.FREEBSD, OS.OPENBSD })
public class TkrzwBigLinkedMapTest extends AbstractBigLinkedMapTest {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
package com.fizzed.bigmap;

import com.fizzed.bigmap.tkrzw.TkrzwBigLinkedSetBuilder;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import java.nio.file.Paths;
import java.util.Set;

@DisabledOnOs({ OS.FREEBSD, OS.OPENBSD })
public class TkrzwBigLinkedSetTest extends AbstractBigLinkedSetTest {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
package com.fizzed.bigmap;

import com.fizzed.bigmap.tkrzw.TkrzwBigMapBuilder;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import java.nio.file.Paths;
import java.util.Map;

@DisabledOnOs({ OS.FREEBSD, OS.OPENBSD })
public class TkrzwBigMapTest extends AbstractBigMapTest {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
package com.fizzed.bigmap;

import com.fizzed.bigmap.tkrzw.TkrzwBigSetBuilder;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import java.nio.file.Paths;
import java.util.Set;

@DisabledOnOs({ OS.FREEBSD, OS.OPENBSD })
public class TkrzwBigSetTest extends AbstractBigSetTest {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.nio.file.Paths;
import java.util.Map;

@DisabledOnOs(value=OS.WINDOWS, disabledReason="TokyoCabinet does not support windows")
@DisabledOnOs({ OS.WINDOWS, OS.FREEBSD, OS.OPENBSD })
public class TokyoBigLinkedMapTest extends AbstractBigLinkedMapTest {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.nio.file.Paths;
import java.util.Set;

@DisabledOnOs(value=OS.WINDOWS, disabledReason="TokyoCabinet does not support windows")
@DisabledOnOs({ OS.WINDOWS, OS.FREEBSD, OS.OPENBSD })
public class TokyoBigLinkedSetTest extends AbstractBigLinkedSetTest {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.nio.file.Paths;
import java.util.Map;

@DisabledOnOs(value=OS.WINDOWS, disabledReason="TokyoCabinet does not support windows")
@DisabledOnOs({ OS.WINDOWS, OS.FREEBSD, OS.OPENBSD })
public class TokyoBigMapTest extends AbstractBigMapTest {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.nio.file.Paths;
import java.util.Set;

@DisabledOnOs(value=OS.WINDOWS, disabledReason="TokyoCabinet does not support windows")
@DisabledOnOs({ OS.WINDOWS, OS.FREEBSD, OS.OPENBSD })
public class TokyoBigSetTest extends AbstractBigSetTest {

@Override
Expand Down
6 changes: 6 additions & 0 deletions bigmap-rocksdb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@

<!-- testing -->

<dependency>
<groupId>com.fizzed</groupId>
<artifactId>jne</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>java-hamcrest</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@
*/
package com.fizzed.bigmap.rocksdb;

import com.fizzed.jne.HardwareArchitecture;
import com.fizzed.jne.NativeTarget;
import com.fizzed.jne.OperatingSystem;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIf;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import java.nio.file.Paths;
import java.util.Map;
Expand All @@ -24,8 +30,17 @@
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;

@DisabledIf("isUnsupportedOs")
public class RocksBigMapTest {

static public boolean isUnsupportedOs() {
final NativeTarget current = NativeTarget.detect();
return current.getOperatingSystem() == OperatingSystem.FREEBSD
|| current.getOperatingSystem() == OperatingSystem.OPENBSD
|| (current.getOperatingSystem() == OperatingSystem.WINDOWS && current.getHardwareArchitecture() == HardwareArchitecture.ARM64)
|| (current.getOperatingSystem() == OperatingSystem.LINUX && current.getHardwareArchitecture() == HardwareArchitecture.RISCV64);
}

@Test
public void putGetWithStrings() {
final Map<String,String> map = new RocksBigMapBuilder<String,String>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import com.fizzed.bigmap.BigMap;
import org.junit.jupiter.api.Test;
import tkrzw.DBM;
import tkrzw.Iterator;
import tkrzw.Status;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import java.io.IOException;
import java.nio.file.Files;
Expand All @@ -15,6 +14,7 @@
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;

@DisabledOnOs({ OS.FREEBSD, OS.OPENBSD })
public class TkrzwBigMapTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.fizzed.bigmap.tkrzw;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import java.nio.file.Paths;
import java.util.Set;

@DisabledOnOs({ OS.FREEBSD, OS.OPENBSD })
public class TkrzwBigSetTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;

@DisabledOnOs(OS.WINDOWS)
@DisabledOnOs({ OS.WINDOWS, OS.FREEBSD, OS.OPENBSD })
public class TokyoBigMapTest {

@Test
Expand Down
Loading

0 comments on commit 69060b4

Please sign in to comment.