Skip to content

Added many tests for Dolt functions#1763

Merged
Hydrocharged merged 2 commits intomainfrom
daylon/dolt-tests
Aug 21, 2025
Merged

Added many tests for Dolt functions#1763
Hydrocharged merged 2 commits intomainfrom
daylon/dolt-tests

Conversation

@Hydrocharged
Copy link
Copy Markdown
Collaborator

This adds a lot of testing for Dolt functions. Most of these tests involve different constructs (generated columns, triggers, functions, etc.), which have exhibited failure points even if they seem relatively unrelated to the function being called. Many of these errors have been fixed in this PR and the accompanying Dolt PR, but there are still quite a few outstanding (all labeled with TODOs). These are outside of the known deficiencies due to logic that we just haven't implemented yet.

Requires:

@Hydrocharged Hydrocharged requested a review from fulghum August 20, 2025 16:50
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 20, 2025

Main PR
covering_index_scan_postgres 329.37/s 335.73/s +1.9%
index_join_postgres 152.49/s 148.36/s -2.8%
index_join_scan_postgres 195.83/s 191.83/s -2.1%
index_scan_postgres 12.27/s 12.11/s -1.4%
oltp_point_select 2486.30/s 2533.09/s +1.8%
oltp_read_only 1796.66/s 1807.42/s +0.5%
select_random_points 115.45/s 114.98/s -0.5%
select_random_ranges 129.52/s 133.21/s +2.8%
table_scan_postgres 11.40/s 11.73/s +2.8%
types_table_scan_postgres 5.43/s 5.52/s +1.6%

@github-actions
Copy link
Copy Markdown
Contributor

Main PR
Total 42090 42090
Successful 16812 16811
Failures 25278 25279
Partial Successes1 5549 5549
Main PR
Successful 39.9430% 39.9406%
Failures 60.0570% 60.0594%

${\color{red}Regressions (1)}$

fast_default

QUERY:          DELETE FROM leader;
RECEIVED ERROR: table not found: test_trigger() (errno 1146) (sqlstate HY000)

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

Comment thread testing/go/dolt_functions_test.go
Comment thread testing/go/dolt_functions_test.go
@fulghum
Copy link
Copy Markdown
Contributor

fulghum commented Aug 20, 2025

Changes look good. Have you already looked into the regression error?

Comment thread server/functions/dolt_procedures.go Outdated
@Hydrocharged
Copy link
Copy Markdown
Collaborator Author

Hydrocharged commented Aug 20, 2025

Changes look good. Have you already looked into the regression error?

Haven't looked into the regression yet, but I suspect it's due to handling deletion cases better now. It may be deleting the function and then deleting the table, and some step in table deletion may be looking for the function and erroring when it can't find it. Previously, there were cases where we could delete something and it never actually deletes, so this error wouldn't happen in that case (assuming the test just deletes things and doesn't verify that stuff is gone).

This is just an assumption though, would have to look at the test to actually find out.

It's due to the function schema serialization location change. We used to forcefully write all functions to pg_catalog (and therefore forcefully delete from pg_catalog too), but now functions can be written to any schema. We only check pg_catalog and the current schema for now though, so if the schema changes, then you can't access those functions without explicitly stating the schema. This is a known issue though (functions not using the search path), so this is a test regression but an overall improvement to actual usage.

Put another way, I didn't fix the issue of function namespace searching, I just made it a bit better than it was before, but it's still on the list of things that need to actually be fixed.

@Hydrocharged Hydrocharged enabled auto-merge August 21, 2025 09:08
@Hydrocharged Hydrocharged merged commit 2f43636 into main Aug 21, 2025
14 checks passed
@Hydrocharged Hydrocharged deleted the daylon/dolt-tests branch August 21, 2025 10:29
codeaucafe added a commit to codeaucafe/doltgresql that referenced this pull request Dec 21, 2025
Issue dolthub#1361 reported that SELECT DOLT_CLEAN() with no arguments failed
with "function dolt_clean() does not exist". This was fixed in PR dolthub#1763
which added Function0 registration for all Dolt procedures, but the
corresponding tests in dolt_functions_test.go remained skipped.

Note: PR dolthub#1373 (referenced by issue dolthub#1361) also added skipped tests in
prepared_statement_test.go, but those were already unskipped in commit
62569c7 ("finished removing custom expr type").

List of changes below:
- Remove Skip: true from zero-argument DOLT_CLEAN() tests
- Reorder test assertions so DOLT_CLEAN('t1') runs before DOLT_CLEAN()
- Add table recreation step between test cases to verify both work

Refs: dolthub#1361
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.

2 participants