Skip to content

Commit

Permalink
remove libs, use published test jars and bring integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ravi Rajamani <[email protected]>
  • Loading branch information
Ravi Rajamani committed Sep 15, 2020
1 parent f9abf74 commit cbe63e6
Show file tree
Hide file tree
Showing 15 changed files with 662 additions and 114 deletions.
66 changes: 5 additions & 61 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ buildscript {
classpath group: 'gradle.plugin.com.github.spotbugs', name: 'spotbugs-gradle-plugin', version: spotbugsPluginVersion
classpath "org.ajoberstar:grgit:${gradleGitPluginVersion}"
classpath "io.franzbecker:gradle-lombok:${gradleLombokPluginVersion}"
classpath fileTree(dir: "$rootDir/libs", include: "*.jar")
}
}

Expand Down Expand Up @@ -89,6 +88,7 @@ allprojects {
apply from: "$rootDir/gradle/idea.gradle"
apply from: "$rootDir/gradle/jacoco.gradle"
apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/maven-publish.gradle"
apply from: "$rootDir/gradle/rat.gradle"

repositories {
Expand All @@ -105,10 +105,10 @@ allprojects {
url "https://repository.apache.org/snapshots"
}
maven {
url "https://oss.jfrog.org/artifactory/oss-snapshot-local"
url "http://asdrepo.isus.emc.com:8081/artifactory/nautilus-prerelease-scratch-local"
}
flatDir {
dirs 'libs'
maven {
url "https://oss.jfrog.org/artifactory/oss-snapshot-local"
}
}

Expand Down Expand Up @@ -139,70 +139,14 @@ allprojects {
if (project.hasProperty("doSigning") && project.property("doSigning") == "false") {
signArchives.enabled = false;
}

}

task publishAllJars() {
dependsOn ':extendeds3:publish'
dependsOn ':hdfs:publish'
}

def withoutLogger = { exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.slf4j', module: 'slf4j-simple' }

project ('extendeds3') {
configurations.all {
resolutionStrategy {
force "com.google.code.gson:gson:2.5"
}
}
dependencies {
compile "io.pravega:pravega-common:${pravegaVersion}",
"io.pravega:pravega-shared-metrics:${pravegaVersion}",
"io.pravega:pravega-segmentstore-contracts:${pravegaVersion}",
"io.pravega:pravega-segmentstore-storage:${pravegaVersion}"
compile "io.pravega:pravega-test-testcommon:${pravegaVersion}"
compile files("$rootDir/libs/pravega-segmentstore-storage-0.9.0-2641.ea37ccadc-issue-5124-use-maven-plugin-tests.jar")
compile group: 'com.google.guava', name: 'guava', version: guavaVersion
testCompile 'org.glassfish.jersey.core:jersey-common:2.28'

//For Extended S3
compile group: 'com.emc.ecs', name: 'object-client', version: ecsObjectClientVersion, withoutLogger
testCompile group: 'org.gaul', name: 's3proxy', version: '1.5.5'
testCompile group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
testCompile group: 'org.apache.jclouds.provider', name: 'google-cloud-storage', version: '2.1.1'

}
javadoc {
dependsOn delombok
source = delombok.outputDir
failOnError = true
}
}

project ('hdfs') {
dependencies {
compile "io.pravega:pravega-common:${pravegaVersion}",
"io.pravega:pravega-shared-metrics:${pravegaVersion}",
"io.pravega:pravega-segmentstore-contracts:${pravegaVersion}",
"io.pravega:pravega-segmentstore-storage:${pravegaVersion}"
compile "io.pravega:pravega-test-testcommon:${pravegaVersion}"
compile files("$rootDir/libs/pravega-segmentstore-storage-0.9.0-2641.ea37ccadc-issue-5124-use-maven-plugin-tests.jar")
// For HDFS
compile group: 'org.apache.hadoop', name: 'hadoop-common', version: hadoopVersion, withoutLogger
compile group: 'org.apache.hadoop', name: 'hadoop-hdfs', version: hadoopVersion, withoutLogger
compile group: 'org.apache.hadoop', name: 'hadoop-hdfs-client', version: hadoopVersion, withoutLogger
testCompile group: 'org.apache.hadoop', name: 'hadoop-minicluster', version: hadoopVersion, withoutLogger
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
testCompile group: 'io.netty', name: 'netty-codec-http', version: nettyVersion

}
javadoc {
dependsOn delombok
source = delombok.outputDir
failOnError = true
}
}

def getProjectVersion() {
String ver = pravegaVersion
if (grgit && ver.contains("-SNAPSHOT")) {
Expand Down
4 changes: 4 additions & 0 deletions checkstyle/import-control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
<allow pkg="io.micrometer"/>
<allow pkg="com.emc.object"/>
<allow pkg="org.gaul.s3proxy" />
<allow pkg="io.netty" />
<allow pkg="javax.ws" />
<allow pkg="io.grpc" />
<allow pkg="com.fasterxml" />
<allow pkg="org.jclouds" />

</import-control>
100 changes: 100 additions & 0 deletions extendeds3/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/**
* Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*/

def withoutLogger = { exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.slf4j', module: 'slf4j-simple' }

configurations.all {
resolutionStrategy {
force "com.google.code.gson:gson:2.5"
}
}

dependencies {
compile "io.pravega:pravega-common:${pravegaVersion}",
"io.pravega:pravega-shared-metrics:${pravegaVersion}",
"io.pravega:pravega-segmentstore-contracts:${pravegaVersion}",
"io.pravega:pravega-segmentstore-storage:${pravegaVersion}"
compile "io.pravega:pravega-test-testcommon:${pravegaVersion}"
compile group:"io.pravega", name:"pravega-segmentstore-storage", version: pravegaVersion, classifier: 'tests'
compile group: 'com.google.guava', name: 'guava', version: guavaVersion
testCompile 'org.glassfish.jersey.core:jersey-common:2.28'

//For Extended S3
compile group: 'com.emc.ecs', name: 'object-client', version: ecsObjectClientVersion, withoutLogger
testCompile group: 'org.gaul', name: 's3proxy', version: '1.5.5'
testCompile group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
testCompile group: 'org.apache.jclouds.provider', name: 'google-cloud-storage', version: '2.1.1'

compile "io.pravega:pravega-common:${pravegaVersion}",
"io.pravega:pravega-shared-metrics:${pravegaVersion}",
"io.pravega:pravega-shared-protocol:${pravegaVersion}",
"io.pravega:pravega-segmentstore-contracts:${pravegaVersion}",
"io.pravega:pravega-segmentstore-storage:${pravegaVersion}",
"io.pravega:pravega-segmentstore-server:${pravegaVersion}",
"io.pravega:pravega-segmentstore-server-host:${pravegaVersion}",
"io.pravega:pravega-controller:${pravegaVersion}",
"io.pravega:pravega-client:${pravegaVersion}"
compile "io.pravega:pravega-test-testcommon:${pravegaVersion}"
compile group: 'junit', name:'junit', version: junitVersion
compile group: 'org.apache.curator', name: 'curator-test', version: apacheCuratorVersion
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
testCompile group: 'org.apache.commons', name: 'commons-csv', version: apacheCommonsCsvVersion
compile group: 'org.apache.hadoop', name: 'hadoop-common', version: hadoopVersion, withoutLogger
compile group: 'org.apache.hadoop', name: 'hadoop-hdfs', version: hadoopVersion, withoutLogger
compile group: 'org.apache.hadoop', name: 'hadoop-hdfs-client', version: hadoopVersion, withoutLogger
compile group: 'org.apache.hadoop', name: 'hadoop-minicluster', version: hadoopVersion, withoutLogger
compile group: 'io.netty', name: 'netty-codec-http', version: nettyVersion
compile group:"io.pravega", name:"pravega-segmentstore-server-host", version: pravegaVersion, classifier: 'tests'
compile group:"io.pravega", name:"pravega-segmentstore-server", version: pravegaVersion, classifier: 'tests'
// compile files(project(':hdfs').sourceSets.test.output)
// compile files(project(':extendeds3').sourceSets.test.output)
// compile files("$rootDir/libs/pravega-segmentstore-server-host-0.9.0-2641.ea37ccadc-issue-5124-use-maven-plugin-tests.jar")
// compile files("$rootDir/libs/pravega-segmentstore-server-0.9.0-2641.ea37ccadc-issue-5124-use-maven-plugin-tests.jar")

}

javadoc {
dependsOn delombok
source = delombok.outputDir
failOnError = true
}

configurations.all {
exclude group: "org.slf4j", module: "slf4j-log4j12"
}

task integrationTest(type: Test) {
description = 'Runs integration tests.'
group = 'verification'

outputs.upToDateWhen { false }

testFramework {
useJUnit {
// includeCategories 'io.pravega.test.integration.ExtendedS3IntegrationTest'
excludeCategories 'io.pravega.storage.extendeds3.ExtendedS3StorageTest'
excludeCategories 'io.pravega.storage.extendeds3.ExtendedS3StorageConfigTest'
}
}

shouldRunAfter test
}

test {
testFramework {
useJUnit {
excludeCategories 'io.pravega.test.integration.ExtendedS3IntegrationTest'
// includeCategories 'io.pravega.storage.extendeds3.ExtendedS3StorageTest'
// includeCategories 'io.pravega.storage.extendeds3.ExtendedS3StorageConfigTest'
}
}
}
23 changes: 23 additions & 0 deletions extendeds3/integration/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) Dell Inc., or its subsidiaries.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
-->
<configuration scan="true" scanPeriod="30 seconds">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<charset>UTF-8</charset>
<Pattern>%d %-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
</encoder>
</appender>

<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
22 changes: 22 additions & 0 deletions extendeds3/integration/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) Dell Inc., or its subsidiaries.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
-->
<configuration scan="true" scanPeriod="30 seconds">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<charset>UTF-8</charset>
<Pattern>%d %-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
</encoder>
</appender>

<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/**
* Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
package io.pravega.test.integration;

import io.pravega.common.io.FileHelpers;
import io.pravega.segmentstore.server.host.BookKeeperRunner;
import io.pravega.segmentstore.server.store.ServiceBuilderConfig;
import io.pravega.segmentstore.server.store.ServiceConfig;
import io.pravega.segmentstore.server.store.StreamSegmentStoreTestBase;
import java.io.File;
import java.nio.file.Files;
import lombok.AccessLevel;
import lombok.Getter;

/**
* Base class for any StreamSegmentStore Integration Test that uses BookKeeper.
*/
abstract class BookKeeperIntegrationTestBase extends StreamSegmentStoreTestBase {
private static final int BOOKIE_COUNT = 1;
@Getter(AccessLevel.PROTECTED)
private File baseDir = null;
@Getter(AccessLevel.PROTECTED)
private BookKeeperRunner bookkeeper = null;

/**
* Starts BookKeeper.
*
* NOTE: this (and tearDown()) cannot be annotated with @Before and @After since JUnit doesn't pick these up from
* super classes, at least not in the order in which we expect it to)
*/
protected void setUp() throws Exception {
bookkeeper = new BookKeeperRunner(this.configBuilder, BOOKIE_COUNT);
bookkeeper.initialize();

this.baseDir = Files.createTempDirectory("IntegrationTest").toFile().getAbsoluteFile();
}

/**
* Shuts down BookKeeper and cleans up file system directory.
*/
protected void tearDown() throws Exception {
bookkeeper.close();
if (baseDir != null) {
FileHelpers.deleteFileOrDirectory(this.baseDir);
}

this.baseDir = null;
}

/**
* Creates a ServiceBuilderConfig based on the given builder.
*
* @param configBuilder The ServiceBuilderConfig.Builder to base from (this builder will not be touched).
* @param instanceId The instance id of the Service to build (for least interference, different instances should have
* different Ids so that shared resources can be setup appropriately).
* @return A ServiceBuilderConfig instance.
*/
protected ServiceBuilderConfig getBuilderConfig(ServiceBuilderConfig.Builder configBuilder, int instanceId) {
String id = Integer.toString(instanceId);
return configBuilder
.makeCopy()
.include(ServiceConfig.builder().with(ServiceConfig.INSTANCE_ID, id))
.build();
}

@Override
protected double getFencingTestOperationMultiplier() {
return 0.3; // Adding operations one-by-one using BookKeeper is much slower than bulk-adding them.
}
}
Loading

0 comments on commit cbe63e6

Please sign in to comment.