最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to analyze with SonarQube a project where sources and tests are in the same directories - Stack Overflow

programmeradmin5浏览0评论

I have a project to analyze which is only based on Angular framework. The main issue I have is that both source and test files are on the same directories, divided into features.

Here is an example of my structure:

+- client
|   +- features
|   |   +- home
|   |   |   +- home.js          [source code]
    |   |   +- home.spec.js     [test code]
        |   +- home.html
        |   +- home.less
        +- admin
        |   +- admin.js         [source code]
        |   +- admin.spec.js    [test code]
        |   +- admin.html
        |   +- admin.less
        ...

In my sonar-project.properties, it seems impossible to set a pattern instead of a path (for ex. sonar.tests=client/**/*.spec.js).

Is there a way to run an analysis with this kind of structure?

Thanks.

I have a project to analyze which is only based on Angular framework. The main issue I have is that both source and test files are on the same directories, divided into features.

Here is an example of my structure:

+- client
|   +- features
|   |   +- home
|   |   |   +- home.js          [source code]
    |   |   +- home.spec.js     [test code]
        |   +- home.html
        |   +- home.less
        +- admin
        |   +- admin.js         [source code]
        |   +- admin.spec.js    [test code]
        |   +- admin.html
        |   +- admin.less
        ...

In my sonar-project.properties, it seems impossible to set a pattern instead of a path (for ex. sonar.tests=client/**/*.spec.js).

Is there a way to run an analysis with this kind of structure?

Thanks.

Share Improve this question asked Mar 17, 2015 at 14:08 Romain LinsolasRomain Linsolas 81.7k52 gold badges205 silver badges276 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 11

Thanks to SonarQube mailing list, the solution is to set the following properties:

sonar.sources=client
sonar.tests=client

sonar.exclusions=**/*.spec.js
sonar.test.inclusions=**/*.spec.js

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论