Update Harbor client and gateway integration workflows
Build and Deploy Gateway / build-and-push (push) Failing after 14s
Build and Deploy Gateway / deploy (push) Has been skipped

This commit is contained in:
2026-08-19 18:16:10 +03:00
parent 416b2b294a
commit daec12e013
63 changed files with 5016 additions and 108 deletions
+34 -1
View File
@@ -8,7 +8,7 @@ import { deviceId } from '../../dist/server/services/deviceInventoryService.js';
const mac = '00:11:22:33:44:55';
const id = deviceId(mac);
const device = { ip: '192.168.50.7', mac };
const device = { ip: '192.168.50.7', mac, alias: 'MacBook' };
const connection = (connectionId, type, host, upload, download, sourceIP = device.ip, chains = ['vpn-out']) => ({
id: connectionId,
metadata: { type, host, sourceIP },
@@ -205,3 +205,36 @@ test('domain classification normalizes known services and rejects IP or malforme
assert.equal(classifyDomain('192.0.2.1'), null);
assert.equal(classifyDomain('broken_label.example'), null);
});
test('failover activity is zero-work while disabled and uses the existing connection poll', async () => {
let observedAt = new Date('2026-08-19T10:00:00.000Z');
let response = { connections: [
connection('work', 'tproxy/tproxy-in', 'r1.googlevideo.com', 0, 0, device.ip, ['channel-primary', 'channel-selector']),
connection('probe', 'mixed/diagnostics-primary-in', 'youtube.com', 0, 10_000, device.ip, ['channel-primary']),
] };
const service = createDomainTrafficService({
observe: async () => response,
devices: () => [device],
now: () => observedAt,
});
await service.refresh();
assert.equal(service.activitySnapshot(100), null);
service.enableActivity();
observedAt = new Date('2026-08-19T10:00:02.000Z');
response.connections[0].download = 2_000;
response.connections[1].download = 99_000;
await service.refresh();
const active = service.activitySnapshot(500);
assert.equal(active.state, 'active');
assert.equal(active.totalBytesPerSecond, 1_000);
assert.equal(active.transmittingConnections, 1);
assert.equal(active.blockers[0].device, 'MacBook');
assert.equal(active.blockers[0].service, 'YouTube');
observedAt = new Date('2026-08-19T10:00:14.000Z');
await service.refresh();
assert.equal(service.activitySnapshot(500).state, 'quiet');
service.disableActivity();
assert.equal(service.activitySnapshot(500), null);
});