Integrating AWS Lambda Unit Tests with SonarQube for Continuous Integration and Test Reporting

  • SonarQube version: Community Edition v10.5.1

Hello All,

The Development Team currently uses AWS Lambda scripts for unit testing. I’m interested in exploring how we can integrate these Lambda functions with SonarQube for continuous integration, and how we might publish the resulting test reports to SonarQube. What are the best practices or recommended approaches for achieving this integration?"

Regards

Hi,

Welcome to the community!

You haven’t mentioned the language(s) these lambdas are written in, but we do have rules related to lambdas in both Java and JS, if memory serves. So you simply need to incorporate analysis into your pipeline.

 
HTH,
Ann

Hi Ann,

The lambdas are written in Python.

Hi,

The search on our rules site tells me we’ve got Python covered too.

 
:smiley:
Ann

Hello Ann,

I am having this error, checking if you can identify what I am doing wrong.

12:55:13.770 ERROR Error during SonarScanner CLI execution
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.sonarsource.scanner.lib.internal.IsolatedClassloader@1b065145-org.sonar.scanner.bootstrap.ScannerPluginRepository’: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.sonarsource.scanner.lib.internal.IsolatedClassloader@1b065145-org.sonar.scanner.bootstrap.ScannerPluginInstaller’: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.sonarsource.scanner.lib.internal.IsolatedClassloader@1b065145-org.sonar.scanner.bootstrap.PluginFiles’: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘GlobalConfiguration’ defined in org.sonar.scanner.bootstrap.GlobalConfigurationProvider: Unsatisfied dependency expressed through method ‘provide’ parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘GlobalServerSettings’ defined in org.sonar.scanner.bootstrap.GlobalServerSettingsProvider: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.sonar.scanner.bootstrap.GlobalServerSettings]: Factory method ‘provide’ threw exception; nested exception is java.lang.IllegalStateException: Fail to request url: [https://sonarqube.dev.int/api/settings/values.protobuf]

Hi,

We try to keep it to one topic per thread. Otherwise it can get messy, fast.

This error indicates that the scanner can’t reach the server. If that doesn’t help, please create a new thread for this will all the details.

 
Ann

Thanks Ann, I have created a new thread.