WIP: Add tests for http functions

This commit is contained in:
Peter Stockings
2025-12-03 21:12:35 +11:00
parent c5eb1ce463
commit 049c875bc2
14 changed files with 979 additions and 69 deletions

View File

@@ -0,0 +1,15 @@
CREATE TABLE IF NOT EXISTS http_function_tests (
id SERIAL PRIMARY KEY,
http_function_id INTEGER NOT NULL REFERENCES http_functions(id) ON DELETE CASCADE,
name VARCHAR(255) NOT NULL,
description TEXT,
request_method VARCHAR(10) DEFAULT 'POST',
request_headers JSONB DEFAULT '{}',
request_body JSONB DEFAULT '{}',
expected_status VARCHAR(50) NOT NULL DEFAULT 'SUCCESS',
expected_output JSONB,
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);
CREATE INDEX idx_http_function_tests_function_id ON http_function_tests(http_function_id);

View File

@@ -0,0 +1,2 @@
ALTER TABLE http_function_tests
ADD COLUMN IF NOT EXISTS assertions JSONB DEFAULT '[]';