swsnu / swppfall2021

Learning Software Engineering By Building Web Services
28 stars 19 forks source link

[Practice Session] Question about running SonarCloud in Travis CI #121

Open clarkindy opened 3 years ago

clarkindy commented 3 years ago

After adopting Travis CI, our project build failed with the following message:

ERROR: Error during SonarQube Scanner execution
ERROR: You are running CI analysis while Automatic Analysis is enabled. Please consider disabling one or the other.
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.

It seems that we are not supposed to both enable automatic analysis in SonarCloud and run sonar-scanner in Travis CI, according to the above message. Is it the case that "SonarCloud as an add-on of Travis CI" section of our practice session was just for reference and we should not actually implement it in our projects?

kdh0102 commented 3 years ago

It is up to you how to configure SonarCloud analysis. You can either choose CI analysis or auto analysis supported by SonarCloud.

  1. CI analysis Follow the example config in our practice session. In addition, you have to disable Automatic Analysis in your team settings to leverage CI analysis.

  2. Automatic Analysis Enable Automatic Analysis in your settings and remove add-on configs from travis.yml.

Please try either one and let me know if you have any difficulties.

clarkindy commented 3 years ago

Disabling Automatic Analysis worked. Thank you!