Commit Graph

3915 Commits

Author SHA1 Message Date
Neil Macneale IV
2f137d608a Add missing table test 2026-01-02 10:50:22 -08:00
Neil Macneale IV
0f9245196f Remove a FK object 2026-01-02 10:19:12 -08:00
Neil Macneale IV
5ab894d203 Add test for missing schema object 2026-01-02 10:19:12 -08:00
Neil Macneale IV
45fe783c6f Add missing closure test 2026-01-02 10:19:12 -08:00
Neil Macneale IV
5215ed2f36 added pull command tests 2025-12-18 20:33:50 +00:00
Brian Hendriks
657ba0aebe Merge pull request #10188 from dolthub/bh/metrics-auth
Bh/metrics auth
2025-12-11 13:55:52 -08:00
Brian Hendriks
a8ea53509d repo formatting 2025-12-11 13:05:35 -08:00
Brian Hendriks
e44048ed20 add ability to skip metrics auth for the localhost 2025-12-11 11:50:11 -08:00
Brian Hendriks
6832617c61 jwt auth integration tests 2025-12-10 16:20:08 -08:00
Elian
7cff94757a Merge pull request #10097 from dolthub/codeaucafe/1430
dolthub/dolt#10030: `--filter` contribution for `dolt diff`
2025-12-09 15:14:32 -08:00
elianddb
d9cd4eea4c add backup.bats test to make sure command is allowed to run in invalid repo 2025-12-04 11:54:07 -08:00
elianddb
298c4ee0a3 amend dolt_backup impl to work in non-dolt directories 2025-12-04 10:18:38 -08:00
Elian
6fc0e63acc Merge pull request #10146 from dolthub/elian/7628b
dolthub/dolt#7628: Amend `dolt_backup` DoltgresSQL privilege check for server only
2025-12-02 10:19:39 -08:00
elianddb
aceb329a05 amend elixir docker image to locked ver. 1.18.3 2025-12-01 19:49:38 -08:00
Neil Macneale IV
7511148191 Merge pull request #10078 from dolthub/macneale4/journal-errors
journal errors, recovery, and testing
2025-12-01 17:31:15 -08:00
David Dansby
f5419aab71 Merge branch 'main' of https://github.com/dolthub/dolt into codeaucafe/1430/add-filter-opt-for-diff 2025-11-28 19:47:56 -08:00
David Dansby
b89f07b82c test(diff): add tests for renamed filter and removed alias
Add tests for the --filter=renamed option and the --filter=removed alias
that maps to dropped.

Go tests:
- Tests for filter=renamed checking all diff types
- Tests for "removed" alias mapping to dropped internally
- Verify renamed filter only includes renamed tables

BATS tests:
- Test --filter=renamed with table rename scenario
- Test --filter=dropped with table drop scenario
- Verify --filter=removed alias works same as dropped
- Verify other filters correctly exclude renamed/dropped tables

Refs: #1430
2025-11-28 19:47:31 -08:00
Elian
91eda61d50 Merge pull request #10110 from dolthub/elian/7628
dolthub/dolt#7628: Refactor `dolt backup` to use SQL interface
2025-11-26 15:23:21 -08:00
Neil Macneale IV
098ce3d7d6 Fix last test 2025-11-26 10:51:37 -08:00
Neil Macneale IV
16c1724332 more messaging about journal corruption 2025-11-26 10:25:32 -08:00
Neil Macneale IV
b065275a17 Truncate garbabe bytes, don't null pad. More testing 2025-11-26 10:25:32 -08:00
Neil Macneale IV
400e2e724e Handle corrupted journals with invalid record lengths 2025-11-26 10:25:32 -08:00
Neil Macneale IV
4324660973 Refactor fsck to load it's own database 2025-11-26 10:25:32 -08:00
Neil Macneale IV
20c5e23c0c Add a new test for fsck that trips on journal with bad entries not in jounal.idx 2025-11-26 10:25:32 -08:00
elianddb
074086b6f2 add skip for sql-server only test 2025-11-25 16:12:16 -08:00
elianddb
7b63af54a0 leave sql-backup.bats in local-remote.bash 2025-11-25 15:46:19 -08:00
elianddb
2ffae2939c fix test expectations for bats and script tests
- add invalid name test for remote bats
- add --force flag in usage tests
- add test for aws params block for dolt_backup when using server
2025-11-25 15:25:56 -08:00
elianddb
3ced9f13a3 fix system-tables.bats dolt_help expectation 2025-11-24 20:01:09 -08:00
elianddb
3fbce76fb3 fix dolt_backup proc bats test 2025-11-24 15:57:23 -08:00
elianddb
9a45d1ce43 rm del on stop_remotesrv dir 2025-11-24 15:47:32 -08:00
elianddb
fb3e8c163e fix err wrap and usage doc 2025-11-24 15:44:46 -08:00
elianddb
d128e67e9a fix unknown backup err in bats tests 2025-11-24 15:44:46 -08:00
elianddb
ee35df6ff6 mv query-server-common.bash load to remotesrv-common.bash 2025-11-24 15:44:46 -08:00
elianddb
0f1a3ab4ac mv start_remotesrv, stop_remotesrv, and wait_for_port to new remotesrv-common.bash and fix backup.bats tests 2025-11-24 15:44:46 -08:00
elianddb
3ccfc07044 rm outdated bats test in sql-backup.bats 2025-11-24 15:44:29 -08:00
elianddb
27bc150480 add http and https support to dolt_backup proc 2025-11-24 15:44:29 -08:00
elianddb
2a7270ff89 rm backup.bats from local-remote only tests list 2025-11-24 15:44:29 -08:00
elianddb
bfb80549db add dolt_backups() script tests and bats test 2025-11-24 15:44:29 -08:00
Aaron Son
a2fe5295b3 go/cmd/dolt: Allow the Dolt CLI to connect to a running dolt sql-server which is configured with require_secure_transport: true.
When Dolt CLI is running in a directory with a corresponding running sql-server
process, it will connect to the server process and complete its work using SQL
statements. Previously, the Dolt CLI was configured to always connect on a
plaintext TCP connection for these connections. That meant it did not work for
servers configured with require_secure_transport: true. One consequence was
that the published Dolt dockerhub image did not work with
require_secure_transport: true, since that image runs `dolt sql` against the
running server as part of its entrypoint.

This changes `dolt` CLI to connect over (non-verified) TLS if such as an option
is presented by the server. The CLI still falls back to plaintext as well.

Dolt CLI still does not work when the server is configured with
require_client_certificate, since Dolt CLI does not currently have a way to
configure its presented client certificate and private key. As a consequence,
at least for the time being, the published DockerHub images for Dolt do not
work with require_client_certificate: true.
2025-11-24 13:42:37 -08:00
Neil Macneale IV
63f9b5272c Enable sql-engine=remote for cherry-pick.bats 2025-11-21 10:15:01 -08:00
Neil Macneale IV
abd975f73a Change status_table type to use a byte rather than a bool 2025-11-21 10:15:01 -08:00
Jason Fulghum
e5026cba91 PR feedback 2025-11-20 15:20:00 -08:00
Jason Fulghum
db779f95d5 Add require_client_cert to sql server configuration options 2025-11-20 12:48:55 -08:00
Jason Fulghum
f2969f6b44 Adding support for configuring a CA to validate client certs, and BATS tests for client-cert auth. 2025-11-14 14:32:22 -08:00
Neil Macneale IV
dbe2d1a4ab Merge pull request #10072 from dolthub/macneale4-claude/branch-activity-disable
Optionally enable branch activity stats
2025-11-12 17:57:29 -08:00
Neil Macneale IV
84915c99cd Fix bats test to properly configure server port
The issue was that start_sql_server_with_args appends --port after
--config, but the config file was resetting to defaults. Fixed by:
1. Calling definePORT to get an available port
2. Including the port in the config file under listener.port
3. Using start_sql_server_with_args_no_port which expects PORT to be set

All 6 branch-activity tests now pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 00:01:51 +00:00
Neil Macneale IV
237fe89968 Fix bats test config to avoid duplicate YAML keys
The start_sql_server_with_config function creates a config with
a 'behavior:' section and appends the provided config file. This
caused a YAML parse error when our config also had a 'behavior:' key.

Fixed by creating a complete config file and using start_sql_server_with_args
instead, which avoids the duplicate key issue.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 23:27:50 +00:00
Neil Macneale IV
44ba402768 Add error handling for disabled branch activity tracking
- Modified branch-activity.bats to use config file that enables tracking
- Added IsTrackingEnabled() method to BranchActivityTracker
- Added error check in branch_activity_table to return helpful error message
  when tracking is disabled
- Added new test case to verify error is shown when tracking is disabled
- Error message instructs users to enable via config:
  'behavior.branch_activity_tracking: true'

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 23:14:51 +00:00
David Dansby
4adaa52628 refactor(diff): prevent empty table hdrs when filtering data-only diffs
Implement lazy table header initialization to fix a bug where
empty table headers were printed when all rows were filtered out
during data-only diffs. This occurred because BeginTable() was
called before row filtering, causing headers to print even when
no matching rows existed.

The solution introduces a lazyRowWriter that delays the BeginTable()
call until the first row is actually written. This wrapper is only
used when:
- A filter is active (added/modified/removed)
- The diff is data-only (no schema changes or table renames)

Implementation changes:
- Add shouldUseLazyHeader() helper to determine when to use lazy
initialization based on filter presence and diff type
- Add lazyRowWriter type that wraps SqlRowDiffWriter and delays
BeginTable() until first WriteRow() or WriteCombinedRow() call
- Modify diffUserTable() to skip BeginTable when using lazy writer
- Modify diffRows() to conditionally create lazyRowWriter vs normal
rowWriter based on shouldUseLazyHeader() check
- Add comprehensive unit tests for shouldUseLazyHeader logic and
lazyRowWriter behavior (5 test functions, 8+ test cases)
- Add mock implementations of diffWriter and SqlRowDiffWriter
interfaces to enable testing without database dependencies
- Fix BATS test assertions to match actual SQL output format
(lowercase type names, MODIFY COLUMN vs DROP/ADD pattern)

Test coverage:
- TestShouldUseLazyHeader: validates lazy header logic conditions
- TestLazyRowWriter_NoRowsWritten: verifies BeginTable not called
when no rows written (core lazy behavior)
- TestLazyRowWriter_RowsWritten: verifies BeginTable called on
first write
- TestLazyRowWriter_CombinedRowsWritten: tests combined row writes
- TestLazyRowWriter_InitializedOnlyOnce: ensures BeginTable called
exactly once

Refs: #1430
2025-11-10 17:08:12 -08:00
David Dansby
a619fd1a23 test(diff): add comprehensive unit tests for filter functionality
Add Go unit tests for the diff filter feature to provide fast
feedback and granular validation of filter logic.

Test coverage includes:
- diffTypeFilter struct validation (isValid method)
- Filter inclusion methods (adds, drops, modifications)
- Edge cases (empty strings, typos, case sensitivity)
- Consistency checks across all filter types
- Constant validation (values, uniqueness, lowercase)
- Invalid filter behavior verification

Tests added:
- 12 test functions
- 48+ individual test cases
- 100% coverage of diffTypeFilter struct methods

These tests complement the existing BATS integration tests
and provide unit-level regression protection.

Refs: #1430
2025-11-10 17:08:12 -08:00