Skip to content

Conversation

carlopi
Copy link
Contributor

@carlopi carlopi commented Jul 17, 2025

This is #18266 on v1.3-ossivalis, plus fix from #18289.
This is a stripped down version of #18230, that adds support for --autoloading none|available|all to unittester, without removing support for previous mode (via env variable LOCAL_EXTENSION_REPO). Keeping both possibility in place is somehow less nice, but has the big advantage that can disentangle fixing issues connected to rolling-in this in CI and allows for easier backport of this if deemed useful.

After this PR, the following modes are available for running unittester:

--autoloading none or `` (this is the default)

Same as current default, only statically linked extensions are ever used.
require in test will run a test only if the needed extension is statically linked-in.

LOCAL_EXTENSION_REPO=path/to/repo

This stays as now.
LOCAL_EXTENSION_REPO points to the repository folder.
require in tests will run a test only if the needed extension is statically linked-in OR if the extension is autoloadable
No checks are performed, so setting LOCAL_EXTENSION_REPO will fail tests at runtime where a given extension is not present on the local machine.

--autoloading available

This is similar to the previous, but:
If defined LOCAL_EXTENSION_REPO points to the repository folder, otherwise build/$BUILD_MODE/repository will be used (the default where builds place extensions)
require in tests will run a test only if:

  • the needed extension is statically linked-in
  • OR if the extension is autoloadable and available (in this case INSTALL will be performed on require, LOAD via autoloading)
  • OR if the extension is not autoloadable and available (in this case both INSTALL and LOAD to be performed on require)

--autoloading all

This is similar to the previous with regard to LOCAL_EXTENSION_REPO
require in tests will run a test always:

  • if the extension is autoloadable, both INSTALL and LOAD to happen at runtime
  • if the extension is not autoloadable, both INSTALL and LOAD to be performed on require
    This mode require either to have a complete set of extensions or pre-filtering the tests to be executed, since require aws with aws extension not available will be a test failure.

An interesting usage for --autoloading all is paired with setting LOCAL_EXTENSION_REPO=http://extensions.duckdb.org, since this will correspond to use the remote available extensions (if there).


Limitation of current PR:

  • information about whether a PR is statically linked in is implied from the fact that a given extension can be installed, and NOT from the list of statically linked in extensions. This can be improved on.
  • this is currently not run on CI due to 3 issues:
    • run_tests_one_by_one.py needs to be adapted to take more arguments
    • some vss and spatial tests needs to be adapted due to missing requires
    • this allow easier to backport this PR, if one would find that handy

@carlopi
Copy link
Contributor Author

carlopi commented Jul 17, 2025

Failure to Main.yml is connected to backporting PRs, @c-herrewijn is aware

@carlopi
Copy link
Contributor Author

carlopi commented Jul 17, 2025

Test is here irrelevant, and I think this works as intended (barred some minor issues, that are improved on main via #18254)

@Mytherin Mytherin merged commit 2e42cde into duckdb:v1.3-ossivalis Jul 17, 2025
50 of 51 checks passed
@Mytherin
Copy link
Collaborator

Thanks!

github-actions bot pushed a commit to duckdb/duckdb-r that referenced this pull request Jul 18, 2025
[Fix] Missing block when renaming fields (duckdb/duckdb#18293)
Bump vcpkg-duckdb-ports, now fixing also mingw (duckdb/duckdb#18300)
resolve hidden merge conflict with duplicate db name in json configs (duckdb/duckdb#18292)
[Unittester] Add autoloading option (duckdb/duckdb#18290)
Fixup Main.yml for v1.3-ossivalis post duckdb/duckdb#18282 (duckdb/duckdb#18289)
github-actions bot added a commit to duckdb/duckdb-r that referenced this pull request Jul 18, 2025
[Fix] Missing block when renaming fields (duckdb/duckdb#18293)
Bump vcpkg-duckdb-ports, now fixing also mingw (duckdb/duckdb#18300)
resolve hidden merge conflict with duplicate db name in json configs (duckdb/duckdb#18292)
[Unittester] Add autoloading option (duckdb/duckdb#18290)
Fixup Main.yml for v1.3-ossivalis post duckdb/duckdb#18282 (duckdb/duckdb#18289)

Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
@carlopi carlopi deleted the unittester_autoloading_v13 branch August 17, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants