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

P9 #147

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open

P9 #147

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
72a97e6
Setup plugins for performing code coverage
wenlockUCD Mar 26, 2019
4672fe7
Merge pull request #1 from ucdavis/wenlock/peer_prep
wenlockUCD Mar 29, 2019
3274574
variablize the coverage testing
wenlockUCD Mar 29, 2019
6322af1
Merge pull request #2 from ucdavis/wenlock/add_coverage_env
wenlockUCD Mar 29, 2019
2b56b19
verification was missing from some sub projects
wenlockUCD Apr 4, 2019
1377e8d
Merge pull request #4 from ucdavis/wenlock/fixing_verification
wenlockUCD Apr 4, 2019
9be4c55
We need some sub-projects to have WIP coverage testing
wenlockUCD Apr 6, 2019
47c9e36
Merge pull request #5 from ucdavis/wenlock/add_wip_coverage
wenlockUCD Apr 6, 2019
6e7d715
fix service user with WIP
wenlockUCD Apr 6, 2019
cbeb8fd
Merge pull request #6 from ucdavis/wenlock/fix_service_user
wenlockUCD Apr 6, 2019
b554999
Tune coverage ranges
wenlockUCD Apr 7, 2019
2ac63ea
Merge pull request #7 from ucdavis/wenlock/tune_coverage
wenlockUCD Apr 7, 2019
8a9a605
bumping to gradel 4.3.1 wrapper
wenlockUCD Apr 7, 2019
c9c171a
Merge pull request #8 from ucdavis/wenlock/gradel_4.3.1
wenlockUCD Apr 7, 2019
742a51a
part 1
tarangs20 Mar 3, 2020
693e678
Update .travis.yml
tarangs20 Mar 3, 2020
5f27a7d
P1
tarangs20 Mar 3, 2020
0663e02
Update .travis.yml
tarangs20 Mar 3, 2020
44326d5
p1
tarangs20 Mar 3, 2020
47a18e9
Update .travis.yml
tarangs20 Mar 3, 2020
cadb976
part 2
tarangs20 Mar 3, 2020
e7b4eae
Update .travis.yml
tarangs20 Mar 3, 2020
bf0ac43
p3
tarangs20 Mar 3, 2020
a9323b0
p5
tarangs20 Mar 3, 2020
45b743d
p6
tarangs20 Mar 3, 2020
c455e41
p7
tarangs20 Mar 3, 2020
0e0770f
p8
tarangs20 Mar 3, 2020
7770f62
p9
tarangs20 Mar 3, 2020
4fc263d
Update .travis.yml
tarangs20 Mar 3, 2020
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
38 changes: 30 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
language: python
install: "pip install -r requirements.txt"
language: java
jdk:
- oraclejdk9

services:
- docker

env:
- COVERAGE=0.057 BUILD_TARGET=./monolithic/ui
- COVERAGE=0.148 BUILD_TARGET=./monolithic/service/cart
- COVERAGE=0.0 BUILD_TARGET=./monolithic/service/user
- COVERAGE=0.31 BUILD_TARGET=./monolithic/repository/order
- COVERAGE=0.0 BUILD_TARGET=./monolithic/repository/cart
- COVERAGE=0.124 BUILD_TARGET=./monolithic/repository/product
- COVERAGE=0.318 BUILD_TARGET=./monolithic/repository/user


install:
- ./gradlew clean jar

script:
# Run ANSIBLE checks
# - ANSIBLE0008: Disabled for use of sudo warnings - to address
# - ANSIBLE0011: Disabled for all tasks which should be named
# - ANSIBLE0012: Disabled (should not change if nothings needs doing) - to address
# - ANSIBLE0013: Disabled - few uses of shell commands - to address
- find vagrant/provision -name "*.yml" -exec ansible-lint -x ANSIBLE008,ANSIBLE0011,ANSIBLE0012,ANSIBLE0013 {} +
# - echo 'testing coming soon'
- ./gradlew -p $BUILD_TARGET check

after_success:
- find . -name jacocoTestReport.csv|xargs cat|awk -F',' '{print $3" "$4" "$5}'

deploy:
provider: script
script: bash -c "echo \"${Docker_password}\" | docker login --username \"${Docker_login}\" --password-stdin ;"
on:
all_branches: true
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,4 @@ subprojects {

task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Sun May 24 07:45:02 CEST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
78 changes: 43 additions & 35 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand All @@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
Expand All @@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
Expand All @@ -90,7 +89,7 @@ location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
Expand All @@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
Expand Down Expand Up @@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec "$JAVACMD" "$@"
14 changes: 4 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

Expand Down Expand Up @@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail

:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
Expand All @@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
Expand Down
46 changes: 46 additions & 0 deletions monolithic/repository/cart/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
apply plugin: 'jacoco'
apply plugin: 'java'

jar.baseName = "redis-cart-microservice-repository"

idea {
Expand Down Expand Up @@ -32,3 +35,46 @@ dependencies {

testCompile testDeps
}

jacoco {
toolVersion = "0.8.3"
}

jacocoTestReport {
reports {
xml.enabled true
html.enabled true
csv.enabled true
}
}

jacocoTestCoverageVerification {
Map<String, String> env = System.getenv()
def coverage = (env.get('COVERAGE') != null ? Float.parseFloat(env.get('COVERAGE')) : 0.5 )
// This module testing dev is still WIP, lets validate when
// coverage check is less than 0.15, otherwise we always have 0 validation
coverage = (coverage < 0.25) ? coverage : 0.0

violationRules {
rule {
limit {
minimum = coverage
}
}

rule {
enabled = false
element = 'CLASS'
includes = ['org.gradle.*']

limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 0.3
}
}
}
}

check.dependsOn jacocoTestReport
check.dependsOn jacocoTestCoverageVerification
43 changes: 43 additions & 0 deletions monolithic/repository/order/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
apply plugin: 'jacoco'
apply plugin: 'java'

jar.baseName = "order-repository"

idea {
Expand Down Expand Up @@ -34,3 +37,43 @@ dependencies {

testCompile testDeps
}

jacoco {
toolVersion = "0.8.3"
}

jacocoTestReport {
reports {
xml.enabled true
html.enabled true
csv.enabled true
}
}

jacocoTestCoverageVerification {
Map<String, String> env = System.getenv()
def coverage = (env.get('COVERAGE') != null ? Float.parseFloat(env.get('COVERAGE')) : 0.5 )

violationRules {
rule {
limit {
minimum = coverage
}
}

rule {
enabled = false
element = 'CLASS'
includes = ['org.gradle.*']

limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 0.3
}
}
}
}

check.dependsOn jacocoTestReport
check.dependsOn jacocoTestCoverageVerification
46 changes: 46 additions & 0 deletions monolithic/repository/product/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
apply plugin: 'jacoco'
apply plugin: 'java'

jar.baseName = "product-repository"

idea {
Expand Down Expand Up @@ -32,3 +35,46 @@ dependencies {

testCompile testDeps
}

jacoco {
toolVersion = "0.8.3"
}

jacocoTestReport {
reports {
xml.enabled true
html.enabled true
csv.enabled true
}
}

jacocoTestCoverageVerification {
Map<String, String> env = System.getenv()
def coverage = (env.get('COVERAGE') != null ? Float.parseFloat(env.get('COVERAGE')) : 0.5 )
// This module testing dev is still WIP, lets validate when
// coverage check is less than 0.15, otherwise we always have 0 validation
coverage = (coverage < 0.25) ? coverage : 0.0

violationRules {
rule {
limit {
minimum = coverage
}
}

rule {
enabled = false
element = 'CLASS'
includes = ['org.gradle.*']

limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 0.3
}
}
}
}

check.dependsOn jacocoTestReport
check.dependsOn jacocoTestCoverageVerification
Loading