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

Generate coverage and result tests files for core-web tests #25360

Closed
fmontes opened this issue Jun 27, 2023 · 2 comments
Closed

Generate coverage and result tests files for core-web tests #25360

fmontes opened this issue Jun 27, 2023 · 2 comments

Comments

@fmontes
Copy link
Member

fmontes commented Jun 27, 2023

Parent Issue

No response

User Story

As a stakeholder, I want to report to SonarQube all the test results and coverage for core-web apps and libs.

Acceptance Criteria

  1. Generate the lcov files
  2. Generate the junit report files
  3. Output the files to /target/core-web-reports/TEST-*.xml or /target/core-web-reports/TEST-*.lcov

Proposed Objective

Core Features

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

@oidacra
Copy link
Member

oidacra commented Jun 27, 2023

Reporter to generate the JUnit: https://github.com/jest-community/jest-junit (we need to confirm if this is the better lib to do that).

Add the project.json file to each app and lib.

"collectCoverage": true,
        "coverageReporters": [
          "json",
          "lcov",
          "text-summary"
        ],
"reporter": [
          "default",
          [
            "jest-junit",
            {
              "outputDirectory": "target/core-web-reports",
              "outputName": "portlets-dot-experiments-data-access.xml"
            }
          ]
        ],

to the test target to generate the lcov file and add the new jest reporter (We need to confirm first if only the xml files work, not necessarily generate the lcov file.)

We need to find a reporter for Karma too and do the same process (generate an XML with the coverage).

@fmontes
Copy link
Member Author

fmontes commented Jun 27, 2023

Reporter to generate the JUnit: https://github.com/jest-community/jest-junit (we need to confirm if this is the better lib to do that).

Add the project.json file to each app and lib.

"collectCoverage": true,
        "coverageReporters": [
          "json",
          "lcov",
          "text-summary"
        ],
"reporter": [
          "default",
          [
            "jest-junit",
            {
              "outputDirectory": "target/core-web-reports",
              "outputName": "portlets-dot-experiments-data-access.xml"
            }
          ]
        ],

to the test target to generate the lcov file and add the new jest reporter (We need to confirm first if only the xml files work, not necessarily generate the lcov file.)

We need to find a reporter for Karma too and do the same process (generate an XML with the coverage).

This works for jest libraries, we need the equivalent to karma for the dotcms-ui app.

@fmontes fmontes self-assigned this Jun 28, 2023
@fmontes fmontes closed this as completed in f0d0ded Jul 5, 2023
manuelrojas pushed a commit that referenced this issue Jul 5, 2023
* Fix #25360 Generate coverage and result tests files for core-web tests

* Add github action reporter and make some test fail

* Add jest-junit

* Setup karma lcov and junit reports

* Add settings to block-editor lib

* Fix the block-editor test names

* Add reports to data-access

* Break data-access test

* Add jest config to portlet experiments

* Add jest presets

* Clean up and add reports

* Fix experiements results

* Fix the paths

* Update default path

* Add verbose option

* Fix broken tests

* Fix test

* Fix more tests

* Remove push karma tests to github pages

* Fix data-access tests

* Add jest config to dotcdn

* Add summary report to karma and remove html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants