Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonar and Junit support for Angular with multiple modules #2788

Open
dsteindo opened this issue Aug 22, 2024 · 0 comments
Open

Sonar and Junit support for Angular with multiple modules #2788

dsteindo opened this issue Aug 22, 2024 · 0 comments

Comments

@dsteindo
Copy link

dsteindo commented Aug 22, 2024

Hello, I know this project is still not production ready.

But I would like to highlight something we currently use with Karma that needs to be considered when moving to web test runner in the furture.

How I got interested in this runner: https://danywalls.com/testing-in-angular-replace-karma-to-web-test-runner

karma-junit-reporter

https://www.npmjs.com/package/karma-junit-reporter

I think this will be replaced with https://modern-web.dev/docs/test-runner/reporters/junit/ so it might already be considered

karma-sonarqube-reporter

https://www.npmjs.com/package/karma-sonarqube-reporter

As of now I have not found anything that we can use as a replacement.

Examples

It would be awesome to have an example somewhere (for example a github repository) with an Angular project running with web test runner and Sonar and Junit support integrated.

Multiple modules/projects

See https://angular.dev/reference/configs/file-structure#multiple-projects

It would be amazing to be able to consider multiple modules/projects in the same repo and consider it for reports, lets imagine the Angular app to have following structure when everything works:

  • projects
    • my-app
    • my-lib1
    • my-lib2
  • reports
    • junit
      • report_my-app.xml
      • report_my-lib1.xml
      • report_my-lib2.xml
    • sonar
      • executions_my-app.xml
      • executions_my-lib1.xml
      • executions_my-lib2.xml
  • angular.json
  • package-lock.json
  • package.json
  • ...

Note:

  • project my_app can be seen as the app container, which loads content of the respective modules when needed
  • project my-lib1 and my-lib2 are isolated from each other (separation of concerns)
  • with karma each project had it's own karma.conf.js file, the global angular.json described the runner and location of karma.conf.js file for each project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant