Skip to content

Commit

Permalink
Merge 05dd105 into 34f9a98
Browse files Browse the repository at this point in the history
  • Loading branch information
malafeev committed Sep 27, 2019
2 parents 34f9a98 + 05dd105 commit 54cdf88
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 102 deletions.
107 changes: 24 additions & 83 deletions pom.xml
Expand Up @@ -14,7 +14,8 @@
the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-akka</artifactId>
Expand All @@ -34,22 +35,9 @@

<main.basedir>${project.basedir}</main.basedir>

<opentracing.version>0.32.0</opentracing.version>
<akka.version>2.5.21</akka.version>
<org.awaitility.version>3.1.6</org.awaitility.version>
<junit.version>4.12</junit.version>

<!-- plugins -->
<centralsync-maven-plugin.version>0.1.0</centralsync-maven-plugin.version>
<takari-maven.version>0.3.4</takari-maven.version>
<license-maven-plugin.version>3.0</license-maven-plugin.version>
<maven-install-plugin.version>2.5.2</maven-install-plugin.version>
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.0.0</maven-javadoc-plugin.version>
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.1</jacoco-maven-plugin.version>
<opentracing.version>0.33.0</opentracing.version>
<akka.version>2.5.25</akka.version>

</properties>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down Expand Up @@ -98,92 +86,52 @@
<url>https://github.com/opentracing-contrib/java-akka/issues</url>
</issueManagement>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-api</artifactId>
<version>${opentracing.version}</version>
</dependency>

<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-util</artifactId>
<version>${opentracing.version}</version>
</dependency>

<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-util</artifactId>
<version>${opentracing.version}</version>
<type>test-jar</type>
</dependency>

<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-mock</artifactId>
<version>${opentracing.version}</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>

<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.12</artifactId>
<version>${akka.version}</version>
</dependency>

<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${org.awaitility.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-api</artifactId>
<version>${opentracing.version}</version>
</dependency>

<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-mock</artifactId>
<version>${opentracing.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-util</artifactId>
<version>${opentracing.version}</version>
</dependency>

<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.12</artifactId>
<version>${akka.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-util</artifactId>
<version>${opentracing.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>4.0.1</version>
<scope>test</scope>
</dependency>

Expand All @@ -204,16 +152,18 @@
<plugins>
<!-- Ensures checksums are added to published jars -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>${maven-install-plugin.version}</version>
<version>2.5.2</version>
<configuration>
<createChecksum>true</createChecksum>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
<version>2.5.3</version>
<configuration>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>release</releaseProfiles>
Expand All @@ -225,7 +175,7 @@
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>${license-maven-plugin.version}</version>
<version>3.0</version>
<configuration>
<header>${main.basedir}/src/etc/header.txt</header>
<mapping>
Expand All @@ -251,7 +201,7 @@
<dependency>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin-git</artifactId>
<version>${license-maven-plugin.version}</version>
<version>3.0</version>
</dependency>
</dependencies>
<executions>
Expand All @@ -264,27 +214,16 @@
</executions>
</plugin>

<plugin>
<groupId>io.zipkin.centralsync-maven-plugin</groupId>
<artifactId>centralsync-maven-plugin</artifactId>
<version>${centralsync-maven-plugin.version}</version>
<configuration>
<subject>opentracing</subject>
<repo>maven</repo>
<packageName>opentracing-akka</packageName>
</configuration>
</plugin>

<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>${coveralls-maven-plugin.version}</version>
<version>4.3.0</version>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<version>0.8.4</version>
<executions>
<execution>
<id>prepare-agent</id>
Expand All @@ -304,8 +243,9 @@
<plugins>
<!-- Creates source jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<version>3.1.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -317,8 +257,9 @@
</plugin>
<!-- Creates javadoc jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<version>3.1.1</version>
<configuration>
<failOnError>false</failOnError>
</configuration>
Expand Down
Expand Up @@ -20,6 +20,7 @@
import io.opentracing.Scope;
import io.opentracing.Span;
import io.opentracing.Tracer;
import io.opentracing.mock.MockSpan;
import io.opentracing.mock.MockTracer;
import io.opentracing.util.GlobalTracer;
import io.opentracing.util.GlobalTracerTestUtil;
Expand Down Expand Up @@ -117,10 +118,12 @@ public void testActiveSpan() throws Exception {
Timeout timeout = new Timeout(getDefaultDuration());

Future<Object> future;
try (Scope ignored = mockTracer.buildSpan("one").startActive(true)) {
final MockSpan parent = mockTracer.buildSpan("one").start();
try (Scope ignored = mockTracer.activateSpan(parent)) {
Object message = TracedMessage.wrap(mockTracer.activeSpan() /* message */);
future = ask(actorRef, message, timeout);
}
parent.finish();

Boolean isSpanSame = (Boolean) Await.result(future, getDefaultDuration());
assertTrue(isSpanSame);
Expand All @@ -132,11 +135,13 @@ public void testNoWrapMessage() throws Exception {
Timeout timeout = new Timeout(getDefaultDuration());

Future<Object> future;
try (Scope ignored = mockTracer.buildSpan("one").startActive(true)) {
final MockSpan parent = mockTracer.buildSpan("one").start();
try (Scope ignored = mockTracer.activateSpan(parent)) {
/* Since scope.span() is not TracedMessage, the active Span
* won't be propagated */
future = ask(actorRef, mockTracer.activeSpan(), timeout);
}
parent.finish();

Boolean isSpanSame = (Boolean) Await.result(future, getDefaultDuration());
assertFalse(isSpanSame);
Expand Down Expand Up @@ -174,9 +179,11 @@ public void testExplicitTracer() throws Exception {
Timeout timeout = new Timeout(getDefaultDuration());

Future<Object> future;
try (Scope ignored = mockTracer.buildSpan("one").startActive(true)) {
final MockSpan parent = mockTracer.buildSpan("one").start();
try (Scope ignored = mockTracer.activateSpan(parent)) {
future = ask(actorRef, mockTracer, timeout);
}
parent.finish();

Boolean isTracerSame = (Boolean) Await.result(future, getDefaultDuration());
assertTrue(isTracerSame);
Expand All @@ -188,9 +195,11 @@ public void testGlobalTracer() throws Exception {
Timeout timeout = new Timeout(getDefaultDuration());

Future<Object> future;
try (Scope ignored = mockTracer.buildSpan("one").startActive(true)) {
final MockSpan parent = mockTracer.buildSpan("one").start();
try (Scope ignored = mockTracer.activateSpan(parent)) {
future = ask(actorRef, GlobalTracer.get(), timeout);
}
parent.finish();

Boolean isTracerSame = (Boolean) Await.result(future, getDefaultDuration());
assertTrue(isTracerSame);
Expand Down
29 changes: 14 additions & 15 deletions travis/publish.sh
Expand Up @@ -59,20 +59,20 @@ check_travis_branch_equals_travis_tag() {
}

check_release_tag() {
tag="${TRAVIS_TAG}"
if [[ "$tag" =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(\-RC[[:digit:]]+)?$ ]]; then
echo "Build started by version tag $tag. During the release process tags like this"
echo "are created by the 'release' Maven plugin. Nothing to do here."
exit 0
elif [[ ! "$tag" =~ ^release-[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(\-RC[[:digit:]]+)?$ ]]; then
echo "You must specify a tag of the format 'release-0.0.0' or 'release-0.0.0-RC0' to release this project."
echo "The provided tag ${tag} doesn't match that. Aborting."
exit 1
fi
tag="${TRAVIS_TAG}"
if [[ "$tag" =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(\-RC[[:digit:]]+)?$ ]]; then
echo "Build started by version tag $tag. During the release process tags like this"
echo "are created by the 'release' Maven plugin. Nothing to do here."
exit 0
elif [[ ! "$tag" =~ ^release-[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(\-RC[[:digit:]]+)?$ ]]; then
echo "You must specify a tag of the format 'release-0.0.0' or 'release-0.0.0-RC0' to release this project."
echo "The provided tag ${tag} doesn't match that. Aborting."
exit 1
fi
}

is_release_commit() {
project_version=$(./mvnw help:evaluate -N -Dexpression=project.version|sed -n '/^[0-9]/p')
project_version=$(./mvnw help:evaluate -N -Dexpression=project.version | sed -n '/^[0-9]/p')
if [[ "$project_version" =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(\-RC[[:digit:]]+)?$ ]]; then
echo "Build started by release commit $project_version. Will synchronize to maven central."
return 0
Expand All @@ -82,7 +82,7 @@ is_release_commit() {
}

release_version() {
echo "${TRAVIS_TAG}" | sed 's/^release-//'
echo "${TRAVIS_TAG}" | sed 's/^release-//'
}

safe_checkout_remote_branch() {
Expand All @@ -92,7 +92,7 @@ safe_checkout_remote_branch() {
# so we verify that the remote branch is where our tag is.
checkoutBranch=master
if [[ "${TRAVIS_BRANCH}" =~ ^release-[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\-RC[[:digit:]]+$ ]]; then
checkoutBranch=v`release_version | sed 's/-RC[[:digit:]]\+//'`
checkoutBranch=v$(release_version | sed 's/-RC[[:digit:]]\+//')
fi
git checkout -B "${checkoutBranch}"
git fetch origin "${checkoutBranch}":origin/"${checkoutBranch}"
Expand Down Expand Up @@ -125,12 +125,11 @@ elif is_travis_branch_master_or_release; then

# If the deployment succeeded, sync it to Maven Central. Note: this needs to be done once per project, not module, hence -N
if is_release_commit; then
./mvnw --batch-mode -s ./.settings.xml -nsu -N io.zipkin.centralsync-maven-plugin:centralsync-maven-plugin:sync
./mvnw --batch-mode -s ./.settings.xml -nsu -N
fi

# If we are on a release tag, the following will update any version references and push a version tag for deployment.
elif build_started_by_tag; then
safe_checkout_remote_branch
./mvnw --batch-mode -s ./.settings.xml -Prelease -nsu -DreleaseVersion="$(release_version)" -Darguments="-DskipTests" release:prepare
fi

0 comments on commit 54cdf88

Please sign in to comment.