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

enh(tests): upgrade cypress and fix flaky tests #4170

Merged
merged 34 commits into from
Jun 7, 2024
Merged

Conversation

kduret
Copy link
Contributor

@kduret kduret commented May 22, 2024

Description

enh(tests): upgrade cypress

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software

Copy link
Contributor

coderabbitai bot commented May 22, 2024

Walkthrough

The recent updates primarily focus on refining various GitHub Actions workflows and enhancing Cypress test configurations. Key changes include updating artifact merging and deletion steps in multiple workflows, refining Cypress commands and configurations, and reorganizing properties and logic in test scenarios for ACLs, API tokens, and dashboards. These improvements aim to streamline CI processes, enhance test reliability, and improve code maintainability.

Changes

Files/Groups Change Summary
.github/workflows/... Updated artifact merging steps to use actions/upload-artifact/merge@v4.3.3, added steps for deleting merged artifacts using geekyeggo/delete-artifact@v5.0.0, and renamed steps for clarity.
centreon/packages/js-config/cypress/e2e/... Enhanced installLogsCollector function, added viewport settings, and adjusted window size logic in Cypress configurations.
centreon/tests/e2e/features/ACLs/... Reordered properties in ACL objects, updated property values, modified UI interactions, and added error handling in test scenarios for ACL access groups, actions, menus, and resources.
centreon/tests/e2e/features/Api-Token/... Refactored navigation commands, reordered properties in objects, converted variables to constants, updated sorting logic, and modified token filtering and management processes.
centreon/tests/e2e/features/Dashboards/... Replaced direct URL visits with function calls (cy.visitDashboards()) to streamline test setup for dashboard-related actions.
centreon/tests/e2e/features/Api-Token/commands.ts Introduced a new Cypress command visitApiTokens for interacting with API tokens.

Poem

In the land of code, where rabbits play,
We streamlined workflows, come what may.
With artifacts merged and old ones gone,
Our tests run smoother, from dusk till dawn.
ACLs and tokens, all in line,
Dashboards gleam, a sight divine.
Hoppy coding, swift and bright,
Our changes bring pure delight! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link



Scan Summary:
PIPELINE_SCAN_VERSION: 24.5.0-0
DEV-STAGE: DEVELOPMENT
SCAN_ID: cf7283b9-4b87-4bc2-864a-7065d6a1059c
SCAN_STATUS: SUCCESS
SCAN_MESSAGE: Scan successful. Results size: 619429 bytes
====================
Analysis Successful.
====================

==========================
Found 2 Scannable modules.
==========================
JS files within centreon-web-6737c87d0c1d801983779b0e8f7bd3c6c0fa24fa-9287556410-veracode-binary.zip
PHP files within centreon-web-6737c87d0c1d801983779b0e8f7bd3c6c0fa24fa-9287556410-veracode-binary.zip

===================
Analyzed 2 modules.
===================
JS files within centreon-web-6737c87d0c1d801983779b0e8f7bd3c6c0fa24fa-9287556410-veracode-binary.zip
PHP files within centreon-web-6737c87d0c1d801983779b0e8f7bd3c6c0fa24fa-9287556410-veracode-binary.zip

====================
Analyzed 316 issues.
====================

details


--------------------------------
Found 1 issues of High severity.
--------------------------------
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/class/centreondb.class.php:311
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.query() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to query() contains data from the incoming HTTP request, SQL query string-encoded data from the variable queryString. The data from the incoming HTTP request, SQL query string-encoded data originated from an earlier call to PDO.quote. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP

Total flaws found: 316, New flaws found: 1 as compared to baseline


========================
FAILURE: Found 1 issues!
========================

@kduret kduret marked this pull request as ready for review June 4, 2024 12:26
@kduret kduret requested review from a team as code owners June 4, 2024 12:26
@kduret kduret changed the title enh(tests): upgrade cypress enh(tests): upgrade cypress and fix flaky tests Jun 4, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 23

Outside diff range and nitpick comments (8)
centreon/tests/e2e/features/ACLs/commands.ts (2)

Line range hint 107-120: Refactor to simplify the retry logic in executeActionOnIframe.

Consider using Cypress's built-in retry mechanism with .should() instead of manually implementing retries, which can simplify the code and improve readability.


145-145: Ensure consistent naming conventions for interface properties.

Consider renaming ACLActionName to aclActionName to follow JavaScript's camelCase convention for object properties.

centreon/tests/e2e/features/Api-Token/06-api-token-filter/index.ts (1)

Line range hint 64-66: Replace forEach with for...of for better performance.

Biome suggests replacing forEach with for...of to avoid performance issues with large arrays. Here's how you can refactor the code:

- Object.values(users).forEach((user) => {
+ for (const user of Object.values(users)) {

Also applies to: 80-102

centreon/tests/e2e/features/Dashboards/commands.ts (2)

Line range hint 137-137: Consider using optional chaining for safer property access.

- cy.getByTestId({ testId: accessRightsTestId }).invoke('show').click();
+ cy.getByTestId({ testId: accessRightsTestId })?.invoke('show')?.click();

Line range hint 325-326: Remove the redundant empty export statement.

- export {};
centreon/tests/e2e/features/Cloud-notifications/01-notification-create/index.ts (1)

Line range hint 296-300: Wrap the declaration in a block to restrict its access to the switch clause.

case 'one contact':
+ {
  cy.addContact({
    email: data.contacts.contact1.email,
    name: data.contacts.contact1.name,
    password: data.contacts.contact1.password
  });
+ }
  break;

This change ensures that the declarations within the switch case are scoped properly, preventing potential access by other switch clauses.

centreon/packages/js-config/cypress/e2e/commands.ts (2)

Line range hint 529-540: Consider replacing forEach with for...of.

Using for...of can enhance performance, especially with large arrays, by reducing the overhead of function calls inherent in methods like forEach.

- array.forEach(element => {
+ for (const element of array) {

Line range hint 856-857: Remove the redundant empty export.

The empty export at the end of the file is unnecessary and can be safely removed to clean up the code.

- export {};
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e566a36 and 14c203f.

Files ignored due to path filters (4)
  • centreon/config/features.json is excluded by !**/*.json
  • centreon/packages/js-config/package.json is excluded by !**/*.json
  • centreon/pnpm-lock.yaml is excluded by !**/*.yaml
  • centreon/tests/e2e/package.json is excluded by !**/*.json
Files selected for processing (46)
  • .github/workflows/behat-test.yml (1 hunks)
  • .github/workflows/cypress-component-parallelization.yml (1 hunks)
  • .github/workflows/cypress-e2e-parallelization.yml (1 hunks)
  • .github/workflows/newman.yml (1 hunks)
  • centreon/packages/js-config/cypress/e2e/commands.ts (2 hunks)
  • centreon/packages/js-config/cypress/e2e/configuration.ts (1 hunks)
  • centreon/packages/js-config/cypress/e2e/plugins.ts (1 hunks)
  • centreon/tests/e2e/features/ACLs/01-acl-access-groups/index.ts (6 hunks)
  • centreon/tests/e2e/features/ACLs/02-acl-actions-access/index.ts (19 hunks)
  • centreon/tests/e2e/features/ACLs/03-acl-menus-access/index.ts (10 hunks)
  • centreon/tests/e2e/features/ACLs/04-acl-resources-access/index.ts (17 hunks)
  • centreon/tests/e2e/features/ACLs/commands.ts (5 hunks)
  • centreon/tests/e2e/features/Api-Token/01-api-token-create/index.ts (2 hunks)
  • centreon/tests/e2e/features/Api-Token/02-api-token-listing/index.ts (3 hunks)
  • centreon/tests/e2e/features/Api-Token/03-api-token-sorting/index.ts (5 hunks)
  • centreon/tests/e2e/features/Api-Token/04-api-token-delete/index.ts (5 hunks)
  • centreon/tests/e2e/features/Api-Token/06-api-token-filter/index.ts (7 hunks)
  • centreon/tests/e2e/features/Api-Token/commands.ts (1 hunks)
  • centreon/tests/e2e/features/Api-Token/common.ts (1 hunks)
  • centreon/tests/e2e/features/Cloud-notifications/01-notification-create/index.ts (6 hunks)
  • centreon/tests/e2e/features/Cloud-notifications/common.ts (6 hunks)
  • centreon/tests/e2e/features/Dashboards/01-dashboard-creation/index.ts (3 hunks)
  • centreon/tests/e2e/features/Dashboards/02-dashboard-navigation/index.ts (2 hunks)
  • centreon/tests/e2e/features/Dashboards/03-dashboard-properties-edition/index.ts (4 hunks)
  • centreon/tests/e2e/features/Dashboards/04-dashboard-deletion/index.ts (2 hunks)
  • centreon/tests/e2e/features/Dashboards/05-dashboard-check-permissions/index.ts (13 hunks)
  • centreon/tests/e2e/features/Dashboards/06-dashboard-sharing.feature (1 hunks)
  • centreon/tests/e2e/features/Dashboards/06-dashboard-sharing/index.ts (14 hunks)
  • centreon/tests/e2e/features/Dashboards/07-dashboard-manage-permissions/index.ts (8 hunks)
  • centreon/tests/e2e/features/Dashboards/08-widget-generic-text-configuration/index.ts (4 hunks)
  • centreon/tests/e2e/features/Dashboards/09-widget-single-metric-configuration.feature (1 hunks)
  • centreon/tests/e2e/features/Dashboards/09-widget-single-metric-configuration/index.ts (8 hunks)
  • centreon/tests/e2e/features/Dashboards/10-widget-metric-graph-configuration/index.ts (6 hunks)
  • centreon/tests/e2e/features/Dashboards/11-widget-top-bottom-configuration/index.ts (7 hunks)
  • centreon/tests/e2e/features/Dashboards/12-status-grid-widget-configuration/index.ts (6 hunks)
  • centreon/tests/e2e/features/Dashboards/13-dashboard-all-widgets/index.ts (3 hunks)
  • centreon/tests/e2e/features/Dashboards/14-resource-table-widget-configuration/index.ts (5 hunks)
  • centreon/tests/e2e/features/Dashboards/15-group-monitoring-widget-configuration/index.ts (5 hunks)
  • centreon/tests/e2e/features/Dashboards/16-status-chart-widget-configuration/index.ts (5 hunks)
  • centreon/tests/e2e/features/Dashboards/commands.ts (3 hunks)
  • centreon/tests/e2e/features/Resources-Access-Management/commands.ts (2 hunks)
  • centreon/tests/e2e/features/Resources-status/02-acknowledgments.feature (1 hunks)
  • centreon/tests/e2e/features/Resources-status/02-acknowledgments/index.ts (1 hunks)
  • centreon/tests/e2e/features/Resources-status/03-downtime/index.ts (2 hunks)
  • centreon/tests/e2e/support/commands.ts (1 hunks)
  • centreon/tests/e2e/support/e2e.ts (1 hunks)
Files not reviewed due to errors (3)
  • centreon/tests/e2e/features/Api-Token/01-api-token-create/index.ts (no review received)
  • centreon/tests/e2e/features/Api-Token/03-api-token-sorting/index.ts (no review received)
  • centreon/tests/e2e/features/Api-Token/02-api-token-listing/index.ts (no review received)
Files skipped from review due to trivial changes (8)
  • centreon/tests/e2e/features/Dashboards/01-dashboard-creation/index.ts
  • centreon/tests/e2e/features/Dashboards/06-dashboard-sharing.feature
  • centreon/tests/e2e/features/Dashboards/06-dashboard-sharing/index.ts
  • centreon/tests/e2e/features/Dashboards/09-widget-single-metric-configuration.feature
  • centreon/tests/e2e/features/Dashboards/12-status-grid-widget-configuration/index.ts
  • centreon/tests/e2e/features/Dashboards/14-resource-table-widget-configuration/index.ts
  • centreon/tests/e2e/features/Resources-status/02-acknowledgments.feature
  • centreon/tests/e2e/support/e2e.ts
Additional context used
Biome
centreon/tests/e2e/features/Api-Token/04-api-token-delete/index.ts

[error] 21-23: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 37-59: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.

centreon/tests/e2e/features/Api-Token/01-api-token-create/index.ts

[error] 43-43: Unexpected any. Specify a different type. (lint/suspicious/noExplicitAny)

any disables many type checking rules. Its use should be avoided.


[error] 44-63: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.

centreon/tests/e2e/features/Api-Token/03-api-token-sorting/index.ts

[error] 18-20: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 34-56: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 82-106: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.

centreon/tests/e2e/features/Api-Token/02-api-token-listing/index.ts

[error] 14-16: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.

centreon/tests/e2e/features/Api-Token/06-api-token-filter/index.ts

[error] 64-66: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 80-102: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.

centreon/tests/e2e/features/ACLs/03-acl-menus-access/index.ts

[error] 77-100: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.

centreon/tests/e2e/features/Dashboards/commands.ts

[error] 137-137: Change to an optional chain. (lint/complexity/useOptionalChain)

Unsafe fix: Change to an optional chain.


[error] 325-326: This empty export is useless because there's another export or import. (lint/complexity/noUselessEmptyExport)

This import makes useless the empty export.

Safe fix: Remove this useless empty export.

centreon/tests/e2e/features/ACLs/04-acl-resources-access/index.ts

[error] 77-80: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 102-106: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 116-147: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 154-159: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 220-225: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 274-278: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.

centreon/tests/e2e/features/Cloud-notifications/common.ts

[error] 64-69: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.

centreon/tests/e2e/features/Resources-status/02-acknowledgments/index.ts

[error] 395-395: This variable implicitly has the any type. (lint/suspicious/noImplicitAnyLet)

Variable declarations without type annotation and initialization implicitly have the any type. Declare a type or initialize the variable with some value.

centreon/tests/e2e/features/Dashboards/13-dashboard-all-widgets/index.ts

[error] 368-368: This variable implicitly has the any type. (lint/suspicious/noImplicitAnyLet)

Variable declarations without type annotation and initialization implicitly have the any type. Declare a type or initialize the variable with some value.


[error] 425-425: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause. (lint/correctness/noSwitchDeclarations)

The declaration is defined in this switch clause:

Unsafe fix: Wrap the declaration in a block.


[error] 436-436: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause. (lint/correctness/noSwitchDeclarations)

The declaration is defined in this switch clause:

Unsafe fix: Wrap the declaration in a block.


[error] 451-462: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause. (lint/correctness/noSwitchDeclarations)

The declaration is defined in this switch clause:

Unsafe fix: Wrap the declaration in a block.

centreon/tests/e2e/features/ACLs/02-acl-actions-access/index.ts

[error] 149-152: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 154-156: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 175-179: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 181-183: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 189-205: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 229-232: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 234-236: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 241-243: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 262-265: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 267-269: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 273-282: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 443-445: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 530-546: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.

centreon/tests/e2e/features/Cloud-notifications/01-notification-create/index.ts

[error] 296-300: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause. (lint/correctness/noSwitchDeclarations)

The declaration is defined in this switch clause:

Unsafe fix: Wrap the declaration in a block.

centreon/packages/js-config/cypress/e2e/commands.ts

[error] 529-540: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 856-857: This empty export is useless because there's another export or import. (lint/complexity/noUselessEmptyExport)

This import makes useless the empty export.

Safe fix: Remove this useless empty export.

Additional comments not posted (56)
centreon/tests/e2e/features/Api-Token/commands.ts (1)

3-24: Well-structured Cypress command for visiting API tokens.

centreon/packages/js-config/cypress/e2e/plugins.ts (1)

29-30: Proper configuration of browser window size in Cypress plugins.

centreon/tests/e2e/features/Resources-Access-Management/commands.ts (2)

6-6: Efficient batch creation of resource access rules using Cypress.


29-29: Direct modification of configuration files should be handled with caution.

Verification successful

The features.json file is present in the repository and has the expected structure for the sed command to work correctly. The command in centreon/tests/e2e/features/Resources-Access-Management/commands.ts should function as intended.

  • centreon/config/features.json contains the key "resource_access_management": 2, which matches the pattern used in the sed command.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the format of the features.json file to ensure compatibility with the sed command.

# Test: Check the structure of the features.json file. Expect: Correct structure for sed command.
cat /usr/share/centreon/config/features.json

Length of output: 119



Script:

#!/bin/bash
# Description: Search for references to features.json in the codebase to understand its creation or modification.

# Search for features.json in the codebase
rg 'features.json'

Length of output: 1224



Script:

#!/bin/bash
# Description: Search for Docker-related files and scripts that might handle the features.json file.

# Search for Docker-related files and scripts
rg 'features.json' --glob '*.yml' --glob '*.sh' --glob '*.dockerfile'

Length of output: 69



Script:

#!/bin/bash
# Description: Search for any scripts or setup files that might create or modify the features.json file.

# Search for features.json in all script files
rg 'features.json' --glob '*.sh' --glob '*.ts' --glob '*.php'

Length of output: 1001



Script:

#!/bin/bash
# Description: Check if the features.json file is present in the repository or if there are any instructions in the documentation regarding its creation.

# Search for features.json in the repository
fd 'features.json'

# Search for instructions in the documentation regarding the creation of features.json
rg 'features.json' --glob '*.md'

Length of output: 283



Script:

#!/bin/bash
# Description: Display the content of centreon/config/features.json to verify its structure.

# Display the content of centreon/config/features.json
cat centreon/config/features.json

Length of output: 278

centreon/packages/js-config/cypress/e2e/configuration.ts (1)

73-77: Appropriate configuration of video and viewport settings for Cypress tests.

centreon/tests/e2e/features/Dashboards/02-dashboard-navigation/index.ts (1)

45-45: Consistent use of custom command for dashboard navigation in test scenarios.

Also applies to: 60-60

centreon/tests/e2e/support/commands.ts (1)

6-7: LGTM! The imports for ACL and API token commands are necessary for the new tests.

centreon/tests/e2e/features/Dashboards/04-dashboard-deletion/index.ts (2)

41-41: LGTM! Using cy.visitDashboards() improves test maintainability by abstracting direct URL visits.


78-78: LGTM! Consistent use of cy.visitDashboards() across tests ensures uniform navigation handling.

centreon/tests/e2e/features/Api-Token/04-api-token-delete/index.ts (3)

64-64: LGTM! Using cy.visitApiTokens() improves test maintainability by abstracting direct URL visits.


82-82: LGTM! The addition of a confirmation click action is necessary for completing the API token deletion process in the test.


93-93: LGTM! The addition of a cancellation action is necessary for handling user choice in the API token deletion process.

centreon/tests/e2e/features/Dashboards/03-dashboard-properties-edition/index.ts (1)

43-43: Standardize the use of cy.visitDashboards().

The consistent use of cy.visitDashboards() across different test scenarios is good for maintainability and readability.

Also applies to: 108-108, 154-154, 179-179

.github/workflows/behat-test.yml (1)

181-193: Optimize artifact management in GitHub Actions.

The use of actions/upload-artifact/merge and geekyeggo/delete-artifact for managing artifacts is a good practice to ensure efficient storage and cleanup.

.github/workflows/cypress-component-parallelization.yml (1)

178-191: Ensure robust artifact handling in GitHub Actions.

The use of actions/upload-artifact/merge and geekyeggo/delete-artifact in the workflow is well-implemented to handle test artifacts efficiently.

centreon/tests/e2e/features/Dashboards/07-dashboard-manage-permissions/index.ts (1)

48-48: Consistent use of cy.visitDashboards() in permission management tests.

The consistent use of cy.visitDashboards() across different test scenarios helps maintain a uniform approach to navigating dashboards.

Also applies to: 108-108, 150-150, 193-193

centreon/tests/e2e/features/ACLs/03-acl-menus-access/index.ts (5)

6-6: Use of template strings for dynamic naming enhances readability and flexibility.


86-99: The conditional visibility logic for ACL groups is implemented correctly.


124-124: Correctly targets the ACL menu by its name for further interaction.


147-148: Correctly targets the ACL group by its name for further interaction.


197-201: Adding error handling for null window objects increases robustness and prevents runtime errors.

centreon/tests/e2e/features/ACLs/01-acl-access-groups/index.ts (5)

7-8: Updates to ACL group properties are correctly implemented.


12-13: Property updates for the modified ACL group are correctly implemented.


17-17: Use of template strings for dynamic naming enhances readability and flexibility.


235-239: Adding error handling for null window objects increases robustness and prevents runtime errors.


249-270: The duplication verification logic ensures that all properties, except the name, are consistent between the original and duplicated ACL groups.

centreon/tests/e2e/features/Dashboards/09-widget-single-metric-configuration/index.ts (5)

77-77: Correctly implements navigation to the dashboards page and selection of a specific dashboard.


140-144: Proper setup for testing the Single Metric widget by inserting and navigating to the dashboard.


184-189: Correctly implements the update of the value format for the Single Metric widget to "raw value".


215-217: Correctly updates the custom warning threshold for the Single Metric widget, affecting its data display.


294-295: Correctly implements the deletion of a widget from the dashboard, allowing for dynamic dashboard management.

centreon/tests/e2e/features/Resources-status/03-downtime/index.ts (1)

261-262: Properly sets timeouts and intervals for waiting operations, ensuring the UI has sufficient time to update before assertions.

Also applies to: 378-379

centreon/tests/e2e/features/Dashboards/commands.ts (1)

14-14: Ensure the sed command is correctly formatted and tested.

Verification successful

The sed command in the enableDashboardFeature function appears to be correctly formatted and used as intended. The search results confirm its presence in the centreon/tests/e2e/features/Dashboards/commands.ts file, and the syntax aligns with typical sed usage patterns.

  • Location: centreon/tests/e2e/features/Dashboards/commands.ts
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the sed command in the `enableDashboardFeature` function.

# Test: Search for the sed command usage. Expect: Correct syntax and expected results.
rg --type python $'sed -i'

Length of output: 58



Script:

#!/bin/bash
# Description: Verify the sed command in the `enableDashboardFeature` function.

# Test: Search for the sed command usage. Expect: Correct syntax and expected results.
rg --type typescript $'sed -i'

Length of output: 66



Script:

#!/bin/bash
# Description: Verify the sed command in the `enableDashboardFeature` function.

# Test: Search for the sed command usage. Expect: Correct syntax and expected results.
rg 'sed -i'

Length of output: 5161

centreon/tests/e2e/features/Dashboards/08-widget-generic-text-configuration/index.ts (1)

69-69: Ensure the visitDashboard function is correctly implemented and handles errors.

centreon/tests/e2e/features/Cloud-notifications/common.ts (1)

15-15: Ensure that the sed command correctly targets the intended configuration settings without unintended side effects.

Verification successful

The sed command in the enableNotificationFeature function in centreon/tests/e2e/features/Cloud-notifications/common.ts is correctly implemented and targets the intended configuration settings without unintended side effects.

  • The sed command is used to update the notification field in the /usr/share/centreon/config/features.json file to a value of 3.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the `sed` command in `enableNotificationFeature`.

# Test: Search for the function usage. Expect: Correct and precise targeting in the `sed` command.
rg --type bash $'sed -i \\'s@"notification": [0-3]@"notification": 3@\\' /usr/share/centreon/config/features.json'

Length of output: 140



Script:

#!/bin/bash
# Description: Verify the `sed` command in `enableNotificationFeature`.

# Test: Search for the function usage. Expect: Correct and precise targeting in the `sed` command.
rg 'sed -i \'s@"notification": [0-3]@"notification": 3@\' /usr/share/centreon/config/features.json' --type ts

Length of output: 93



Script:

#!/bin/bash
# Description: Verify the `sed` command in `enableNotificationFeature`.

# Test: Search for the function usage. Expect: Correct and precise targeting in the `sed` command.
rg "sed -i 's@\"notification\": [0-3]@\"notification\": 3@' /usr/share/centreon/config/features.json" --type ts

Length of output: 115



Script:

#!/bin/bash
# Description: Verify the `sed` command in `enableNotificationFeature`.

# Test: Search for the function usage. Expect: Correct and precise targeting in the `sed` command.
rg "sed -i 's@\"notification\": [0-3]@\"notification\": 3@' /usr/share/centreon/config/features.json"

Length of output: 105



Script:

#!/bin/bash
# Description: Extract the function implementation containing the `sed` command in `common.ts`.

# Test: Extract the function implementation. Expect: Correct and precise targeting in the `sed` command.
ast-grep --lang typescript --pattern $'function enableNotificationFeature($_) {
  $$$
  command: `sed -i \'s@"notification": [0-3]@"notification": 3@\' /usr/share/centreon/config/features.json`,
  $$$
}' common.ts

Length of output: 275



Script:

#!/bin/bash
# Description: Locate the `common.ts` file and extract the function implementation containing the `sed` command.

# Step 1: Locate the `common.ts` file.
file_path=$(fd common.ts)

# Step 2: Extract the function implementation.
if [ -n "$file_path" ]; then
  ast-grep --lang typescript --pattern $'function enableNotificationFeature($_) {
    $$$
    command: `sed -i \'s@"notification": [0-3]@"notification": 3@\' /usr/share/centreon/config/features.json`,
    $$$
  }' "$file_path"
else
  echo "common.ts file not found."
fi

Length of output: 2930



Script:

#!/bin/bash
# Description: Locate the `common.ts` file and extract the function implementation containing the `sed` command.

# Step 1: Locate the `common.ts` file.
file_paths=$(fd common.ts)

# Step 2: Extract the function implementation from each file.
for file_path in $file_paths; do
  echo "Processing $file_path"
  ast-grep --lang typescript --pattern $'function enableNotificationFeature($_) {
    $$$
    command: `sed -i \'s@"notification": [0-3]@"notification": 3@\' /usr/share/centreon/config/features.json`,
    $$$
  }' "$file_path"
done

Length of output: 5719



Script:

#!/bin/bash
# Description: Display the contents of the `common.ts` file to verify the `sed` command.

# Step 1: Locate the `common.ts` file.
file_path=$(fd centreon/tests/e2e/features/Cloud-notifications/common.ts)

# Step 2: Display the contents of the file.
if [ -n "$file_path" ]; then
  cat "$file_path"
else
  echo "common.ts file not found."
fi

Length of output: 153



Script:

#!/bin/bash
# Description: Locate the `common.ts` file in the entire repository and display its contents.

# Step 1: Locate the `common.ts` file.
file_path=$(fd common.ts)

# Step 2: Display the contents of the file.
if [ -n "$file_path" ]; then
  for path in $file_path; do
    echo "Contents of $path:"
    cat "$path"
    echo
  done
else
  echo "common.ts file not found."
fi

Length of output: 53164

centreon/tests/e2e/features/Dashboards/11-widget-top-bottom-configuration/index.ts (3)

165-165: Ensure that the editDashboard function is robust and handles potential errors or exceptions.


268-268: Verify that the editDashboard function is correctly implemented and handles errors.


248-248: Ensure that the editDashboard function is robust and handles potential errors or exceptions.

centreon/tests/e2e/features/Dashboards/15-group-monitoring-widget-configuration/index.ts (1)

317-317: Verify the correct indexing for accessing the 'More actions' button.

centreon/tests/e2e/features/Dashboards/10-widget-metric-graph-configuration/index.ts (2)

253-253: Verify the correct indexing for accessing the 'More actions' button.

Verification successful

The search results show that the indexing for the 'More actions' button is used correctly in different contexts within the centreon/tests/e2e/features/Dashboards/10-widget-metric-graph-configuration/index.ts file. Specifically, when there are multiple widgets, the .eq(0) index is used to target the first widget's 'More actions' button.

  • cy.getByTestId({ testId: 'More actions' }).eq(0).click(); is used when there are multiple widgets to ensure the correct widget's 'More actions' button is clicked.
  • In other cases, cy.getByTestId({ testId: 'More actions' }).click(); is used when there is only one widget.

This indicates that the indexing logic is correctly implemented based on the context.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Ensure that the correct index is used for 'More actions' button when multiple widgets are present.

# Test: Check the indexing logic in the test script. Expect: Correct index usage.
rg --type python $'More actions'

Length of output: 64



Script:

#!/bin/bash
# Description: Ensure that the correct index is used for 'More actions' button when multiple widgets are present.

# Test: Check the indexing logic in the test script. Expect: Correct index usage.
rg --type typescript 'More actions'

Length of output: 72



Script:

#!/bin/bash
# Description: Ensure that the correct index is used for 'More actions' button when multiple widgets are present.

# Test: Check the indexing logic in the test script. Expect: Correct index usage.
rg --type ts 'More actions'

Length of output: 7992



Script:

#!/bin/bash
# Description: Extract relevant lines from the identified file to verify the correct indexing for 'More actions' button.

# Extract lines around the usage of 'More actions' in the specific test script.
rg --context 5 'More actions' centreon/tests/e2e/features/Dashboards/10-widget-metric-graph-configuration/index.ts

Length of output: 1877


313-313: Ensure that visitDashboard is used consistently for navigation.

centreon/tests/e2e/features/Dashboards/16-status-chart-widget-configuration/index.ts (3)

206-206: Ensure the visitDashboard function is correctly implemented to handle the new dashboard name.

Verification successful

The visitDashboard function is correctly implemented to handle the dashboard name. It first calls cy.visitDashboards(), then finds the dashboard by name and clicks on it, and finally verifies the URL.

  • centreon/tests/e2e/features/Dashboards/commands.ts:
    Cypress.Commands.add('visitDashboard', (name) => {
      cy.visitDashboards();
      cy.contains(name).click();
      cy.url().should('match', /\/home\/dashboards\/library\/\d+$/);
    });
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the implementation of `visitDashboard` function.

# Test: Search for the function implementation. Expect: Proper handling of dashboard names.
ast-grep --lang javascript --pattern $'function visitDashboard($_) {
  $$$
}'

Length of output: 230



Script:

#!/bin/bash
# Description: Verify the implementation and usage of `visitDashboard` function.

# Search for the definition of the `visitDashboard` function.
rg 'function visitDashboard'

# Search for the usage of the `visitDashboard` function.
rg 'visitDashboard'

Length of output: 7901



Script:

#!/bin/bash
# Description: Extract the definition of the `visitDashboard` function from `commands.ts`.

# Extract the `visitDashboard` function definition.
sed -n '/Cypress.Commands.add('"'"'visitDashboard'"'"',/,/});/p' centreon/tests/e2e/features/Dashboards/commands.ts

Length of output: 290


326-326: Verify that the editDashboard function correctly handles the dashboard name as a parameter.

Verification successful

The editDashboard function is defined in useDashboardConfig.tsx and correctly handles the dashboard name as a parameter by setting the dialog state with the provided dashboard details.

  • Location of editDashboard function definition:
    • centreon/www/front_src/src/Dashboards/components/DashboardLibrary/DashboardConfig/useDashboardConfig.tsx:75
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the implementation of `editDashboard` function.

# Test: Search for the function implementation. Expect: Proper handling of dashboard names.
ast-grep --lang javascript --pattern $'function editDashboard($_) {
  $$$
}'

Length of output: 229



Script:

#!/bin/bash
# Description: Locate the `editDashboard` function definition and verify its implementation.

# Step 1: Locate the `editDashboard` function definition.
rg 'function editDashboard' --no-heading --line-number --color=never

# Step 2: Extract the implementation of the `editDashboard` function.
# Note: This step will be executed only if the function definition is found in Step 1.
function_file=$(rg 'function editDashboard' --no-heading --line-number --color=never | cut -d: -f1 | head -n 1)
if [ -n "$function_file" ]; then
  rg -A 20 'function editDashboard' "$function_file"
fi

Length of output: 203



Script:

#!/bin/bash
# Description: Locate the `editDashboard` function definition within object or class definitions and verify its implementation.

# Step 1: Locate the `editDashboard` function definition within object or class definitions.
rg 'editDashboard' --no-heading --line-number --color=never

# Step 2: Extract the implementation of the `editDashboard` function.
# Note: This step will be executed only if the function definition is found in Step 1.
function_file=$(rg 'editDashboard' --no-heading --line-number --color=never | cut -d: -f1 | head -n 1)
if [ -n "$function_file" ]; then
  rg -A 20 'editDashboard' "$function_file"
fi

Length of output: 7875



Script:

#!/bin/bash
# Description: Extract the implementation of the `editDashboard` function from `useDashboardConfig.tsx`.

# Step 1: Locate the `editDashboard` function definition within `useDashboardConfig.tsx`.
rg -A 20 'const editDashboard' centreon/www/front_src/src/Dashboards/components/DashboardLibrary/DashboardConfig/useDashboardConfig.tsx

Length of output: 743


403-405: Ensure that the editDashboard and ContentCopyIcon click actions are properly synchronized to avoid race conditions or UI inconsistencies.

centreon/tests/e2e/features/Resources-status/02-acknowledgments/index.ts (1)

118-118: Ensure that the 'Acknowledge' button is correctly implemented to handle click events and form submissions.

Verification successful

The search results indicate that the 'Acknowledge' button click event is indeed implemented and handled correctly within the Cypress tests. The test ensures that the acknowledgment command is sent and the user is notified accordingly.

  • The button is located using cy.get('button[data-testid="Confirm"]').contains('Acknowledge').click();.
  • The test waits for the acknowledgment command to be sent using cy.wait('@postAcknowledgments').
  • It verifies that the acknowledgment command was sent by checking for the message 'Acknowledge command sent'.

This confirms that the 'Acknowledge' button is correctly implemented to handle click events and form submissions.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the implementation of the 'Acknowledge' button click event.

# Test: Search for the button implementation. Expect: Proper handling of click events and form submissions.
ast-grep --lang javascript --pattern $'button[data-testid="Confirm"] {
  $$$
}'

Length of output: 542



Script:

#!/bin/bash
# Description: Verify the implementation of the 'Acknowledge' button click event.

# Test: Search for the button implementation. Expect: Proper handling of click events and form submissions.
rg --multiline --multiline-dotall "button\[data-testid=\"Confirm\"\].*\.click\(" -A 10

Length of output: 40860

centreon/tests/e2e/features/Dashboards/13-dashboard-all-widgets/index.ts (4)

294-294: Confirm that the visitDashboard function is implemented to handle the dashboard name correctly.


207-207: Verify that the editDashboard function correctly handles the dashboard name from dashboards.fromDashboardCreatorUser.

Verification successful

The editDashboard function in centreon/tests/e2e/features/Dashboards/commands.ts correctly handles the dashboard name from dashboards.fromDashboardCreatorUser by visiting the dashboard and clicking the "Edit dashboard" button.

  • Location: centreon/tests/e2e/features/Dashboards/commands.ts
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the implementation of `editDashboard` function.

# Test: Search for the function implementation. Expect: Proper handling of dashboard names.
ast-grep --lang javascript --pattern $'function editDashboard($_) {
  $$$
}'

Length of output: 229



Script:

#!/bin/bash
# Description: Locate the implementation of the `editDashboard` function.

# Search for the `editDashboard` function definition in the codebase.
rg 'function editDashboard' --no-heading --line-number --color never

Length of output: 70



Script:

#!/bin/bash
# Description: Search for references to `editDashboard` to identify its origin.

# Search for `editDashboard` references in the codebase.
rg 'editDashboard' --no-heading --line-number --color never

Length of output: 6218



Script:

#!/bin/bash
# Description: Extract the implementation of the `editDashboard` function from `commands.ts`.

# Extract the `editDashboard` function implementation from `commands.ts`.
sed -n '/Cypress.Commands.add('\''editDashboard'\'', (name) => {/,/});/p' centreon/tests/e2e/features/Dashboards/commands.ts

Length of output: 287


211-211: Ensure that the 'Add a widget' button correctly triggers the widget addition process.


343-354: Check if the widget layout updates are correctly applied and persisted across sessions.

centreon/tests/e2e/features/ACLs/02-acl-actions-access/index.ts (1)

378-381: Add error handling for null win object.

+ if (!win) {
+   throw new Error('Cannot get iframe');
+ }

This change ensures that the error is thrown only if win is null, making the error handling more precise and avoiding unnecessary exceptions.

Likely invalid or redundant comment.

centreon/tests/e2e/features/Dashboards/05-dashboard-check-permissions/index.ts (2)

84-84: Ensure consistent use of cy.visitDashboards() across all test scenarios.


171-171: Verify the consistency and correctness of the cy.visitDashboards() usage in various user scenarios.

Also applies to: 208-208, 247-247, 341-341, 377-377, 418-418, 477-477, 481-481, 556-556, 588-588, 678-678, 681-681

Verification successful

The usage of cy.visitDashboards() appears to be consistent across various test files and scenarios. The command is used in multiple test files related to different dashboard functionalities, indicating a standardized approach.

  • centreon/tests/e2e/features/Dashboards/01-dashboard-creation/index.ts
  • centreon/tests/e2e/features/Dashboards/02-dashboard-navigation/index.ts
  • centreon/tests/e2e/features/Dashboards/03-dashboard-properties-edition/index.ts
  • centreon/tests/e2e/features/Dashboards/04-dashboard-deletion/index.ts
  • centreon/tests/e2e/features/Dashboards/05-dashboard-check-permissions/index.ts
  • centreon/tests/e2e/features/Dashboards/06-dashboard-sharing/index.ts
  • centreon/tests/e2e/features/Dashboards/07-dashboard-manage-permissions/index.ts
  • centreon/tests/e2e/features/Dashboards/08-widget-generic-text-configuration/index.ts
  • centreon/tests/e2e/features/Dashboards/09-widget-single-metric-configuration/index.ts
  • centreon/tests/e2e/features/Dashboards/commands.ts
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify consistent usage of `cy.visitDashboards()` across different user roles and scenarios.

# Test: Search for inconsistent usage of `cy.visitDashboards()`. Expect: Consistent usage across all scenarios.
rg --type python $'cy.visitDashboards()'

Length of output: 72



Script:

#!/bin/bash
# Description: Verify consistent usage of `cy.visitDashboards()` across different user roles and scenarios.

# Test: Search for inconsistent usage of `cy.visitDashboards()`. Expect: Consistent usage across all scenarios.
rg --type typescript 'cy.visitDashboards()'

Length of output: 80



Script:

#!/bin/bash
# Description: Verify consistent usage of `cy.visitDashboards()` across different user roles and scenarios.

# Test: Search for inconsistent usage of `cy.visitDashboards()`. Expect: Consistent usage across all scenarios.
rg 'cy.visitDashboards()' --glob '*.{ts,tsx,js,jsx}'

Length of output: 3869

centreon/packages/js-config/cypress/e2e/commands.ts (2)

10-13: Enhanced logging capabilities added to installLogsCollector.

This addition will provide more detailed command timings and extended collection capabilities, which are beneficial for debugging and performance analysis.


266-266: Visibility check added post-login to ensure message elements are not visible.

This is a good practice to ensure that no unexpected messages are visible after login, enhancing the robustness of the login process.

.github/workflows/newman.yml (2)

715-722: Update to actions/upload-artifact/merge@v4.3.3 looks good.

Verification successful

Update to actions/upload-artifact/merge@v4.3.3 looks good. No errors or issues were found with the new version.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the behavior of the new artifact merge action.

# Test: Check the workflow logs for any errors related to artifact merging.
rg --type yaml --files-with-matches 'actions/upload-artifact/merge@65462800fd760344b1a7b4382951275a0abb4808' | xargs cat | grep -i 'error'

Length of output: 136



Script:

#!/bin/bash
# Description: Verify the usage of the new artifact merge action and check for any known issues.

# Test 1: Check the usage of the new artifact merge action in the workflow file.
rg 'actions/upload-artifact/merge@65462800fd760344b1a7b4382951275a0abb4808' .github/workflows/newman.yml

# Test 2: Check for any known issues with this specific version of the action.
curl -s https://api.github.com/repos/actions/upload-artifact/commits/65462800fd760344b1a7b4382951275a0abb4808 | jq '.commit.message'

Length of output: 358


723-727: Update to geekyeggo/delete-artifact@v5.0.0 looks good.

Verification successful

The update to geekyeggo/delete-artifact@v5.0.0 is correctly configured and no issues were found in the logs.

  • The parameters name: postman-html-reports-* and failOnError: false are correctly used according to the action's documentation.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the behavior of the new delete artifact action.

# Test: Check the workflow logs for any errors related to artifact deletion.
rg --type yaml --files-with-matches 'geekyeggo/delete-artifact@24928e75e6e6590170563b8ddae9fac674508aa1' | xargs cat | grep -i 'error'

Length of output: 132



Script:

#!/bin/bash
# Description: Verify the successful execution of the new delete artifact action.

# Test: Check the workflow logs for successful execution of the delete artifact action.
rg --type yaml --files-with-matches 'geekyeggo/delete-artifact@24928e75e6e6590170563b8ddae9fac674508aa1' | xargs cat | grep -i 'Delete merged artifacts'

Length of output: 152



Script:

#!/bin/bash
# Description: Verify the correct usage and configuration of the new delete artifact action.

# Test: Check the entire workflow file for the correct usage and configuration of the delete artifact action.
rg 'geekyeggo/delete-artifact@24928e75e6e6590170563b8ddae9fac674508aa1' .github/workflows/newman.yml

Length of output: 190



Script:

#!/bin/bash
# Description: Verify the correct usage of parameters for the delete artifact action.

# Test: Check the action's documentation for the correct usage of the parameters `name` and `failOnError`.
curl -s https://raw.githubusercontent.com/geekyeggo/delete-artifact/main/action.yml | grep -E 'name|failOnError'

Length of output: 348

MedWassCh
MedWassCh previously approved these changes Jun 5, 2024
@kduret kduret marked this pull request as draft June 6, 2024 11:14
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Outside diff range and nitpick comments (1)
centreon/tests/e2e/features/Dashboards/commands.ts (1)

Line range hint 328-329: Remove the redundant empty export statement.

- export {};

According to static analysis, this empty export is unnecessary due to other exports in the file.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 14c203f and 4ef9439.

Files selected for processing (5)
  • centreon/tests/e2e/features/ACLs/01-acl-access-groups/index.ts (6 hunks)
  • centreon/tests/e2e/features/ACLs/02-acl-actions-access/index.ts (19 hunks)
  • centreon/tests/e2e/features/ACLs/03-acl-menus-access/index.ts (10 hunks)
  • centreon/tests/e2e/features/ACLs/04-acl-resources-access/index.ts (17 hunks)
  • centreon/tests/e2e/features/Dashboards/commands.ts (3 hunks)
Files skipped from review as they are similar to previous changes (4)
  • centreon/tests/e2e/features/ACLs/01-acl-access-groups/index.ts
  • centreon/tests/e2e/features/ACLs/02-acl-actions-access/index.ts
  • centreon/tests/e2e/features/ACLs/03-acl-menus-access/index.ts
  • centreon/tests/e2e/features/ACLs/04-acl-resources-access/index.ts
Additional context used
Biome
centreon/tests/e2e/features/Dashboards/commands.ts

[error] 140-140: Change to an optional chain. (lint/complexity/useOptionalChain)

Unsafe fix: Change to an optional chain.


[error] 328-329: This empty export is useless because there's another export or import. (lint/complexity/noUselessEmptyExport)

This import makes useless the empty export.

Safe fix: Remove this useless empty export.

Additional comments not posted (3)
centreon/tests/e2e/features/Dashboards/commands.ts (3)

19-34: LGTM! Good use of conditional navigation and network request interception.


36-42: LGTM! Proper chaining of Cypress commands to navigate to a specific dashboard.


44-58: LGTM! Proper use of selectors and initial state verification in the editDashboard command.

@kduret kduret marked this pull request as ready for review June 6, 2024 12:03
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Outside diff range and nitpick comments (2)
centreon/tests/e2e/features/Dashboards/commands.ts (2)

Line range hint 328-329: Remove the useless empty export.

- export {};

Line range hint 140-140: Change to an optional chain for better safety.

- if (interception && interception.response) {
+ if (interception?.response) {
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4ef9439 and 775d9cd.

Files selected for processing (3)
  • centreon/tests/e2e/features/Dashboards/05-dashboard-check-permissions/index.ts (14 hunks)
  • centreon/tests/e2e/features/Dashboards/06-dashboard-sharing/index.ts (15 hunks)
  • centreon/tests/e2e/features/Dashboards/commands.ts (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • centreon/tests/e2e/features/Dashboards/05-dashboard-check-permissions/index.ts
  • centreon/tests/e2e/features/Dashboards/06-dashboard-sharing/index.ts
Additional context used
Biome
centreon/tests/e2e/features/Dashboards/commands.ts

[error] 140-140: Change to an optional chain. (lint/complexity/useOptionalChain)

Unsafe fix: Change to an optional chain.


[error] 328-329: This empty export is useless because there's another export or import. (lint/complexity/noUselessEmptyExport)

This import makes useless the empty export.

Safe fix: Remove this useless empty export.

Additional comments not posted (5)
centreon/tests/e2e/features/Dashboards/commands.ts (5)

14-14: Consider using a JSON parsing tool instead of sed for JSON modifications.


36-42: LGTM! Good use of Cypress commands for navigating and asserting URL patterns.


44-52: LGTM! Proper use of Cypress commands for editing dashboard functionality.


Line range hint 304-318: LGTM! The command effectively verifies the graph container elements.


Line range hint 304-318: LGTM! Efficient use of Cypress commands for dashboard and widget management.

Copy link

github-actions bot commented Jun 6, 2024

Code coverage report for centreon component 🚀

Coverage after merging MON-upgrade-cypress into develop will be
91.55%
Coverage Report for Changed Files
FileStmtsBranchesFuncsLinesUncovered Lines

@kduret kduret merged commit 9f0ef9c into develop Jun 7, 2024
610 checks passed
@kduret kduret deleted the MON-upgrade-cypress branch June 7, 2024 07:32
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

Successfully merging this pull request may close these issues.

None yet

4 participants