Skip to content

Add end-to-end tests that build and run the sqlcmd binary #641

Description

Background

As noted by David Shiflet (@shueybubbles) in PR #640:

feels like we need some tests that build the app in /cmd/modern and run it. This case is a good one to start with.

Proposal

Add e2e tests that actually build the sqlcmd binary and exercise real-world scenarios. The piped input fix from #640 would be a good first test case.

Suggested test cases

  1. Piped input - Verify that piping SQL to sqlcmd works without panicking (regression test for sqlcmd panic when run inside emacs #607)
  2. Basic query execution - Verify -Q\ flag works correctly
  3. Input file execution - Verify -i\ flag works correctly
  4. Help output - Verify --help\ returns expected output

Implementation notes

  • Tests would live in \cmd/modern/e2e_test.go\ or similar
  • Use \go build\ to compile the binary, then \�xec.Command\ to run it
  • May need build tags to skip in CI if no SQL Server is available for connection tests
  • Non-connection tests (like help, version, piped input that fails gracefully) can run anywhere

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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