File: extension-upload-test.sh

package info (click to toggle)
duckdb 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 558
file content (64 lines) | stat: -rwxr-xr-x 1,473 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash

set -e
set -x

CMAKE_CONFIG=Release
EXT_BASE_PATH=build/release

if [ "${FORCE_32_BIT:0}" == "1" ]; then
  FORCE_32_BIT_FLAG="-DFORCE_32_BIT=1"
else
  FORCE_32_BIT_FLAG=""
fi

FILES="${EXT_BASE_PATH}/extension/*/*.duckdb_extension"

EXTENSION_LIST=""
for f in $FILES
do
	ext=`basename $f .duckdb_extension`
	EXTENSION_LIST="${EXTENSION_LIST}-$ext"
done
mkdir -p testext
cd testext

if [ "$2" = "oote" ]; then
  CMAKE_ROOT="../duckdb"
else
  CMAKE_ROOT=".."
fi

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 ..

duckdb_path="testext/duckdb"
unittest_path="testext/test/unittest"
if [ ! -f "${duckdb_path}" ]; then
  duckdb_path="testext/${CMAKE_CONFIG}/duckdb.exe"
  unittest_path="testext/test/${CMAKE_CONFIG}/unittest.exe"
fi

${duckdb_path} -c "FROM duckdb_extensions()"

for f in $FILES
do
	ext=`basename $f .duckdb_extension`
	install_path=${ext}
	unsigned_flag=
	if [ "$1" = "local" ]
	then
		install_path=${f}
		unsigned_flag=-unsigned
	fi
	echo ${install_path}
	${duckdb_path} ${unsigned_flag} -c "FORCE INSTALL '${install_path}'"
	${duckdb_path} ${unsigned_flag} -c "LOAD '${ext}'"
done

# Only run tests for non-local, we have tested in enough other ways
if [ "$1" != "local" ]
then
  ${unittest_path} --autoloading all --skip-compiled
fi