Skip to content

Add unit tests for databasesql DSN parsing helpers #480

@pushkarscripts

Description

@pushkarscripts

Problem

The DSN parsing helpers in pkg/instrumentation/databasesql/parse.go currently do not have direct unit test coverage.

The existing integration tests use a mock driver and do not exercise the dialect-specific parsing logic used for common databases like MySQL, PostgreSQL, SQL Server, and SQLite. As a result, behaviors such as server.address and database name extraction are not directly validated by standalone tests.

Proposed Change

I’m planning to send a small PR adding table-driven unit tests for:

  • parseDSN
  • ParseDbName

The initial scope will focus only on common happy-path DSN formats to keep the change small and review-friendly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions