mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-29 08:52:25 +00:00
fix(ci): systematic fixes for E2E tests and CI environment
- `js/nostr/client.js`: Exposed `derivePrivateKeyFromSecret` to `NostrClient` (delegating to `SignerManager`) to support programmatic login in E2E tests. - `tests/e2e/helpers/bitvidTestFixture.ts`: Refactored to use dynamic relay ports based on `workerIndex` to fix parallel execution collisions. - `scripts/agent/simple-relay.mjs`: Updated `close()` to force terminate connected clients, preventing test teardown hangs. - `scripts/check-sw-compat.mjs`: Added try-catch around git commands to gracefully handle shallow clones in CI environments. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
f0f078b843
commit
3ef17d1122
4 files changed
+54
-33
No files matched your search
@@ -194,6 +194,11 @@ export function startRelay(port = 8888, options = {}) {
|
||||
return {
|
||||
close: () => {
|
||||
return new Promise((resolve) => {
|
||||
// Force close all connected clients
|
||||
for (const client of wss.clients) {
|
||||
client.terminate();
|
||||
}
|
||||
|
||||
const closeHttp = httpServer
|
||||
? new Promise((r) => httpServer.close(r))
|
||||
: Promise.resolve();
|
||||
|
||||
+20
-15
@@ -13,24 +13,29 @@ const CRITICAL_PATH_PATTERNS = [
|
||||
];
|
||||
|
||||
function getChangedFilesAgainstHeadParent() {
|
||||
const hasHeadParent = execSync('git rev-parse --verify --quiet HEAD^', {
|
||||
encoding: 'utf8',
|
||||
stdio: ['ignore', 'pipe', 'ignore']
|
||||
}).trim();
|
||||
try {
|
||||
const hasHeadParent = execSync('git rev-parse --verify --quiet HEAD^', {
|
||||
encoding: 'utf8',
|
||||
stdio: ['ignore', 'pipe', 'ignore']
|
||||
}).trim();
|
||||
|
||||
if (!hasHeadParent) {
|
||||
if (!hasHeadParent) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const output = execSync('git diff-tree --no-commit-id --name-only -r HEAD', {
|
||||
encoding: 'utf8'
|
||||
}).trim();
|
||||
|
||||
if (!output) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return output.split('\n').map((value) => value.trim()).filter(Boolean);
|
||||
} catch (error) {
|
||||
console.warn('[sw-compat] Skipping check: unable to determine HEAD^ or git history unavailable.');
|
||||
return [];
|
||||
}
|
||||
|
||||
const output = execSync('git diff-tree --no-commit-id --name-only -r HEAD', {
|
||||
encoding: 'utf8'
|
||||
}).trim();
|
||||
|
||||
if (!output) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return output.split('\n').map((value) => value.trim()).filter(Boolean);
|
||||
}
|
||||
|
||||
function getCriticalPathDiff() {
|
||||
|
||||
Reference in new issue
Block a user