mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-13 04:26:16 -08:00
* docs(performance): plan Xtream benchmark * feat(xtream-mock-server): add deterministic 100k fixture * style(xtream-mock-server): apply repository formatting * fix(xtream-mock-server): harden performance fixture data * feat(xtream-mock-server): add performance control plane * docs(performance): correct Xtream capture plan * fix(xtream-mock-server): harden performance controls * fix(xtream-mock-server): harden control lifecycle * feat(performance): add Xtream preload markers * feat(performance): trace Xtream main phases * feat(performance): mark Xtream store publications * feat(performance): trace Xtream database phases * feat(performance): trace Xtream delete cancellation * feat(performance): capture Xtream phase attribution * feat(performance): mark Sources Xtream refresh * test(performance): define Xtream benchmark evidence contracts * test(performance): add Xtream benchmark runner * test(performance): surface failure evidence writes * test(performance): align database read clock * test(performance): preserve capture failure contracts
63 lines
2.1 KiB
TypeScript
63 lines
2.1 KiB
TypeScript
import assert from 'node:assert/strict';
|
|
import { afterEach, describe, it } from 'node:test';
|
|
|
|
import type { XtreamBenchmarkManifest } from './xtream-benchmark-contract';
|
|
import { createXtreamBenchmarkSummary } from './xtream-benchmark-report';
|
|
import {
|
|
MANIFEST,
|
|
clearXtreamReportFixtureDirectories,
|
|
} from './xtream-benchmark-report.fixtures';
|
|
import {
|
|
clearXtreamProvenanceFixtureDirectories,
|
|
smokeReportFixture,
|
|
} from './xtream-benchmark-report-provenance.fixtures';
|
|
import { assertXtreamBenchmarkManifest } from './xtream-exact-schema';
|
|
|
|
afterEach(async () => {
|
|
await Promise.all([
|
|
clearXtreamReportFixtureDirectories(),
|
|
clearXtreamProvenanceFixtureDirectories(),
|
|
]);
|
|
});
|
|
|
|
describe('Xtream benchmark CDP environment', () => {
|
|
it('allows a bounded alternate smoke port but keeps formal capture on 9222', async () => {
|
|
const smokeManifest: XtreamBenchmarkManifest = {
|
|
...MANIFEST,
|
|
environment: { ...MANIFEST.environment, cdpPort: 9322 },
|
|
mode: 'smoke',
|
|
};
|
|
assert.doesNotThrow(() => assertXtreamBenchmarkManifest(smokeManifest));
|
|
assert.throws(
|
|
() =>
|
|
assertXtreamBenchmarkManifest({
|
|
...smokeManifest,
|
|
mode: 'formal',
|
|
}),
|
|
/invalid Xtream benchmark manifest/
|
|
);
|
|
|
|
const { diagnosticEvidence, iterations } = await smokeReportFixture();
|
|
const summary = createXtreamBenchmarkSummary(
|
|
smokeManifest,
|
|
iterations,
|
|
diagnosticEvidence
|
|
);
|
|
assert.equal(summary.validForComparison, false);
|
|
});
|
|
|
|
it('requires an integer CDP port from 1024 through 65535', () => {
|
|
for (const cdpPort of [1023, 65536, 9322.5, Number.NaN]) {
|
|
assert.throws(
|
|
() =>
|
|
assertXtreamBenchmarkManifest({
|
|
...MANIFEST,
|
|
environment: { ...MANIFEST.environment, cdpPort },
|
|
mode: 'smoke',
|
|
}),
|
|
/invalid Xtream benchmark manifest/
|
|
);
|
|
}
|
|
});
|
|
});
|