Skip to content

test: Stage 2 unit coverage — split convertors/csvConverter + AzureResourceMetadata tests#3151

Open
bk201- wants to merge 12 commits into
mainfrom
dev/dshilov/unit-tests-stage2
Open

test: Stage 2 unit coverage — split convertors/csvConverter + AzureResourceMetadata tests#3151
bk201- wants to merge 12 commits into
mainfrom
dev/dshilov/unit-tests-stage2

Conversation

@bk201-

@bk201- bk201- commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Stage 2 of the unit test coverage plan: split large utility files into focused modules (barrel pattern keeps public import paths unchanged) and add per-module unit tests.

Changes

src/utils/convertors (was convertors.ts, 663 lines)

Split into focused modules behind a barrel (index.ts), so all existing import sites resolve unchanged:

  • types.ts — shared types and constants
  • json.tsqueryResultToJSON
  • table.tsqueryResultToTable + table-building helpers
  • tree.tsqueryResultToTree + tree-building helpers
  • metrics.tsqueryMetricsToTable, indexMetricsToTableItem, queryMetricsToJSON

Tests split per module with shared testFixtures.ts: json.test.ts, table.test.ts, tree.test.ts, metrics.test.ts (23 tests).

src/utils/csvConverter (was csvConverter.ts)

Split into:

  • escape.tsgetCsvSeparator, escapeCsvValue
  • metrics.tsqueryMetricsToCsv
  • table.tsqueryResultToCsv

Tests: escape.test.ts, metrics.test.ts, table.test.ts (10 tests).

src/cosmosdb/AzureResourceMetadata.ts

Added AzureResourceMetadata.test.ts covering the documentEndpoint and isServerless getters (6 tests). No production changes — uses a test subclass to access the protected constructor.

Out of scope

  • Migration files — owned by another contributor.
  • Theme utils (src/webviews/theme/utils/) — verbatim vendored code from CSSWG CSS Color 4 / ThreeJS / Fluent Blocks; testing third-party reference implementations has low value.

Validation

  • npm run l10n — clean
  • npm run prettier-fix — clean
  • npm run lint — 0 errors
  • vitest — 39 tests passing

@bk201- bk201- requested a review from a team as a code owner June 12, 2026 13:11
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🎭 E2E Tests (Playwright + VS Code)

Commit: d95f5bd
Pull Request: #3151 test: Stage 2 unit coverage — split convertors/csvConverter + AzureResourceMetadata tests

🧪 Result

  • E2E Tests: ✅ success

📥 Artifacts (run)

Tip: the HTML report artifact contains a self-contained Playwright report.
Download the zip, extract, and open index.html — or run
npx playwright show-report <extracted-dir> for the interactive view.

@github-code-quality

github-code-quality Bot commented Jun 12, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/vitest

The overall coverage in the branch is 82%. The coverage in the branch is 73%.

Show a code coverage summary of the most impacted files.
File 89d42bc 525bf60 +/-
src/chat/Cosmos...tionsService.ts 53% 72% +19%
packages/nosql-...ticsProvider.ts 38% 96% +58%
packages/nosql-...ticsProvider.ts 29% 90% +61%
packages/nosql-...eryDecorator.ts 5% 83% +78%
packages/nosql-...streamParser.ts 5% 88% +83%
packages/nosql-...eryDecorator.ts 0% 86% +86%
src/services/Se...tingsService.ts 0% 94% +94%
src/utils/convertors/tree.ts 0% 95% +95%
src/utils/convertors/table.ts 0% 96% +96%
src/utils/conve...tors/metrics.ts 0% 100% +100%

Updated June 12, 2026 14:44 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🔨 Build, Lint & Test

🔗 Source

📦 Package Information

🧪 Test Results

  • Unit Tests: ✅ success
  • Integration Tests (extension host): ✅ success

📥 Artifacts (run)

✅ Build Status

Build and local tests passed. See sibling comments below for E2E and NoSQL integration results.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🔬 NoSQL language-service integration

Commit: 525bf60
Pull Request: #3151 test: Stage 2 unit coverage — split convertors/csvConverter + AzureResourceMetadata tests

🧪 Result

  • NoSQL integration tests: ✅ success

📥 Artifacts (run)

bk201- added 4 commits June 12, 2026 16:03
…uageService

Move the active-query-block resolution (non-empty region filter + active region lookup + leading/trailing whitespace trim) out of the vscode and monaco decorators into a single editor-agnostic SqlLanguageService.getActiveBlockOffsets() method. Both decorators now just convert the returned offsets to native positions, removing duplicated string logic. Adds 7 unit tests for the new method.
tsc requires the StreamParser.startState(indentUnit) argument; vitest's esbuild transform skips type-checking so it only surfaced in the CI build. Pass 4 to satisfy the signature.
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