<commit_before>#!/usr/bin/env bash

TRAVIS_DIR=$(dirname $0)

source $TRAVIS_DIR/jacoco-common.sh

# usage: $0 [junit]
arg=$1

cp -r projects/*/target/classes/* $JACOCO_CLASSES_DIR

if [ $arg = 'junit' ]; then
  java -jar $JACOCO_CLI_JAR merge $(find -name 'jacoco.exec') --destfile $JACOCO_JUNIT_DESTFILE
  JACOCO_REPORT_DESTFILE=$JACOCO_JUNIT_DESTFILE
else
  JACOCO_REPORT_DESTFILE=$JACOCO_ALL_DESTFILE
fi    

java -jar $JACOCO_CLI_JAR report $JACOCO_REPORT_DESTFILE  --classfiles $JACOCO_CLASSES_DIR --html $JACOCO_COVERAGE_REPORT_HTML

open $JACOCO_COVERAGE_REPORT_HTML/index.html<commit_msg>check for coverage files (#1593)<commit_after>#!/usr/bin/env bash

TRAVIS_DIR=$(dirname $0)

source $TRAVIS_DIR/jacoco-common.sh

# usage: $0 [junit]
arg=$1

if [ -z "$(find -name 'jacoco*.exec')" ]
then
    echo "No coverage data files found. Try again after running .travis/build.sh"
    exit 1
fi

cp -r projects/*/target/classes/* $JACOCO_CLASSES_DIR

if [ $arg = 'junit' ]; then
  java -jar $JACOCO_CLI_JAR merge $(find -name 'jacoco.exec') --destfile $JACOCO_JUNIT_DESTFILE
  JACOCO_REPORT_DESTFILE=$JACOCO_JUNIT_DESTFILE
else
  JACOCO_REPORT_DESTFILE=$JACOCO_ALL_DESTFILE
fi    

java -jar $JACOCO_CLI_JAR report $JACOCO_REPORT_DESTFILE  --classfiles $JACOCO_CLASSES_DIR --html $JACOCO_COVERAGE_REPORT_HTML

open $JACOCO_COVERAGE_REPORT_HTML/index.html
{'fraction_non_alphanumeric': 0.11504424778761062, 'fraction_numerical': 0.008112094395280236, 'mean_word_length': 5.311627906976744, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '737203', 'n_tokens_mistral': 614, 'n_tokens_neox': 591, 'n_words': 107}