Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 7c1e401c authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Merge branch 'ci' into 'master'

ci: fix validate.sh, use SONARQUBE_LOGIN to authenticate and fix coverage comparison

See merge request solverstack/hqr!22
parents 0407cb7b 67d384ad
No related branches found
No related tags found
No related merge requests found
...@@ -34,8 +34,9 @@ if [[ -z $SONARQUBE_LOGIN ]]; then ...@@ -34,8 +34,9 @@ if [[ -z $SONARQUBE_LOGIN ]]; then
fi fi
if [[ $METRIC == "BUG" ]]; then if [[ $METRIC == "BUG" ]]; then
BUG=`curl -u $TOKEN: -X GET "https://sonarqube.inria.fr/sonarqube/api/measures/component?component=${CI_PROJECT_NAMESPACE}%3A${CI_PROJECT_NAME}&pullRequest=${CI_MERGE_REQUEST_IID}&metricKeys=new_bugs" |jq '.component.measures[0].period.value' | sed -e "s#\"##g"` BUG=`curl -u $SONARQUBE_LOGIN: -X GET "https://sonarqube.inria.fr/sonarqube/api/measures/component?component=${CI_PROJECT_NAMESPACE}%3A${CI_PROJECT_NAME}&pullRequest=${CI_MERGE_REQUEST_IID}&metricKeys=new_bugs" |jq '.component.measures[0].period.value' | sed -e "s#\"##g"`
if [[ $BUG > 0 ]]; then echo "BUG=$BUG"
if [[ $BUG -gt 0 ]]; then
echo "%{BUG} new bugs detected by Sonarqube -> Failure." echo "%{BUG} new bugs detected by Sonarqube -> Failure."
exit 1 exit 1
else else
...@@ -43,11 +44,12 @@ if [[ $METRIC == "BUG" ]]; then ...@@ -43,11 +44,12 @@ if [[ $METRIC == "BUG" ]]; then
exit 0 exit 0
fi fi
elif [[ $METRIC == "COVERAGE" ]]; then elif [[ $METRIC == "COVERAGE" ]]; then
COV=`curl -u $TOKEN: -X GET "https://sonarqube.inria.fr/sonarqube/api/measures/component?component=${CI_PROJECT_NAMESPACE}%3A${CI_PROJECT_NAME}&pullRequest=${CI_MERGE_REQUEST_IID}&metricKeys=new_coverage" |jq '.component.measures[0].period.value' | sed -e "s#\"##g"` COV=`curl -u $SONARQUBE_LOGIN: -X GET "https://sonarqube.inria.fr/sonarqube/api/measures/component?component=${CI_PROJECT_NAMESPACE}%3A${CI_PROJECT_NAME}&pullRequest=${CI_MERGE_REQUEST_IID}&metricKeys=new_coverage" |jq '.component.measures[0].period.value' | sed -e "s#\"##g" | cut -d "." -f 1`
echo "COV=$COV"
if [[ $COV == "null" || -z $COV ]]; then if [[ $COV == "null" || -z $COV ]]; then
echo "Coverage is empty, certainly that there are no lines of new code (considered during the analysis) to compare -> Success." echo "Coverage is empty, certainly that there are no lines of new code (considered during the analysis) to compare -> Success."
else else
if [[ $COV < 80 ]]; then if [[ $COV -lt 80 ]]; then
echo "Coverage on new lines is ${COV}%, which is < 80% -> Failure." echo "Coverage on new lines is ${COV}%, which is < 80% -> Failure."
exit 1 exit 1
else else
......
...@@ -25,9 +25,6 @@ provide critical path length. ...@@ -25,9 +25,6 @@ provide critical path length.
git clone git@gitlab.inria.fr:solverstack/hqr.git git clone git@gitlab.inria.fr:solverstack/hqr.git
#+end_src #+end_src
Last releases of Chameleon are hosted on the [[https://gforge.inria.fr/frs/?group_id=2884][gforge.inria.fr]] for
now. Future releases will be available on this gitlab project.
# * Documentation # * Documentation
# ** User guide # ** User guide
# The user guide is available directly in the sources as emacs # The user guide is available directly in the sources as emacs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment