Skip to content

Conversation

@AndriiSiuta
Copy link
Collaborator

Closes #1065

@github-actions github-actions bot added 📖 Project documentation improvements or additions to the project documentation 🔬 testing writing tests 🛠️ tooling labels Aug 15, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 15, 2025

Open in StackBlitz

@code-pushup/ci

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

@code-pushup/cli

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

@code-pushup/create-cli

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

@code-pushup/core

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

@code-pushup/models

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

@code-pushup/nx-plugin

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

@code-pushup/coverage-plugin

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

@code-pushup/eslint-plugin

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

@code-pushup/js-packages-plugin

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

@code-pushup/jsdocs-plugin

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

@code-pushup/lighthouse-plugin

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

@code-pushup/typescript-plugin

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

@code-pushup/utils

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

@code-pushup/models-transformers

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

commit: 39f4030

Copy link
Collaborator

@BioPhoton BioPhoton left a comment

Choose a reason for hiding this comment

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

Thx for starting this refactor! Looking forward to a clean test config setup.

Some remarks, If you open a PR and request a review please do a self review.

Check if:

  • all changes are applied in a consistent way. Not different versions for the same change. E.g. you extend the global configuration in different ways.
  • do not add code changes out of scope. If they are necessary mention them in a comment
  • potentially add information on the state of the PR e.g. DO NOT REVIEW and additional comments about unfinished parts.
  • If you use AI do an extra detailed review!

@github-actions github-actions bot removed the 📖 Project documentation improvements or additions to the project documentation label Aug 22, 2025
@nx-cloud
Copy link

nx-cloud bot commented Aug 22, 2025

View your CI Pipeline Execution ↗ for commit 39f4030

Command Status Duration Result
nx code-pushup --nx-bail -- print-config --verb... ❌ Failed 6s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-29 12:47:14 UTC

@AndriiSiuta AndriiSiuta requested a review from BioPhoton August 22, 2025 10:16
Comment on lines 19 to 26
type CoverageConfig = {
enabled?: boolean;
provider: 'v8';
reporter: ('text' | 'lcov')[];
reportsDirectory: string;
include: string[];
exclude: string[];
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could use the types from vite/vitest directly:

// from vite
import type { UserConfig } from 'vite';
type TestCoverage = Exclude<UserConfig['test'], undefined>;
// from vitest
import type { UserConfig } from 'vitest';
type TestCoverage = UserConfig;

// for both
const testConfig: TestCoverage = {
    coverage: {
      reporter: ['text', 'lcov'],
      reportsDirectory: '../../coverage/plugin-eslint/int-tests',
      exclude: ['mocks/**', '**/types.ts'],
    },
};

I suggest go with types from vitest and remove the types in this file.

Copy link
Collaborator

@BioPhoton BioPhoton Sep 1, 2025

Choose a reason for hiding this comment

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

I saw you removed the custom types. Thanks!
I also saw you just do not us types now in your helpers.

Please use the types in:

  • getDefaultTestSettings return type TestCoverage['coverage'] from import type { UserConfig } from 'vitest'
  • createSharedVitestConfig return type UserConfig from import type { UserConfig } from 'vitest'
  • createSharedUnitVitestConfig return type UserConfig from import type { UserConfig } from 'vitest'
  • createSharedIntegrationVitestConfig return type UserConfig from import type { UserConfig } from 'vitest'
  • createSharedE2eVitestConfig return type UserConfig from import type { UserConfig } from 'vitest'
  • ... also look at other places that could improve typing


it('should return pass if no files are given and pass', async () => {
vol.reset();
// create empty directory
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is out of scope and not needed- revert pls.

vol.fromJSON(
{
'e2e/package.json': pkgJsonContent({ name: 'e2e' }),
'package.json': pkgJsonContent({ name: 'example-monorepo' }), // not in patterns
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is out of scope and not needed. Please revert.

workspaces: ['ui', 'api'],
}),
'api/package.json': pkgJsonContent({ name: 'api' }),
'e2e/package.json': pkgJsonContent({ name: 'e2e' }), // not in workspaces
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is out of scope and not needed. Please revert.

}),
);

// values come from CORE_CONFIG_MOCK returned by readRcByPath mock
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is out of scope and not needed. Please revert.

Copy link
Collaborator

@BioPhoton BioPhoton left a comment

Choose a reason for hiding this comment

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

Hi! Thanks for resolving some of the comments!

For next steps and to get this in faster i suggest the following:

  • please add a proper PR description that contains the scope and planned changes
  • do not add code changes out of scope. If they are necessary mention them in a comment.
    This happened the 3rd time in a row now and makes it impossible to merge. This time you did remove the AI comments as mentioned, but you also removed comments all over the code base. I mentioned some of the places in comments.
  • If you use AI do an extra detailed review! This was the case in all PR's so far and made the review a bit more harder/longer, as the changes needs to get pointed out individually and reverted again. By doing a self review those D-tours could be avoided or at least reduced.

  • For the PR description that defines the scope I suggest the following:

This PR includes:

  • Introduce test-vitest-setup and add configuration
    • adjust coverage.reportDirectory to be at project root (packages/<name>/.coverage)

Related:

  • With this scope I would suggest revert all changed other than the folder testing/test-vitest-setup

  • The comment regarding typing got updated and should serve now also the places where you can use the types. This should clear any misunderstanding. If there is something unclear regarding the types please let me know.
    Comment: #1067 (comment)

@BioPhoton
Copy link
Collaborator

Close as reopened in other PRs.

@BioPhoton BioPhoton closed this Sep 8, 2025
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.

test: introduce test-vitest-setup project to handle test setup for vite tests

2 participants