Skip to content

test(query): cover connection resource selectors#1974

Merged
adityathebe merged 1 commit into
mainfrom
fix/connection-selector-tests
May 19, 2026
Merged

test(query): cover connection resource selectors#1974
adityathebe merged 1 commit into
mainfrom
fix/connection-selector-tests

Conversation

@adityathebe
Copy link
Copy Markdown
Member

@adityathebe adityathebe commented May 19, 2026

Connection selector cases existed in the shared resource selector tests, but their expected IDs were not asserted.

Add assertion coverage for connection results in the main loop and include a name-based connection selector case so regressions are caught.

Summary by CodeRabbit

  • New Features
    • Search results now include connections and playbooks alongside existing resource types.

Review Change Stack

Connection selector cases existed but the main search resource selector loop did not assert connection results, so regressions could pass unnoticed.

Assert expected playbook and connection IDs in the shared loop and add name-based connection selector coverage.
@adityathebe adityathebe enabled auto-merge (rebase) May 19, 2026 14:41
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 12cda9e6-6e6c-43a0-ad52-bebb85f80210

📥 Commits

Reviewing files that changed from the base of the PR and between 2603e3b and 2be445e.

📒 Files selected for processing (1)
  • tests/query_resource_selector_test.go

Walkthrough

This PR extends the SearchResourceSelectors test suite in tests/query_resource_selector_test.go by adding a test case for searching connections by name and expanding existing test assertions to verify that playbooks and connections are included in the returned search results.

Changes

SearchResourceSelectors Test Coverage

Layer / File(s) Summary
Connection and result type test coverage
tests/query_resource_selector_test.go
Test data is extended with a case for searching connections by name; assertions are expanded to verify that search results include both playbooks and connections alongside previously-tested resource types.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'test(query): cover connection resource selectors' accurately describes the main change—adding test coverage for connection resource selectors. The title is concise, specific, and clearly indicates what aspect of the codebase is being modified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/connection-selector-tests
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/connection-selector-tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Benchstat (RLS)

Base: 2603e3b18151d31770bd0c1a43f16e00c98e99b5
Head: 2be445e405eda67fbb54f62e3381866b38315a16

✅ No significant performance changes detected

Full benchstat output

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Benchstat (Other)

Base: 2603e3b18151d31770bd0c1a43f16e00c98e99b5
Head: 2be445e405eda67fbb54f62e3381866b38315a16

✅ 1 improvement(s)
Benchmark Base Head Change p-value
UpdateOfConfigsWithProperties-4 7.915m 7.843m -0.91% 0.009
Full benchstat output
goos: linux
goarch: amd64
pkg: github.com/flanksource/duty/bench
cpu: AMD EPYC 7763 64-Core Processor                
                                                       │ bench-base.txt │           bench-head.txt           │
                                                       │     sec/op     │    sec/op     vs base              │
InsertionForRowsWithAliases/external_users.aliases-4       601.4µ ±  5%   593.7µ ±  5%       ~ (p=0.589 n=6)
InsertionForRowsWithAliases/config_items.external_id-4     1.166m ± 10%   1.152m ± 11%       ~ (p=0.937 n=6)
InsertionOfConfigsWithProperties-4                         3.849m ±  1%   3.857m ±  1%       ~ (p=0.589 n=6)
UpdateOfConfigsWithProperties-4                            7.915m ±  1%   7.843m ±  0%  -0.91% (p=0.009 n=6)
ResourceSelectorConfigs/name-4                             241.3µ ±  4%   237.9µ ±  2%       ~ (p=0.240 n=6)
ResourceSelectorConfigs/name_and_type-4                    257.2µ ±  4%   259.1µ ±  5%       ~ (p=0.937 n=6)
ResourceSelectorConfigs/tags-4                             33.03m ±  5%   32.90m ±  2%       ~ (p=0.818 n=6)
ResourceSelectorQueryBuild/name-4                          50.85µ ±  6%   50.18µ ±  3%       ~ (p=0.394 n=6)
ResourceSelectorQueryBuild/name_and_type-4                 72.49µ ±  2%   72.25µ ±  6%       ~ (p=0.818 n=6)
ResourceSelectorQueryBuild/tags-4                          19.10µ ±  3%   19.42µ ± 10%       ~ (p=0.240 n=6)
geomean                                                    560.9µ         558.5µ        -0.43%

@adityathebe adityathebe merged commit 369727c into main May 19, 2026
18 of 19 checks passed
@adityathebe adityathebe deleted the fix/connection-selector-tests branch May 19, 2026 14:49
@github-actions
Copy link
Copy Markdown

Gavel results

Gavel exited with code .

View full results

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