Permalink
Browse files

Run build, tests on CircleCI

  • Loading branch information...
1 parent 78bfe91 commit fe37f093130c1d33098c96ded0e0b6e4598f8041 @abesto abesto committed Aug 18, 2016
Showing with 135 additions and 4 deletions.
  1. +55 −0 circle.yml
  2. +34 −0 circleci/go-offline.sh
  3. +26 −0 circleci/pom-no-crossmodule-dependencies.xsl
  4. +18 −0 circleci/test.sh
  5. +2 −4 zipkin-ui/pom.xml
View
@@ -0,0 +1,55 @@
+#
+# Copyright 2015-2016 The OpenZipkin Authors
+#
+# 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
+#
+# Unless required by applicable law or agreed to in writing, software distributed under the License
+# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+# or implied. See the License for the specific language governing permissions and limitations under
+# the License.
+#
+
+machine:
+ services:
+ - mysql
+ - cassandra
+ - elasticsearch
+ java:
+ version: openjdk8
+ post:
+ - curl -SL http://www.us.apache.org/dist/kafka/0.8.2.2/kafka_2.11-0.8.2.2.tgz | tar xz
+ - ./kafka_*/bin/zookeeper-server-start.sh ./kafka_*/config/zookeeper.properties:
+ background: true
+ - ./kafka_*/bin/kafka-server-start.sh ./kafka_*/config/server.properties:
+ background: true
+ environment:
+ MYSQL_USER: ubuntu
+ MYSQL_DB: circle_test
+
+dependencies:
+ override:
+ - sudo apt-get install xsltproc
+ - ./circleci/go-offline.sh
+ - ./mvnw frontend:install-node-and-npm frontend:npm -pl zipkin-ui
+ cache_directories:
+ - "~/.npm"
+ - "zipkin-ui/node_modules"
+
+database:
+ override:
+ - mysql -u ubuntu -e 'SET GLOBAL innodb_file_format=Barracuda'
+ - mysql -u ubuntu circle_test < zipkin-storage/mysql/src/main/resources/mysql.sql
+
+test:
+ override:
+ - ./circleci/test.sh:
+ parallel: true
+ files:
+ - "**/test/**/*Test.java"
+ post:
+ - mkdir -p $CIRCLE_TEST_REPORTS/junit/
+ - find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
+
@@ -0,0 +1,34 @@
+#!/bin/bash
+#
+# Copyright 2015-2016 The OpenZipkin Authors
+#
+# 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
+#
+# Unless required by applicable law or agreed to in writing, software distributed under the License
+# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+# or implied. See the License for the specific language governing permissions and limitations under
+# the License.
+#
+
+# Due to https://issues.apache.org/jira/browse/MDEP-323 and cross-module dependencies,
+# we can't easily run mvn dependency:go-offline. This is a workaround for that.
+# It removes all dependencies on io.zipkin.java and ${project.groupId} using XSLT,
+# then runs go-offline on the resulting POMs.
+
+set -xeuo pipefail
+
+rm -rf go-offline-builddir
+mkdir -p go-offline-builddir
+trap "rm -rf $(pwd)/go-offline-builddir" EXIT
+
+for f in $(find . -name 'pom.xml'); do
+ echo $f
+ mkdir -p $(dirname go-offline-builddir/$f)
+ xsltproc ./circleci/pom-no-crossmodule-dependencies.xsl $f > go-offline-builddir/$f
+done
+
+cd go-offline-builddir
+../mvnw dependency:go-offline
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2015-2016 The OpenZipkin Authors
+
+ 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
+
+ Unless required by applicable law or agreed to in writing, software distributed under the License
+ is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ or implied. See the License for the specific language governing permissions and limitations under
+ the License.
+
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pom="http://maven.apache.org/POM/4.0.0">
+ <xsl:template match="@*|node()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="pom:dependency[pom:groupId = 'io.zipkin.java']" />
+ <xsl:template match="pom:dependency[pom:groupId = '${project.groupId}']" />
+</xsl:stylesheet>
View
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# Copyright 2015-2016 The OpenZipkin Authors
+#
+# 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
+#
+# Unless required by applicable law or agreed to in writing, software distributed under the License
+# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+# or implied. See the License for the specific language governing permissions and limitations under
+# the License.
+#
+
+set -ex
+tests="$(echo "$@" | xargs basename -s .java | tr '\n' ',' | sed -e 's/,$//')"
+./mvnw -Dtest="$tests" -DfailIfNoTests=false test
View
@@ -44,17 +44,15 @@
<version>${frontend-maven-plugin.version}</version>
<configuration>
<installDirectory>target</installDirectory>
+ <nodeVersion>v5.5.0</nodeVersion>
+ <npmVersion>3.6.0</npmVersion>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
- <configuration>
- <nodeVersion>v5.5.0</nodeVersion>
- <npmVersion>3.6.0</npmVersion>
- </configuration>
</execution>
<execution>
<id>npm install</id>

0 comments on commit fe37f09

Please sign in to comment.