Skip to content

🧪 Added nodejs test#49

Open
sshveta wants to merge 8 commits into
konveyor:mainfrom
sshveta:add_analysis_tc_from_UI_tests
Open

🧪 Added nodejs test#49
sshveta wants to merge 8 commits into
konveyor:mainfrom
sshveta:add_analysis_tc_from_UI_tests

Conversation

@sshveta

@sshveta sshveta commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Tests
    • Added a Node.js test suite that includes three sample rules, a source-only analysis configuration, and expected violations output. Validates rule matching (including excluding module files), incident detection across sample sources, and successful test execution with output validation.

Signed-off-by: Shveta Sachdeva <sshveta@redhat.com>
@coderabbitai

coderabbitai Bot commented Mar 16, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a Node.js provider test suite: test configuration, three custom node-sample rules matching referenced patterns, and an expected-output YAML with documented incidents for TypeScript sample files.

Changes

Cohort / File(s) Summary
Node.js Provider Test Suite
tests/nodejs-sample/test.yaml, tests/nodejs-sample/nodejs-rules.yaml, tests/nodejs-sample/expected-output.yaml
Adds a source-only test configuration (test.yaml), three Node.js rules (nodejs-rules.yaml) matching referenced.pattern values ("greeter", "hello", "log"), and an expected violations report (expected-output.yaml) listing incidents (URI, message, lineNumber, variables) for test_a.ts and test_b.ts.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 New tests hop in, patterns in sight,
Greeter, hello, and log take flight.
Incidents listed with lines so neat,
A tiny hop toward checks complete. 🥕

🚥 Pre-merge checks | ✅ 3
✅ 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 'Added nodejs test' accurately summarizes the main change: adding a new Node.js test configuration with associated test rules and expected output files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/nodejs-sample/expected-output.yaml (1)

7-51: Expected line numbers depend on external repository content.

The incident line numbers (e.g., test_a.ts:6, test_b.ts:1) are tied to specific lines in the external konveyor/analyzer-lsp repository's examples/nodejs directory. If the source files in that repository are modified, these expected line numbers may become stale, causing test failures.

Consider documenting this dependency or pinning to a specific commit instead of #main in test.yaml to ensure reproducibility.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/nodejs-sample/expected-output.yaml` around lines 7 - 51, The expected
incident line numbers in tests/nodejs-sample/expected-output.yaml are tied to
the external konveyor/analyzer-lsp examples and can become stale; update the
test configuration to pin the external repo reference in test.yaml to a specific
commit (replace the current `#main` ref with a commit SHA) and/or add a short
comment in tests/nodejs-sample/expected-output.yaml documenting that the line
numbers depend on that external commit so future maintainers know to update the
expected lines when bumping that commit; locate the external source reference in
test.yaml and change it to a commit SHA, and add the documentation comment near
the node-sample-rule-* incident block.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tests/nodejs-sample/expected-output.yaml`:
- Around line 7-51: The expected incident line numbers in
tests/nodejs-sample/expected-output.yaml are tied to the external
konveyor/analyzer-lsp examples and can become stale; update the test
configuration to pin the external repo reference in test.yaml to a specific
commit (replace the current `#main` ref with a commit SHA) and/or add a short
comment in tests/nodejs-sample/expected-output.yaml documenting that the line
numbers depend on that external commit so future maintainers know to update the
expected lines when bumping that commit; locate the external source reference in
test.yaml and change it to a commit SHA, and add the documentation comment near
the node-sample-rule-* incident block.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 11f4e56e-f8a8-433f-bad6-d78d5e02dbc5

📥 Commits

Reviewing files that changed from the base of the PR and between fb819cb and 5ecdd2d.

📒 Files selected for processing (3)
  • tests/nodejs-sample/expected-output.yaml
  • tests/nodejs-sample/nodejs-rules.yaml
  • tests/nodejs-sample/test.yaml

Signed-off-by: Shveta Sachdeva <sshveta@redhat.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/openmrs/test.yaml`:
- Line 4: The application field currently points to a moving default-branch URL
("application: https://github.com/openmrs/openmrs-core"); replace that value
with a pinned, immutable revision (a specific tag or commit SHA) that your Git
URL parser supports so the test uses a fixed snapshot (e.g., change the
application value to reference a specific tag or commit instead of the branch
URL).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ff02a03b-aa8e-43db-8e65-a8ae5ea6769c

📥 Commits

Reviewing files that changed from the base of the PR and between 5ecdd2d and 6a58af1.

📒 Files selected for processing (2)
  • tests/openmrs/expected-output.yaml
  • tests/openmrs/test.yaml

Comment thread tests/openmrs/test.yaml Outdated
Signed-off-by: Shveta Sachdeva <sshveta@redhat.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/nexus/test.yaml`:
- Line 4: The test points to a moving target by using the application entry
value "https://github.com/sonatype/nexus-public#main"; replace the "#main" ref
with a pinned immutable commit SHA (or stable tag) in the application: value in
tests/nexus/test.yaml so the repo version is deterministic, and if necessary
regenerate or adjust expected-output.yaml to match the pinned revision's output.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a321f258-e2ce-40aa-9d2c-1a190e98854b

📥 Commits

Reviewing files that changed from the base of the PR and between 6a58af1 and b17d199.

📒 Files selected for processing (4)
  • tests/nexus/expected-output.yaml
  • tests/nexus/test.yaml
  • tests/openmrs/expected-output.yaml
  • tests/openmrs/test.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/openmrs/test.yaml

Comment thread tests/nexus/test.yaml Outdated
sshveta added 3 commits March 18, 2026 16:21
Signed-off-by: Shveta Sachdeva <sshveta@redhat.com>
Signed-off-by: Shveta Sachdeva <sshveta@redhat.com>
Signed-off-by: Shveta Sachdeva <sshveta@redhat.com>
@shawn-hurley
shawn-hurley enabled auto-merge (squash) March 26, 2026 03:14
@eemcmullan eemcmullan mentioned this pull request Apr 2, 2026
sshveta added 2 commits April 7, 2026 20:19
Signed-off-by: Shveta Sachdeva <sshveta@redhat.com>
Signed-off-by: Shveta Sachdeva <sshveta@redhat.com>
@shawn-hurley
shawn-hurley disabled auto-merge April 27, 2026 15:52
@shawn-hurley
shawn-hurley enabled auto-merge (squash) April 27, 2026 15:52
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.

1 participant