Skip to content

Conversation

@BioPhoton
Copy link
Collaborator

@BioPhoton BioPhoton commented Aug 12, 2025

This PR includes:

  • add defaultTargets for unit-test, int-test
  • adjust all unit-test, int-test targets to generate coverage by default
  • remove --coverage.enabled and --skipNxCache form CP targets
  • make CP reuse coverage data from unit-test, int-test
  • added passWithNoTests to all targets
  • removes unused int-test targets

Note

This PR brings the execution time from 19m down to max 9m for the whole cp report. 🔥

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 12, 2025

Open in StackBlitz

@code-pushup/ci

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/ci@1061

@code-pushup/cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/cli@1061

@code-pushup/create-cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/create-cli@1061

@code-pushup/models

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models@1061

@code-pushup/core

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/core@1061

@code-pushup/nx-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1061

@code-pushup/coverage-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/coverage-plugin@1061

@code-pushup/eslint-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/eslint-plugin@1061

@code-pushup/js-packages-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/js-packages-plugin@1061

@code-pushup/jsdocs-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/jsdocs-plugin@1061

@code-pushup/lighthouse-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/lighthouse-plugin@1061

@code-pushup/typescript-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/typescript-plugin@1061

@code-pushup/utils

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/utils@1061

commit: 9565128

@github-actions github-actions bot added the 🔬 testing writing tests label Aug 12, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 12, 2025

Code PushUp

🥳 Code PushUp report has improved – compared current commit 2f7e96a with previous commit bce59c0.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🔴 30 🔴 32 ↑ +1.6
Code coverage 🟢 90 🟢 90 ↑ +0.3
Security 🔴 0 🔴 0
Updates 🟡 77 🟡 77
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟡 61 🟡 61
Type Safety 🟢 100 🟢 100
Bug prevention 🟢 100 🟢 100
Miscellaneous 🟢 100 🟢 100
Code style 🟢 100 🟢 100
Documentation 🔴 23 🔴 23
👍 2 groups improved, 👍 5 audits improved, 15 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🔴 30 🔴 32 ↑ +1.6
Code coverage Code coverage metrics 🟢 90 🟢 90 ↑ +0.3

19 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Speed Index 🟥 9.5 s 🟥 8.0 s ↓ −15.6 %
Lighthouse First Contentful Paint 🟥 3.3 s 🟥 3.1 s ↓ −6 %
Lighthouse Time to Interactive 🟥 19.7 s 🟥 18.4 s ↓ −6.9 %
Code coverage Branch coverage 🟨 85 % 🟨 86 % ↑ +1.2 %
Code coverage Line coverage 🟨 86.8 % 🟨 87.1 % ↑ +0.4 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 2,649 KiB 🟩 Total size was 2,639 KiB ↓ −0.4 %
Lighthouse Minimizes main-thread work 🟥 22.8 s 🟥 19.2 s ↓ −16 %
Lighthouse JavaScript execution time 🟥 11.2 s 🟥 9.4 s ↓ −16.1 %
Lighthouse Total Blocking Time 🟥 7,840 ms 🟥 6,160 ms ↓ −21.5 %
Lighthouse Metrics 🟩 100% 🟩 100% ↓ −6.9 %
Lighthouse Largest Contentful Paint 🟥 12.3 s 🟥 12.1 s ↓ −1.7 %
Lighthouse Uses efficient cache policy on static assets 🟨 30 resources found 🟨 30 resources found ↑ +0.1 %
Lighthouse Max Potential First Input Delay 🟥 2,390 ms 🟥 2,200 ms ↓ −8.2 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 72 KiB 🟥 Potential savings of 102 KiB ↑ +50 %
Lighthouse Reduce unused JavaScript 🟥 Potential savings of 549 KiB 🟥 Potential savings of 549 KiB ↓ −16.5 %
Lighthouse Remove duplicate modules in JavaScript bundles 🟥 Potential savings of 91 KiB 🟥 Potential savings of 102 KiB ↓ −33.3 %
Lighthouse Initial server response time was short 🟩 Root document took 560 ms 🟩 Root document took 430 ms ↓ −22 %
Lighthouse Network Round Trip Times 🟩 30 ms 🟩 10 ms ↓ −45.7 %
Lighthouse Avoids an excessive DOM size 🟥 2,271 elements 🟥 2,265 elements ↓ −0.3 %
Lighthouse Server Backend Latencies 🟩 210 ms 🟩 210 ms ↓ −1.4 %

590 other audits are unchanged.

@BioPhoton BioPhoton marked this pull request as ready for review August 12, 2025 21:40
@BioPhoton BioPhoton requested a review from matejchalk as a code owner August 12, 2025 21:40
@BioPhoton BioPhoton requested a review from matejchalk August 13, 2025 02:54
Copy link
Collaborator

@matejchalk matejchalk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup 👍

@BioPhoton BioPhoton requested a review from matejchalk August 13, 2025 15:55
@BioPhoton BioPhoton changed the title chore: refactor unit and int test targets chore: refactor unit-test and int-test targets Aug 13, 2025
@BioPhoton BioPhoton merged commit 2ae961a into main Aug 14, 2025
21 checks passed
@BioPhoton BioPhoton deleted the chore/refactor-targets branch August 14, 2025 10:44
BioPhoton added a commit that referenced this pull request Aug 28, 2025
**Followup of:**
- #1059  

**Precondition:**
- #1061 

**This PR includes:**
- ~add helper to load envVars~
- adjusted `nx.json`
  - add `defaultTargets` for main and plugin `code-pushup` targets
  - add default inputs
- add plugin caching to code-pushup target
- cache js-packages and invalidate daily
- GH adjustments 
  -  added `affected` and `--parallel=3`
- Adjust path helper that that created Nx project graph to use
`readCachedProjectGraph` to avoid problems when running plugins in
parallel

> [!note]
> I cache the `js-packges` plugin target, against our discussion, as
only in this PR I would have saved ~4min

**Followup Todos:**
- move `zod2md.ts` under `tools` and leverage
`"!{projectRoot}/tools/**/*"` in `nx.json#namedInputs.production`
- rename `nx-plugin/mock` to `models/mocks` and adjust inputs
- cleanup e2e targets leverage `nx.json#targetDefaults`
- include only relevant projects in `plugin-eslint` config
- stricter task dependencies to avoid running tracked libs e.g. `nx run
test-nx-utils:unit-test` is executed ATM
- understand why e2e tests fail if
`nx.json#defaultTargets[N].@nx/vite:test` as empty (`{}`) target is
removed

**Followup PRs:**
- #1035

---------

Co-authored-by: John Doe <john.doe@example.com>
Co-authored-by: Matěj Chalk <34691111+matejchalk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants