Skip to content

Conversation

@maria-hambardzumian
Copy link
Contributor

@maria-hambardzumian maria-hambardzumian commented Nov 26, 2025

Summary by CodeRabbit

  • New Features

    • Added an optional skippedIsNotIssue setting to control how skipped tests are recorded; when enabled, skipped tests are marked as NOT_ISSUE.
  • Tests

    • Added tests verifying skipped-test reporting behaviour across skippedIsNotIssue on/off scenarios.
  • Chores

    • Excluded test files from linting and simplified the lint script.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 26, 2025

Walkthrough

Adds an optional config flag skippedIsNotIssue, propagates it into client config and runtime, and when true attaches issue: { issueType: 'NOT_ISSUE' } to SKIPPED finish payloads and a system attribute on new launches; tests and lint/script updates included.

Changes

Cohort / File(s) Summary
Type & Config
index.d.ts, lib/commons/config.js
Add optional skippedIsNotIssue?: boolean to ReportPortalConfig and propagate it via getClientConfig.
Client behavior
lib/report-portal-client.js
When finishing a test item with status SKIPPED and config.skippedIsNotIssue === true, include issue: { issueType: 'NOT_ISSUE' } in the finish payload; when starting a new launch (no id) and skippedIsNotIssue === true, add a system attribute skippedIssue: "false".
Tests
__tests__/report-portal-client.spec.js
Add tests verifying SKIPPED handling for both skippedIsNotIssue: true and false, asserting presence/absence of issue: { issueType: 'NOT_ISSUE' } in finishTestItemPromiseStart payloads.
Linting / Scripts
.eslintrc, package.json
Exclude __tests__ from ESLint (ignorePatterns) and simplify lint script to target statistics and lib (remove tests from lint scope).

Sequence Diagram(s)

sequenceDiagram
  participant Runner as Test Runner
  participant Client as ReportPortal Client
  participant RP as ReportPortal API

  Note over Runner,Client: A test item finishes with status = SKIPPED
  Runner->>Client: finishTestItem(status: "SKIPPED")
  alt config.skippedIsNotIssue === true
    Client->>Client: attach issue: { issueType: "NOT_ISSUE" }
    Client->>RP: finishTestItemPromiseStart(payload with issue)
  else
    Client->>Client: leave payload without issue
    Client->>RP: finishTestItemPromiseStart(payload without issue)
  end
  RP-->>Client: ACK/response
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Inspect boolean coercion and config propagation in lib/commons/config.js.
  • Verify conditional logic in lib/report-portal-client.js (launch attribute and finish payload).
  • Confirm tests in __tests__/report-portal-client.spec.js correctly mock and assert payload shapes.

Poem

A rabbit twitched its whiskers, gave a tiny hop,
"Mark skipped as not-issue — let no false flags pop."
Payloads hopped tidy, launches wear their crest,
Tests danced the pattern and tucked SKIPPED to rest. 🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references 'Added skippedIssue' which aligns with the core changes across multiple files (config, type definitions, and client logic) that implement skippedIsNotIssue functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/EPMRPP-84449-added-skippedIssue

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 436dddd and e77dd52.

📒 Files selected for processing (1)
  • __tests__/report-portal-client.spec.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/report-portal-client.spec.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@maria-hambardzumian
Copy link
Contributor Author

Copy link

@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: 3

🧹 Nitpick comments (2)
lib/report-portal-client.js (1)

614-615: Consider renaming the configuration option for clarity.

The naming skippedIssue: false to mean "add NOT_ISSUE to skipped items" is counter-intuitive. The flag name suggests it controls whether skipped items should have issues, but the logic is inverted. Consider renaming to something like attachNotIssueToSkipped or inverting the logic to make skippedIssue: true mean "add issue annotation."

Current behavior:

  • skippedIssue: false → adds NOT_ISSUE
  • skippedIssue: true → doesn't add NOT_ISSUE
  • skippedIssue: undefined → doesn't add NOT_ISSUE

This could be clearer with either:

  1. Rename to attachNotIssueToSkipped: true
  2. Or invert logic: skippedIssue: true adds NOT_ISSUE (meaning "treat skipped as issue")
__tests__/report-portal-client.spec.js (1)

879-962: Consider adding a test case for undefined skippedIssue.

The tests cover skippedIssue: false and skippedIssue: true, but don't test the default behavior when skippedIssue is undefined. This would help document and ensure the expected default behavior.

Add a third test case:

it('should not add NOT_ISSUE when status is SKIPPED and skippedIssue is undefined', function (done) {
  const mockClient = new RPClient(
    {
      apiKey: 'test',
      endpoint: 'https://reportportal-stub-url',
      launch: 'test launch',
      project: 'test project',
      // skippedIssue is undefined (not set)
    },
    { name: 'test', version: '1.0.0' },
  );

  const spyFinishTestItemPromiseStart = jest
    .spyOn(mockClient, 'finishTestItemPromiseStart')
    .mockImplementation(() => {});

  mockClient.map = {
    testItemId: {
      children: [],
      finishSend: false,
      promiseFinish: Promise.resolve(),
      resolveFinish: () => {},
    },
  };

  const finishTestItemRQ = {
    status: 'skipped',
  };

  mockClient.finishTestItem('testItemId', finishTestItemRQ);

  setTimeout(() => {
    expect(spyFinishTestItemPromiseStart).not.toHaveBeenCalledWith(
      expect.any(Object),
      'testItemId',
      expect.objectContaining({
        issue: expect.anything(),
      }),
    );
    done();
  }, 50);
});
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f0d4eb8 and 439f1bf.

📒 Files selected for processing (4)
  • __tests__/report-portal-client.spec.js (1 hunks)
  • index.d.ts (1 hunks)
  • lib/commons/config.js (1 hunks)
  • lib/report-portal-client.js (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
lib/report-portal-client.js (1)
lib/constants/statuses.js (1)
  • RP_STATUSES (1-10)
lib/commons/config.js (1)
__tests__/rest.spec.js (1)
  • options (8-20)
🪛 GitHub Actions: CI-pipeline
__tests__/report-portal-client.spec.js

[error] 880-880: prettier/prettier: Insert ⏎······


[warning] 37-37: Unexpected console statement no-console


[warning] 51-51: Unexpected console statement no-console


[warning] 65-65: Unexpected console statement no-console

🪛 GitHub Check: test (16)
__tests__/report-portal-client.spec.js

[failure] 895-895:
Unexpected empty arrow function 'resolveFinish'


[failure] 888-888:
Unexpected empty arrow function


[failure] 888-888:
Replace .spyOn(mockClient,·'finishTestItemPromiseStart') with ⏎······.spyOn(mockClient,·'finishTestItemPromiseStart')⏎······


[failure] 886-886:
Replace ····},·{·name:·'test',·version:·'1.0.0'·} with ······},⏎······{·name:·'test',·version:·'1.0.0'·},⏎····


[failure] 885-885:
Insert ··


[failure] 884-884:
Insert ··


[failure] 883-883:
Replace ······ with ········


[failure] 882-882:
Insert ··


[failure] 881-881:
Insert ··


[failure] 880-880:
Insert ⏎······

🪛 GitHub Check: test (18)
__tests__/report-portal-client.spec.js

[failure] 895-895:
Unexpected empty arrow function 'resolveFinish'


[failure] 888-888:
Unexpected empty arrow function


[failure] 888-888:
Replace .spyOn(mockClient,·'finishTestItemPromiseStart') with ⏎······.spyOn(mockClient,·'finishTestItemPromiseStart')⏎······


[failure] 886-886:
Replace ····},·{·name:·'test',·version:·'1.0.0'·} with ······},⏎······{·name:·'test',·version:·'1.0.0'·},⏎····


[failure] 885-885:
Insert ··


[failure] 884-884:
Insert ··


[failure] 883-883:
Replace ······ with ········


[failure] 882-882:
Insert ··


[failure] 881-881:
Insert ··


[failure] 880-880:
Insert ⏎······

🪛 GitHub Check: test (20)
__tests__/report-portal-client.spec.js

[failure] 895-895:
Unexpected empty arrow function 'resolveFinish'


[failure] 888-888:
Unexpected empty arrow function


[failure] 888-888:
Replace .spyOn(mockClient,·'finishTestItemPromiseStart') with ⏎······.spyOn(mockClient,·'finishTestItemPromiseStart')⏎······


[failure] 886-886:
Replace ····},·{·name:·'test',·version:·'1.0.0'·} with ······},⏎······{·name:·'test',·version:·'1.0.0'·},⏎····


[failure] 885-885:
Insert ··


[failure] 884-884:
Insert ··


[failure] 883-883:
Replace ······ with ········


[failure] 882-882:
Insert ··


[failure] 881-881:
Insert ··


[failure] 880-880:
Insert ⏎······

🪛 GitHub Check: test (22)
__tests__/report-portal-client.spec.js

[failure] 895-895:
Unexpected empty arrow function 'resolveFinish'


[failure] 888-888:
Unexpected empty arrow function


[failure] 888-888:
Replace .spyOn(mockClient,·'finishTestItemPromiseStart') with ⏎······.spyOn(mockClient,·'finishTestItemPromiseStart')⏎······


[failure] 886-886:
Replace ····},·{·name:·'test',·version:·'1.0.0'·} with ······},⏎······{·name:·'test',·version:·'1.0.0'·},⏎····


[failure] 885-885:
Insert ··


[failure] 884-884:
Insert ··


[failure] 883-883:
Replace ······ with ········


[failure] 882-882:
Insert ··


[failure] 881-881:
Insert ··


[failure] 880-880:
Insert ⏎······

🔇 Additional comments (1)
lib/commons/config.js (1)

118-118: LGTM!

The configuration option is correctly passed through to the calculated options, following the same pattern as other configuration fields.

Copy link

@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: 0

🧹 Nitpick comments (1)
__tests__/report-portal-client.spec.js (1)

879-971: Based on my verification, I found that:

  1. The code snippet matches exactly at lines 879-971
  2. The referenced "static_analysis_hints/pipeline_failures" does not exist in the repository
  3. Airbnb ESLint config does not flag empty arrow functions as errors by default
  4. However, the patterns ARE inconsistent with existing code in the same test file:
    • Existing code uses .mockImplementation() without arguments (lines 33, 47, etc.)
    • Existing code uses jest.fn() for resolveFinish (lines 463, 466)

The original review comment incorrectly frames consistency improvements as ESLint errors. The suggestions themselves are valid for improving code consistency with existing patterns, but they should not be presented as lint violations.

Rewritten Review Comment:

Align mock patterns with existing test conventions for consistency

The new tests use inconsistent mock patterns compared to the rest of the file:

  • .mockImplementation(() => {}) differs from the established .mockImplementation() pattern used in 20+ other tests
  • resolveFinish: () => {} differs from the jest.fn() pattern used elsewhere for this property (lines 463, 466)

Update both test blocks to match existing conventions:

-  const spyFinishTestItemPromiseStart = jest
-    .spyOn(mockClient, 'finishTestItemPromiseStart')
-    .mockImplementation(() => {});
+  const spyFinishTestItemPromiseStart = jest
+    .spyOn(mockClient, 'finishTestItemPromiseStart')
+    .mockImplementation();

@@
-        resolveFinish: () => {},
+        resolveFinish: jest.fn(),

Apply the same changes to the second test block (lines 939 and 946).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 439f1bf and a852998.

📒 Files selected for processing (1)
  • __tests__/report-portal-client.spec.js (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: CI-pipeline
__tests__/report-portal-client.spec.js

[warning] 37-37: Unexpected console statement. ESLint: no-console.


[warning] 51-51: Unexpected console statement. ESLint: no-console.


[warning] 65-65: Unexpected console statement. ESLint: no-console.


[error] 893-893: Unexpected empty arrow function. @typescript-eslint/no-empty-function.

🪛 GitHub Check: test (16)
__tests__/report-portal-client.spec.js

[failure] 944-944:
Unexpected empty arrow function 'resolveFinish'


[failure] 937-937:
Unexpected empty arrow function


[failure] 900-900:
Unexpected empty arrow function 'resolveFinish'


[failure] 893-893:
Unexpected empty arrow function

🪛 GitHub Check: test (18)
__tests__/report-portal-client.spec.js

[failure] 944-944:
Unexpected empty arrow function 'resolveFinish'


[failure] 937-937:
Unexpected empty arrow function


[failure] 900-900:
Unexpected empty arrow function 'resolveFinish'


[failure] 893-893:
Unexpected empty arrow function

🪛 GitHub Check: test (20)
__tests__/report-portal-client.spec.js

[failure] 944-944:
Unexpected empty arrow function 'resolveFinish'


[failure] 937-937:
Unexpected empty arrow function


[failure] 900-900:
Unexpected empty arrow function 'resolveFinish'


[failure] 893-893:
Unexpected empty arrow function

🪛 GitHub Check: test (22)
__tests__/report-portal-client.spec.js

[failure] 944-944:
Unexpected empty arrow function 'resolveFinish'


[failure] 937-937:
Unexpected empty arrow function


[failure] 900-900:
Unexpected empty arrow function 'resolveFinish'


[failure] 893-893:
Unexpected empty arrow function

Copy link
Member

@AmsterGet AmsterGet left a comment

Choose a reason for hiding this comment

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

Please also update systemAttributes calculation for true value in accordance with current implementation in agents.

Copy link

@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

♻️ Duplicate comments (1)
index.d.ts (1)

146-163: Document skippedIsNotIssue semantics (and consider a deprecated alias for skippedIssue).

The new flag is correctly wired into the config type, but its behavior isn’t obvious from the name alone (auto‑mark SKIPPED items as NOT_ISSUE and add the skippedIssue="false" system attribute). It would help TS consumers if this were documented, and since runtime still supports the legacy skippedIssue option (per tests), you may also want to keep it in the type as a deprecated alias for backward compatibility.

Example:

   export interface ReportPortalConfig {
@@
     restClientConfig?: RestClientConfig;
     token?: string;
-    skippedIsNotIssue?: boolean;
+    /**
+     * When `true`, SKIPPED test items without an explicit `issue` are
+     * automatically annotated with `{ issueType: 'NOT_ISSUE' }`, and the
+     * launch gets a system attribute `skippedIssue="false"` for backward
+     * compatibility.
+     * When `false` or omitted, skipped items are not auto‑annotated.
+     */
+    skippedIsNotIssue?: boolean;
+    /**
+     * @deprecated Use `skippedIsNotIssue` instead.
+     * Legacy flag preserved for backward compatibility.
+     */
+    // skippedIssue?: boolean;

(You can uncomment the legacy prop if you decide to expose it in the typings.)

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85891ab and 8fd0312.

📒 Files selected for processing (4)
  • __tests__/report-portal-client.spec.js (1 hunks)
  • index.d.ts (1 hunks)
  • lib/commons/config.js (1 hunks)
  • lib/report-portal-client.js (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • lib/report-portal-client.js
  • lib/commons/config.js
🧰 Additional context used
🪛 GitHub Actions: CI-pipeline
__tests__/report-portal-client.spec.js

[error] 923-923: Exceeded timeout of 5000 ms for a test while waiting for done() to be called.

@maria-hambardzumian maria-hambardzumian merged commit 999d824 into develop Dec 11, 2025
7 checks passed
@maria-hambardzumian maria-hambardzumian deleted the feature/EPMRPP-84449-added-skippedIssue branch December 11, 2025 11:51
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.

2 participants