Skip to content

New component : unit_test - #1521

Closed
olivierauverlot wants to merge 1 commit into
sqlpage:mainfrom
olivierauverlot:unit_test
Closed

olivierauverlot wants to merge 1 commit into
sqlpage:mainfrom
olivierauverlot:unit_test

Conversation

@olivierauverlot

@olivierauverlot olivierauverlot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

A component for displaying the results of a suite of unit tests written in SQL.

The goal is to encourage the creation of tests to improve the quality of applications and APIs built with SQLPage. Using SQL only, you can test the database schema, data manipulation, the behavior of stored procedures, and the functionalities of REST APIs built with SQLPage.

select 
    'unit_test' as component;
select
    (1 = 1) as success,
    'The test passed successfully.' as title,
    'This is a simple test that always passes.' as description;
select
    (1 = 0) as success,
    'The test failed.' as title;
image

@lovasoa

lovasoa commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Hi Olivier !

Testing is currently not handled at all inside sqlpage, and it's an area I'd like to improve.

But I don't think a graphical sqlpage component is the right answer to this problem.
I would like tests outputs to be available on the command line, so that you can run tests on CI, let an agent run tests, etc...

The direction I would like to go in is a standard sqlpage test command, where you would write your test files in a standard location, not served as a part of the application. You would enter something like sqlpage/tests/my_test.sql

select sum(status = bad) as actual, 0 as expected from my_table, 'no bad statuses' as text;

the run sqlpage test on the cli, get nice error messages nd a non zero return code on failures and it would integrate with whatever you use to run tests automatically on every change to your code, without you having to open a webpage in your browser and scroll to find failing tests

@lovasoa lovasoa closed this Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants