mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-09 06:45:46 +02:00
Merge remote-tracking branch 'origin/main' into garrytan/e2e-test-triage
# Conflicts: # CHANGELOG.md
This commit is contained in:
+19
-3
@@ -244,16 +244,32 @@ describe('gstack-analytics', () => {
|
||||
});
|
||||
|
||||
describe('gstack-telemetry-sync', () => {
|
||||
test('exits silently with no endpoint configured', () => {
|
||||
// Default: GSTACK_TELEMETRY_ENDPOINT is not set → exit 0
|
||||
test('exits silently with no Supabase URL configured', () => {
|
||||
// Default: GSTACK_SUPABASE_URL is not set → exit 0
|
||||
const result = run(`${BIN}/gstack-telemetry-sync`);
|
||||
expect(result).toBe('');
|
||||
});
|
||||
|
||||
test('exits silently with no JSONL file', () => {
|
||||
const result = run(`${BIN}/gstack-telemetry-sync`, { GSTACK_TELEMETRY_ENDPOINT: 'http://localhost:9999' });
|
||||
const result = run(`${BIN}/gstack-telemetry-sync`, { GSTACK_SUPABASE_URL: 'http://localhost:9999' });
|
||||
expect(result).toBe('');
|
||||
});
|
||||
|
||||
test('does not rename JSONL field names (edge function expects raw names)', () => {
|
||||
setConfig('telemetry', 'anonymous');
|
||||
run(`${BIN}/gstack-telemetry-log --skill qa --duration 60 --outcome success --session-id raw-fields-1`);
|
||||
|
||||
const events = parseJsonl();
|
||||
expect(events).toHaveLength(1);
|
||||
// Edge function expects these raw field names, NOT Postgres column names
|
||||
expect(events[0]).toHaveProperty('v');
|
||||
expect(events[0]).toHaveProperty('ts');
|
||||
expect(events[0]).toHaveProperty('sessions');
|
||||
// Should NOT have Postgres column names
|
||||
expect(events[0]).not.toHaveProperty('schema_version');
|
||||
expect(events[0]).not.toHaveProperty('event_timestamp');
|
||||
expect(events[0]).not.toHaveProperty('concurrent_sessions');
|
||||
});
|
||||
});
|
||||
|
||||
describe('gstack-community-dashboard', () => {
|
||||
|
||||
Reference in New Issue
Block a user