Skip to content

Commit

Permalink
Issue #293 ; Issue #292 - Create IT and isolate hamcrest
Browse files Browse the repository at this point in the history
  • Loading branch information
boretti committed May 21, 2020
1 parent 8445191 commit 57fbe6a
Show file tree
Hide file tree
Showing 167 changed files with 10,164 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .bettercodehub.yml
@@ -1,3 +1,5 @@
component_depth: 8
languages:
- java
exclude:
- /src/it/.*
1 change: 1 addition & 0 deletions .codebeatignore
@@ -0,0 +1 @@
src/it/**
25 changes: 19 additions & 6 deletions .travis.yml
Expand Up @@ -15,19 +15,32 @@ addons:
before_install:
- cp .travis.settings.xml $HOME/.m2/settings.xml
- if [[ "$TRAVIS_OS_NAME" = linux ]]; then sudo apt-get install jshon ; fi
- mkdir -p $HOME/.script
- curl -s https://report.ci/annotate.py > $HOME/.script/annotate.py
- curl -s https://report.ci/upload.py > $HOME/.script/upload.py
- curl -s https://codecov.io/bash > $HOME/.script/codecov.bash
- chmod +x $HOME/.script/codecov.bash
- chmod +x .travisci/*.sh
install:
- "mvn dependency:resolve dependency:resolve-plugins"
- .travisci/getcodacy.sh
script:
- "mvn -e clean install"
- set -o pipefail
- "mvn -e clean install 2>&1 | tee maven.log"
after_failure:
- set +o pipefail
- rm -rf target/local-repo
- .travisci/reportci.sh
after_success:
- set +o pipefail
- rm -rf target/local-repo
- .travisci/reportci.sh
- "mvn jacoco:report coveralls:report -DrepoToken=${repoToken}"
- "bash <(curl -s https://codecov.io/bash) -c -Funit$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION"
- "mvn jacoco:report-integration"
- "bash <(curl -s https://codecov.io/bash) -c -Fcompiler$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION"
- "mvn org.apache.maven.plugins:maven-dependency-plugin:copy -Dartifact=com.codacy:codacy-coverage-reporter:5.0.310:jar:assembly -Dtransitive"
- .travisci/codecov.sh
- "mvn jacoco:merge -Djacoco.destFile=target/jacoco-aggregate.exe"
- "mvn jacoco:report -Djacoco.dataFile=target/jacoco-aggregate.exe"
- "(cd target/dependency && java -jar codacy-coverage-reporter-5.0.310-assembly.jar report -l Java -r ../site/jacoco/jacoco.xml)"
- "(java -jar $HOME/.script/codacy-coverage-reporter.jar report -l Java -r target/site/jacoco/jacoco.xml)"
- "$HOME/.script/codecov.bash -Ffull$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION"
- "mvn site"
before_deploy:
- git config --local user.name "powerunitci"
Expand Down
18 changes: 18 additions & 0 deletions .travisci/codecov.sh
@@ -0,0 +1,18 @@
#!/bin/sh

mvn jacoco:report
"$HOME/.script/codecov.bash" -F"unit$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION"
mvn jacoco:report-integration
"$HOME/.script/codecov.bash" -F"compiler$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION"

(cd target/it &&
for name in * ; do
(cd "$name" && test -e "build.log" &&
(
mvn jacoco:report &&
"$HOME/.script/codecov.bash" -s . -F"unit$(echo "$name" | sed 's/[+-]//g')$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" || echo 'NOT POSSIBLE';
mvn jacoco:report-integration &&
"$HOME/.script/codecov.bash" -s . -F"compiler$(echo "$name" | sed 's/[+-]//g')$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" || echo 'NOT POSSIBLE';
)
);
done;)
9 changes: 9 additions & 0 deletions .travisci/getcodacy.sh
@@ -0,0 +1,9 @@
#!/bin/sh

if test "$TRAVIS_JDK_VERSION" = openjdk8 ; then
mvn org.apache.maven.plugins:maven-dependency-plugin:copy -Dartifact=com.codacy:codacy-coverage-reporter:5.0.310:jar:assembly -Dmdep.stripVersion=true -Dmdep.stripClassifier=true -Dtransitive;
else
mvn org.apache.maven.plugins:maven-dependency-plugin:copy -Dartifact=com.codacy:codacy-coverage-reporter:6.0.0:jar:assembly -Dmdep.stripVersion=true -Dmdep.stripClassifier=true -Dtransitive;
fi;

cp target/dependency/codacy-coverage-reporter.jar "$HOME/.script"
11 changes: 11 additions & 0 deletions .travisci/reportci.sh
@@ -0,0 +1,11 @@
#!/bin/sh

python - --name "annotate$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" --tool java --input maven.log < "$HOME/.script/annotate.py"

python - --name "upload$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" --include='*.xml' --framework=junit < "$HOME/.script/upload.py"

(cd target/it &&
for name in * ; do
python - --name "$name-$TRAVIS_OS_NAME$TRAVIS_JDK_VERSION" --tool java --input "$name/build.log" < "$HOME/.script/annotate.py" || echo 'NOT FOUND';
done;)

58 changes: 51 additions & 7 deletions pom.xml
Expand Up @@ -294,6 +294,7 @@
<directory>${project.build.directory}</directory>
<includes>
<include>*.exec</include>
<include>it/**/*.exec</include>
</includes>
</fileSet>
</fileSets>
Expand All @@ -318,6 +319,39 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<preBuildHookScript>prepare.bsh</preBuildHookScript>
<postBuildHookScript>verify.bsh</postBuildHookScript>
<settingsFile>src/it/settings.xml</settingsFile>
<invokerPropertiesFile>params.properties</invokerPropertiesFile>
<streamLogs>true</streamLogs>
<parallelThreads>3</parallelThreads>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-archetype-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>update-local-catalog</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down Expand Up @@ -538,16 +572,19 @@
<pomFile>${project.build.directory}/pom-archetype.xml</pomFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-archetype-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<id>install archetype for test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>update-local-catalog</goal>
<goal>install-file</goal>
</goals>
<configuration>
<file>${project.build.directory}/${project.artifactId}-${project.version}-archetype.jar</file>
<artifactId>${project.artifactId}-archetype</artifactId>
<groupId>${project.groupId}</groupId>
<pomFile>${project.build.directory}/pom-archetype.xml</pomFile>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
</configuration>
</execution>
</executions>
</plugin>
Expand All @@ -557,6 +594,13 @@
<version>4.3.0</version>
<configuration>
</configuration>
<dependencies>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>
</plugin>

</plugins>
Expand Down
2 changes: 2 additions & 0 deletions src/it/archetype-it-jdk8/params.properties
@@ -0,0 +1,2 @@
invoker.java.version=1.8,!9,!10,!11
invoker.goals=org.apache.maven.plugins:maven-archetype-plugin:generate -DgroupId=ch.test -DartifactId=testme -Dversion=1.0-SNAPSHOT -Dpackage=ch.test.testme -DarchetypeCatalog=local
31 changes: 31 additions & 0 deletions src/it/archetype-it-jdk8/pom.xml
@@ -0,0 +1,31 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ch.powerunit.extensions</groupId>
<artifactId>powerunit-extensions-matchers-it</artifactId>
<version>@project.version@</version>

<packaging>pom</packaging>

<properties>
<interactiveMode>false</interactiveMode>
<archetypeGroupId>ch.powerunit.extensions</archetypeGroupId>
<archetypeArtifactId>powerunit-extensions-matchers-archetype</archetypeArtifactId>
<archetypeVersion>@project.version@</archetypeVersion>
<goals>clean install -s ../../../interpolated-settings.xml -Dmaven.repo.local=${basedir}/../../local-repo -B</goals>
<outputDirectory>${basedir}/target</outputDirectory>
</properties>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-archetype-plugin</artifactId>
<version>3.1.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>
7 changes: 7 additions & 0 deletions src/it/archetype-it-jdk8/verify.bsh
@@ -0,0 +1,7 @@
import java.io.*;

File file = new File( basedir, "build.log" );
if ( !file.isFile() )
{
throw new FileNotFoundException( "Could not build log: " + file );
}
2 changes: 2 additions & 0 deletions src/it/beanmatchers-it-jdk8-existing/params.properties
@@ -0,0 +1,2 @@
invoker.java.version=1.8,!9,!10,!11
invoker.goals=clean install

0 comments on commit 57fbe6a

Please sign in to comment.