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
4 changes: 2 additions & 2 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
name: Build extension binaries
uses: duckdb/extension-ci-tools/.github/workflows/[email protected]
with:
duckdb_version: v1.3.0
ci_tools_version: v1.3.0
duckdb_version: v1.3.1
ci_tools_version: v1.3.1
extension_name: httpserver

# duckdb-next-build:
Expand Down
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 4984 files
2 changes: 1 addition & 1 deletion extension-ci-tools
1 change: 1 addition & 0 deletions extension_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ duckdb_extension_load(httpserver

# Any extra extensions that should be built
# e.g.: duckdb_extension_load(json)
duckdb_extension_load(json)
23 changes: 23 additions & 0 deletions test/python/httpserver_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import duckdb
import os
import pytest

# Get a fresh connection to DuckDB with the community extension binary loaded
@pytest.fixture
def duckdb_conn():
extension_binary = os.getenv('HTTPSERVER_EXTENSION_BINARY_PATH')
if (extension_binary == ''):
raise Exception('Please make sure the `HTTPSERVER_EXTENSION_BINARY_PATH` is set to run the python tests')
conn = duckdb.connect('', config={'allow_unsigned_extensions': 'true'})
conn.execute(f"load '{extension_binary}'")
return conn

def test_quack(duckdb_conn):
duckdb_conn.execute("SELECT httpserve_start('0.0.0.0', 8123, '');");
res = duckdb_conn.fetchall()
assert(res[0][0] == "HTTP server started on 0.0.0.0:8123");

def test_quack(duckdb_conn):
duckdb_conn.execute("SELECT * FROM read_json_auto('http://localhost:8123/?q=SELECT 1');");
res = duckdb_conn.fetchall()
assert(res[0][0] == "1");
28 changes: 28 additions & 0 deletions test/sql/httpserver.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# name: test/sql/httpserver.test
# description: test httpserver extension
# group: [httpserver]

statement ok
SET autoinstall_known_extensions=1; SET autoload_known_extensions=1

# Before we load the extension, this will fail
statement error
SELECT httpserve_start('0.0.0.0', 8123, '');
----
Catalog Error: Scalar Function with name httpserve_start does not exist!

# Require statement will ensure this test is run with this extension loaded
require httpserver

# Confirm the extension works
query I
SELECT httpserve_start('0.0.0.0', 8123, '');
----
HTTP server started on 0.0.0.0:8123

require json

query I
SELECT * FROM read_json_auto('http://localhost:8123/?q=SELECT 1');
----
1
23 changes: 0 additions & 23 deletions test/sql/quack.test

This file was deleted.

Loading