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

Use jitpacked jars #124

Merged
merged 1 commit into from
May 13, 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
5 changes: 0 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ jobs:
# move to parent dir of homedir to install binaries etc
cd ..

# set up jars
git clone https://github.com/kbase/jars
export JARSDIR=$(pwd)/jars/lib/jars/

# Set up mash
wget https://github.com/marbl/Mash/releases/download/v2.0/mash-Linux64-v2.0.tar
tar -xf mash-Linux64-v2.0.tar
Expand All @@ -66,7 +62,6 @@ jobs:
# set up test config
cd $HOMEDIR
cp -n test.cfg.example test.cfg
sed -i "s#^test.jars.dir.*#test.jars.dir=$JARSDIR#" test.cfg
sed -i "s#^test.mongo.exe.*#test.mongo.exe=$MONGOD#" test.cfg
cat test.cfg

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ authorization source specified may be searched at the same time as namespaces wi
* Releases
* The master branch is the stable branch. Releases are made from the develop branch to the master
branch.
* Update the version as per the semantic version rules in `src/us/kbase/assemblyhomoloy/api/Root.java`.
* Update the version as per the semantic version rules in
`src/us/kbase/assemblyhomoloy/service/api/Root.java`.
* Tag the version in git and github.

### Running tests
Expand Down
27 changes: 7 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ plugins {
id 'org.ajoberstar.grgit' version '4.1.1'
}

// TODO NOW use jitpacked workspace client and shadow jar when available and remove jars

repositories {
mavenCentral()

Expand Down Expand Up @@ -111,26 +109,8 @@ task buildAll {
dependsOn javadoc
}

def fromURL = { url, name ->
File file = new File("$buildDir/download/${name}.jar")
file.parentFile.mkdirs()
if (!file.exists()) {
new URL(url).withInputStream { downloadStream ->
file.withOutputStream { fileOut ->
fileOut << downloadStream
}
}
}
files(file.absolutePath)
}

dependencies {

implementation fromURL(
'https://github.com/kbase/jars/raw/master/lib/jars/kbase/workspace/WorkspaceService-0.8.0.jar',
'WorkspaceService-0.8.0'
)

implementation 'org.ini4j:ini4j:0.5.2'
implementation 'commons-io:commons-io:2.4'
implementation 'com.beust:jcommander:1.72'
Expand All @@ -143,6 +123,12 @@ dependencies {
exclude group: 'com.fasterxml.jackson.core' // breaks everything if we upgrade
exclude group: 'javax.servlet', module: 'servlet-api' // 2.5 vs 3.1 below
}
implementation('com.github.kbase.workspace_deluxe:workspace-client:0.15.0') {
exclude group: 'net.java.dev.jna' // breaks mac builds, not needed
exclude group: 'org.eclipse.jetty.aggregate' // ugh, java common pollutes everything
exclude group: 'com.fasterxml.jackson.core' // breaks everything if we upgrade
exclude group: 'javax.servlet', module: 'servlet-api' // 2.5 vs 3.0.1 below
}
implementation 'com.github.zafarkhaja:java-semver:0.9.0'
implementation 'org.yaml:snakeyaml:1.18'
implementation 'ch.qos.logback:logback-classic:1.1.2'
Expand All @@ -159,6 +145,7 @@ dependencies {
implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359'

testImplementation "com.github.kbase:auth2:0.7.1"
testImplementation 'com.github.kbase.workspace_deluxe:workspace_deluxe-test-shadow-all:0.15.0'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.1.10'
testImplementation 'junit:junit:4.12'
testImplementation('org.eclipse.jetty:jetty-servlet:9.3.11.v20160721') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ public KBaseAuthenticatedFilter getFilter(
if (e.getMessage().contains(
// hacky hacky hacky
// ws needs error codes
// and we need to rewrite the auth client for auth2
"Login failed! Server responded with code 401 Unauthorized")) {
"10020 Invalid token")) {
throw new MinHashDistanceFilterAuthenticationException("Invalid token");
} else {
// this is annoying to test, so pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Root {
//TODO ZLATER ROOT add configurable contact email or link
//TODO ZLATER swagger

private static final String VERSION = "0.1.3";
private static final String VERSION = "0.1.4";
private static final String SERVER_NAME = "Assembly Homology service";

/** Return the root information.
Expand Down
6 changes: 0 additions & 6 deletions src/test/java/us/kbase/test/assemblyhomology/TestCommon.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ public class TestCommon {
public static final String MONGOEXE = "test.mongo.exe";
public static final String MONGO_USE_WIRED_TIGER = "test.mongo.wired_tiger";

public static final String JARS_PATH = "test.jars.dir";

public static final String TEST_TEMP_DIR = "test.temp.dir";
public static final String KEEP_TEMP_DIR = "test.temp.dir.keep";

Expand Down Expand Up @@ -167,10 +165,6 @@ public static Path getMongoExe() {
return Paths.get(getTestProperty(MONGOEXE)).toAbsolutePath().normalize();
}

public static Path getJarsDir() {
return Paths.get(getTestProperty(JARS_PATH)).toAbsolutePath().normalize();
}

public static Path getTempDir() {
return Paths.get(getTestProperty(TEST_TEMP_DIR)).toAbsolutePath().normalize();
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@
import us.kbase.test.assemblyhomology.data.TestDataManager;
import us.kbase.test.assemblyhomology.service.api.RootTest;
import us.kbase.test.auth2.authcontroller.AuthController;
import us.kbase.test.workspace.controllers.workspace.WorkspaceController;
import us.kbase.workspace.CreateWorkspaceParams;
import us.kbase.workspace.SetPermissionsParams;
import us.kbase.workspace.WorkspaceClient;
import us.kbase.test.assemblyhomology.TestCommon;
import us.kbase.test.assemblyhomology.controllers.workspace.WorkspaceController;

public class ServiceIntegrationTest {

Expand Down Expand Up @@ -195,9 +195,9 @@ public static void beforeClass() throws Exception {

// set up Workspace
WS = new WorkspaceController(
TestCommon.getJarsDir(),
"localhost:" + MANAGER.mongo.getServerPort(),
"AssemblyHomologyServiceIntegTestWSDB",
"AssemblyHomologyServiceIntegTestWSDB_types",
"fakeadmin",
authURL,
TEMP_DIR);
Expand Down Expand Up @@ -485,8 +485,6 @@ public void searchNamespace() throws Exception {
Files.newInputStream(TEMP_DIR.resolve(QUERY_K31_S1500)),
MediaType.APPLICATION_OCTET_STREAM));

assertThat("incorrect response code", res.getStatus(), is(200));

@SuppressWarnings("unchecked")
final Map<String, Object> response = res.readEntity(Map.class);

Expand Down Expand Up @@ -515,6 +513,7 @@ public void searchNamespace() throws Exception {
);

assertThat("incorrect response", response, is(expected));
assertThat("incorrect response code", res.getStatus(), is(200));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class RootTest {

public static final String SERVER_VER = "0.1.3";
public static final String SERVER_VER = "0.1.4";
private static final String GIT_ERR =
"Missing git commit file gitcommit, should be in us.kbase.assemblyhomology";

Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions test.cfg.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
# path to the mongodb executable to use for the tests.
test.mongo.exe=/path/to/mongodbexecutable

# path to the KBase jars directory, e.g. [path to parent folder]/jars/lib/jars
test.jars.dir=/path/to/jars/dir

# true to use wired tiger, anything else for false.
test.mongo.wired_tiger=false

Expand Down
Loading