Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions .github/workflows/OSX.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,6 @@ jobs:
run_autoload_tests: ${{ matrix.run_autoload_tests }}
ninja: 1

- name: Test statically linked extensions
if: ${{ matrix.osx_arch == 'arm64' && inputs.skip_tests != 'true' }}
shell: bash
run: |
python3 scripts/run_tests_one_by_one.py ./build/release/test/unittest

- uses: actions/upload-artifact@v4
with:
name: duckdb-extensions-${{ matrix.duckdb_arch }}
Expand All @@ -286,9 +280,7 @@ jobs:
env:
LOCAL_EXTENSION_REPO: ${{ github.workspace }}
run: |
python3 scripts/get_test_list.py --file-contains 'require ' --list '"*.test"' > test.list
python3 scripts/get_test_list.py --file-contains 'require-env LOCAL_EXTENSION_REPO' --list '"*.test"' >> test.list
python3 scripts/run_tests_one_by_one.py ./build/release/test/unittest '-f test.list'
./build/release/test/unittest --autoloading available --skip-compiled

upload-osx-extensions:
name: Upload OSX Extensions
Expand Down
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ option(FORCE_ASSERT "Enable checking of assertions, even in release mode" FALSE)
option(TREAT_WARNINGS_AS_ERRORS "Treat warnings as errors" FALSE)
option(EXPORT_DLL_SYMBOLS "Export dll symbols on Windows, else import" TRUE)
option(BUILD_RDTSC "Enable the rdtsc instruction." FALSE)
option(TEST_REMOTE_INSTALL "Test installation of specific extensions." FALSE)
option(SMALLER_BINARY "Produce a smaller binary by trimming specialized code paths. This can negatively affect performance." FALSE)
option(NATIVE_ARCH "Compile targeting the native architecture" FALSE)
option(OVERRIDE_NEW_DELETE "Override C++ new/delete (only when jemalloc is enabled)" FALSE)
Expand Down Expand Up @@ -781,9 +780,6 @@ function(add_extension_definitions)
add_definitions(-DDUCKDB_EXTENSIONS_TEST_WITH_LOADABLE=\",${COMMA_SEPARATED_EXTENSIONS},\")
add_definitions(-DDUCKDB_EXTENSIONS_BUILD_PATH="${CMAKE_BINARY_DIR}/extension")
endif()
if(NOT("${TEST_REMOTE_INSTALL}" STREQUAL "OFF"))
add_definitions(-DDUCKDB_TEST_REMOTE_INSTALL="${TEST_REMOTE_INSTALL}")
endif()

if(${DISABLE_BUILTIN_EXTENSIONS})
add_definitions(-DDISABLE_BUILTIN_EXTENSIONS=${DISABLE_BUILTIN_EXTENSIONS})
Expand Down
4 changes: 2 additions & 2 deletions scripts/extension-upload-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ else
CMAKE_ROOT=".."
fi

cmake -DCMAKE_BUILD_TYPE=${CMAKE_CONFIG} ${FORCE_32_BIT_FLAG} -DTEST_REMOTE_INSTALL="${EXTENSION_LIST}" ${CMAKE_ROOT}
cmake -DCMAKE_BUILD_TYPE=${CMAKE_CONFIG} ${FORCE_32_BIT_FLAG} -DEXTENSION_TESTS_ONLY=1 -DDUCKDB_EXTENSION_CONFIGS=".github/config/in_tree_extensions.cmake;.github/config/out_of_tree_extensions.cmake" ${CMAKE_ROOT}
cmake --build . --config ${CMAKE_CONFIG}
cd ..

Expand Down Expand Up @@ -60,5 +60,5 @@ done
# Only run tests for non-local, we have tested in enough other ways
if [ "$1" != "local" ]
then
${unittest_path}
${unittest_path} --autoloading all --skip-compiled
fi
17 changes: 0 additions & 17 deletions src/main/extension/extension_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,23 +433,6 @@ ExtensionLoadResult ExtensionHelper::LoadExtension(DuckDB &db, const std::string

ExtensionLoadResult ExtensionHelper::LoadExtensionInternal(DuckDB &db, const std::string &extension,
bool initial_load) {
#ifdef DUCKDB_TEST_REMOTE_INSTALL
if (!initial_load && StringUtil::Contains(DUCKDB_TEST_REMOTE_INSTALL, extension)) {
Connection con(db);
auto result = con.Query("INSTALL " + extension);
if (result->HasError()) {
result->Print();
return ExtensionLoadResult::EXTENSION_UNKNOWN;
}
result = con.Query("LOAD " + extension);
if (result->HasError()) {
result->Print();
return ExtensionLoadResult::EXTENSION_UNKNOWN;
}
return ExtensionLoadResult::LOADED_EXTENSION;
}
#endif

#ifdef DUCKDB_EXTENSIONS_TEST_WITH_LOADABLE
// Note: weird comma's are on purpose to do easy string contains on a list of extension names
if (!initial_load && StringUtil::Contains(DUCKDB_EXTENSIONS_TEST_WITH_LOADABLE, "," + extension + ",")) {
Expand Down
2 changes: 2 additions & 0 deletions test/extension/autoloading_base.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# description: Base tests for the autoloading mechanism for extensions
# group: [extension]

require httpfs

# This test assumes icu and json to be available in the LOCAL_EXTENSION_REPO and NOT linked into duckdb statically
# -> this should be the case for our autoloading tests where we have the local_extension_repo variable set
require-env LOCAL_EXTENSION_REPO
Expand Down
2 changes: 2 additions & 0 deletions test/extension/autoloading_current_setting.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# -> this should be the case for our autoloading tests where we have the local_extension_repo variable set
require-env LOCAL_EXTENSION_REPO

require httpfs

statement ok
set extension_directory='__TEST_DIR__/autoloading_current_setting'

Expand Down
2 changes: 2 additions & 0 deletions test/extension/autoloading_filesystems.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# description: Tests for autoloading with filesystems
# group: [extension]

require httpfs

# This test assumes icu and json to be available in the LOCAL_EXTENSION_REPO and NOT linked into duckdb statically
# -> this should be the case for our autoloading tests where we have the local_extension_repo variable set
require-env LOCAL_EXTENSION_REPO
Expand Down
2 changes: 2 additions & 0 deletions test/extension/autoloading_load_only.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# description: Tests for autoloading with no autoinstall
# group: [extension]

require httpfs

# This test assumes icu and json to be available in the LOCAL_EXTENSION_REPO and NOT linked into duckdb statically
# -> this should be the case for our autoloading tests where we have the local_extension_repo variable set
require-env LOCAL_EXTENSION_REPO
Expand Down
2 changes: 2 additions & 0 deletions test/extension/autoloading_reset_setting.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# description: Testing reset setting that lives in an extension that can be autoloaded
# group: [extension]

require httpfs

# This test assumes httpfs and json to be available in the LOCAL_EXTENSION_REPO and NOT linked into duckdb statically
# -> this should be the case for our autoloading tests where we have the local_extension_repo variable set
require-env LOCAL_EXTENSION_REPO
Expand Down
2 changes: 2 additions & 0 deletions test/extension/duckdb_extension_settings.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# description: settings for extensions
# group: [extension]

require httpfs

statement ok
SET autoinstall_known_extensions = true;

Expand Down
2 changes: 2 additions & 0 deletions test/issues/general/test_16213.test_slow
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# description: Issue 16213 - Specific query not finishing since v1.1.0 and filling up all temp disk space
# group: [general]

require no_extension_autoloading "EXPECTED: ICU casts to Date do not trigger autoloading"

require icu

# replicate date generation in issue, but in SQL
Expand Down
2 changes: 2 additions & 0 deletions test/sql/function/list/lambdas/incorrect.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# description: Test incorrect usage of the lambda functions
# group: [lambdas]

require no_extension_autoloading "EXPECTED: This tests is not compatible with JSON extension, that will otherwise be autoloaded"

statement ok
PRAGMA enable_verification;

Expand Down
2 changes: 1 addition & 1 deletion test/sql/logging/file_system_logging.test
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ FROM 'https://github.com/duckdb/duckdb/raw/main/data/csv/customer.csv'
query IIII
SELECT scope, type, log_level, regexp_replace(message, '\"path\":.*test.csv"', '"test.csv"')
FROM duckdb_logs
WHERE type = 'FileSystem'
WHERE type = 'FileSystem' AND message NOT LIKE '%duckdb_extension%'
ORDER BY timestamp
----
CONNECTION FileSystem TRACE {"fs":"HTTPFileSystem","path":"https://github.com/duckdb/duckdb/raw/main/data/csv/customer.csv","op":"OPEN"}
Expand Down
12 changes: 6 additions & 6 deletions test/sql/pragma/test_enable_http_logging.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# description: Test PRAGMA enable_http_logging parsing
# group: [pragma]

# select the location of where to save the http logging output (instead of printing to stdout)
statement error
SET http_logging_output='__TEST_DIR__/httplog.txt'
----
Not implemented Error: This setting is deprecated and can no longer be used. Check out the DuckDB docs on logging for more information

# disable/enable
statement ok
SET enable_http_logging=false

statement ok
SET enable_http_logging=true

# select the location of where to save the http logging output (instead of printing to stdout)
statement error
SET http_logging_output='__TEST_DIR__/httplog.txt'
----
Not implemented Error: This setting is deprecated and can no longer be used. Check out the DuckDB docs on logging for more information
16 changes: 13 additions & 3 deletions test/sqlite/sqllogic_test_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ void SQLLogicTestRunner::EndLoop() {
}
}

ExtensionLoadResult SQLLogicTestRunner::LoadExtension(DuckDB &db, const std::string &extension) {
Connection con(db);
auto result = con.Query("LOAD " + extension);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change means that every single test we run by default runs into at least one exception ("core_functions" failed to load). Can we only run LOAD ... when autoloading is set to a non-default value, instead of enabling this behavior by default?

if (!result->HasError()) {
return ExtensionLoadResult::LOADED_EXTENSION;
}
return ExtensionHelper::LoadExtension(db, extension);
}

void SQLLogicTestRunner::LoadDatabase(string dbpath, bool load_extensions) {
loaded_databases.push_back(dbpath);

Expand All @@ -127,7 +136,7 @@ void SQLLogicTestRunner::LoadDatabase(string dbpath, bool load_extensions) {

auto &test_config = TestConfiguration::Get();
for (auto ext : test_config.ExtensionToBeLoadedOnLoad()) {
ExtensionHelper::LoadExtension(*db, ext);
SQLLogicTestRunner::LoadExtension(*db, ext);
}
} catch (std::exception &ex) {
ErrorData err(ex);
Expand All @@ -139,7 +148,7 @@ void SQLLogicTestRunner::LoadDatabase(string dbpath, bool load_extensions) {
// load any previously loaded extensions again
if (load_extensions) {
for (auto &extension : extensions) {
ExtensionHelper::LoadExtension(*db, extension);
SQLLogicTestRunner::LoadExtension(*db, extension);
}
}
}
Expand Down Expand Up @@ -587,7 +596,7 @@ RequireResult SQLLogicTestRunner::CheckRequire(SQLLogicParser &parser, const vec
bool perform_install = false;
bool perform_load = false;
if (!config->options.autoload_known_extensions) {
auto result = ExtensionHelper::LoadExtension(*db, param);
auto result = SQLLogicTestRunner::LoadExtension(*db, param);
if (result == ExtensionLoadResult::LOADED_EXTENSION) {
// add the extension to the list of loaded extensions
extensions.insert(param);
Expand Down Expand Up @@ -618,6 +627,7 @@ RequireResult SQLLogicTestRunner::CheckRequire(SQLLogicParser &parser, const vec
if (res->HasError()) {
return RequireResult::MISSING;
}
extensions.insert(param);
}
return RequireResult::PRESENT;
}
Expand Down
1 change: 1 addition & 0 deletions test/sqlite/sqllogic_test_runner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class SQLLogicTestRunner {
string ReplaceLoopIterator(string text, string loop_iterator_name, string replacement);
string LoopReplacement(string text, const vector<LoopDefinition> &loops);
bool ForEachTokenReplace(const string &parameter, vector<string> &result);
static ExtensionLoadResult LoadExtension(DuckDB &db, const std::string &extension);

private:
RequireResult CheckRequire(SQLLogicParser &parser, const vector<string> &params);
Expand Down
Loading