improve tests

This commit is contained in:
chrislu committed 2025-09-01 18:52:22 -07:00
1 parent 7d88a81482
commit dfd0897e49
6 files changed
+119 -17

No files matched your search

+6 -6
View File
@@ -8,7 +8,7 @@ import (
)
func TestSQLEngine_HybridSelectBasic(t *testing.T) {
engine := NewSQLEngine("localhost:8888")
engine := NewTestSQLEngine()
// Test SELECT with _source column to show both live and archived data
result, err := engine.ExecuteSQL(context.Background(), "SELECT *, _source FROM user_events")
@@ -77,7 +77,7 @@ func TestSQLEngine_HybridSelectBasic(t *testing.T) {
}
func TestSQLEngine_HybridSelectWithLimit(t *testing.T) {
engine := NewSQLEngine("localhost:8888")
engine := NewTestSQLEngine()
// Test SELECT with LIMIT on hybrid data
result, err := engine.ExecuteSQL(context.Background(), "SELECT * FROM user_events LIMIT 2")
@@ -96,7 +96,7 @@ func TestSQLEngine_HybridSelectWithLimit(t *testing.T) {
}
func TestSQLEngine_HybridSelectDifferentTables(t *testing.T) {
engine := NewSQLEngine("localhost:8888")
engine := NewTestSQLEngine()
// Test both user_events and system_logs tables
tables := []string{"user_events", "system_logs"}
@@ -139,7 +139,7 @@ func TestSQLEngine_HybridSelectDifferentTables(t *testing.T) {
}
func TestSQLEngine_HybridDataSource(t *testing.T) {
engine := NewSQLEngine("localhost:8888")
engine := NewTestSQLEngine()
// Test that we can distinguish between live and archived data
result, err := engine.ExecuteSQL(context.Background(), "SELECT user_id, event_type, _source FROM user_events")
@@ -203,7 +203,7 @@ func TestSQLEngine_HybridDataSource(t *testing.T) {
}
func TestSQLEngine_HybridSystemLogs(t *testing.T) {
engine := NewSQLEngine("localhost:8888")
engine := NewTestSQLEngine()
// Test system_logs with hybrid data
result, err := engine.ExecuteSQL(context.Background(), "SELECT level, message, service, _source FROM system_logs")
@@ -269,7 +269,7 @@ func TestSQLEngine_HybridSystemLogs(t *testing.T) {
}
func TestSQLEngine_HybridSelectWithTimeImplications(t *testing.T) {
engine := NewSQLEngine("localhost:8888")
engine := NewTestSQLEngine()
// Test that demonstrates the time-based nature of hybrid data
// Live data should be more recent than archived data