Skip to content

Commit

Permalink
fix report paths for sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm committed Jun 3, 2020
1 parent c8ad19d commit 877247c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:
cue -t sonar run-tests
popd > /dev/null
ls -lh sonar-cloud/*/*
# Scan and upload reports
- sonarcloud/scan

Expand Down
11 changes: 8 additions & 3 deletions ci/test/suite.cue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ package test

#Tester: {
name: string
lang: string
type: string

pass: bool | *false
skip: bool | *false

dir: string
cmd: string
Expand All @@ -24,13 +25,15 @@ Suites: #Suites & {

st: {
cli: {
pass: true
skip: true
lang: "go"
type: "testsuite"
dir: "lib/structural"
cmd: "go test ./"
}

unit: {
lang: "go"
type: "gotest"
dir: "lib/structural"
cmd: "go test ./ -v -covermode=count"
Expand All @@ -41,13 +44,15 @@ Suites: #Suites & {

mod: {
cli: {
lang: "go"
type: "testsuite"
dir: "lib/mod"
cmd: "go test ./"
}

unit: {
pass: true
skip: true
lang: "go"
type: "gotest"
dir: "lib/mod"
cmd: "go test ./ -v -covermode=count"
Expand Down
6 changes: 3 additions & 3 deletions ci/test/test_tool.cue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ command: "run-tests": {
data: f

for i, d in data {
if d.pass == false {
if d.skip == false {

// run tests in normal mode
if #Flags.sonar == "" {
Expand Down Expand Up @@ -102,13 +102,13 @@ command: "run-tests": {
pushd ../../ >/dev/null
mkdir -p sonar-cloud/\(d.name)
mkdir -p sonar-cloud/\(d.lang)/\(d.name)
pushd \(d.dir) > /dev/null
\(d.sonar)
popd > /dev/null
cp \(d.dir)/{cover,tests}.out sonar-cloud/\(d.name)
cp \(d.dir)/{cover,tests}.out sonar-cloud/\(d.lang)/\(d.name)
popd > /dev/null
"""
Expand Down
5 changes: 4 additions & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ sonar.host.url=https://sonarcloud.io
#sonar.sources=.

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
sonar.sourceEncoding=UTF-8

# Go reports
sonar.go.tests.reportPaths=sonar-reports/go/**
sonar.go.coverage.reportPaths=sonar-reports/go/**

0 comments on commit 877247c

Please sign in to comment.