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

test(cli-e2e): fix E2E tests after --skipPlugins option added #741

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions e2e/cli-e2e/tests/__snapshots__/help.e2e.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Global Options:
file. [string]
--onlyPlugins List of plugins to run. If not set all plugins are run.
[array] [default: []]
--skipPlugins List of plugins to skip. If not set all plugins are run.
[array] [default: []]

Persist Options:
--persist.outputDir Directory for the produced reports [string]
Expand All @@ -47,6 +49,9 @@ Examples:
code-pushup collect --onlyPlugins=covera Run collect with only coverage plugi
ge n, other plugins from config file wi
ll be skipped.
code-pushup collect --skipPlugins=covera Run collect skiping the coverage plu
ge gin, other plugins from config file
will be included.
code-pushup upload --persist.outputDir=d Upload dist/cp-report.json to portal
ist --persist.filename=cp-report --uploa using API key from environment vari
d.apiKey=$CP_API_KEY able
Expand Down
8 changes: 1 addition & 7 deletions e2e/cli-e2e/tests/print-config.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ describe('print-config', () => {
command: 'code-pushup',
args: [
'print-config',
'--verbose',
'--no-progress',
`--config=${configFilePath(ext)}`,
'--tsconfig=tsconfig.base.json',
Expand Down Expand Up @@ -46,17 +45,12 @@ describe('print-config', () => {
server: 'https://e2e.com/api',
},
plugins: [
expect.objectContaining({ slug: 'eslint', title: 'ESLint' }),
expect.objectContaining({
slug: 'coverage',
title: 'Code coverage',
}),
],
categories: [
expect.objectContaining({ slug: 'bug-prevention' }),
expect.objectContaining({ slug: 'code-style' }),
expect.objectContaining({ slug: 'code-coverage' }),
],
categories: [expect.objectContaining({ slug: 'code-coverage' })],
onlyPlugins: ['coverage'],
skipPlugins: ['eslint'],
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ export function validatePluginFilterOption(
);
}

if (categories.length > 0) {
const removedCategorieSlugs = filterItemRefsBy(categories, ({ plugin }) =>
if (categories.length > 0 && verbose) {
const removedCategorySlugs = filterItemRefsBy(categories, ({ plugin }) =>
filterFunction(plugin),
).map(({ slug }) => slug);
ui().logger.info(
`The --${filterOption} argument removed categories with "${removedCategorieSlugs.join(
`The --${filterOption} argument removed categories with "${removedCategorySlugs.join(
'", "',
)}" slugs.
`,
Expand Down