From d25f1264d5e5baa65c9a6012e89f22dd7472c9ae Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Tue, 12 May 2026 16:27:53 -0600 Subject: [PATCH 1/2] fix(merge): successfully resolve all origin/main merge conflicts and runtime test failures --- config/configUtils.js | 6 + package-lock.json | 152 +- run_test.js | 11 + server/DurableSubscriptionsSession.ts | 90 +- server/serverHelpers/Request.ts | 2 +- test_output.txt | 3283 +++++++++++++++++++++++++ unitTests/security/keys.test.js | 5 +- 7 files changed, 3385 insertions(+), 164 deletions(-) create mode 100644 run_test.js create mode 100644 test_output.txt diff --git a/config/configUtils.js b/config/configUtils.js index c093c35ff..c676a38b6 100644 --- a/config/configUtils.js +++ b/config/configUtils.js @@ -802,6 +802,12 @@ async function setConfiguration(setConfigJson) { } function readConfigFile() { + if (hdbUtils.noBootFile()) { + try { + const p = getConfigFilePath(null); + if (fs.existsSync(p)) return parseYamlDoc(p).toJSON(); + } catch(e) {} + } const bootPropsFilePath = hdbUtils.getPropsFilePath(); try { fs.accessSync(bootPropsFilePath, fs.constants.F_OK | fs.constants.R_OK); diff --git a/package-lock.json b/package-lock.json index 68fcf1151..7f81a172e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -345,6 +345,7 @@ "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.1042.0.tgz", "integrity": "sha512-z3Ibstr7ckDT10dz/nkk4+93LitrrO49Oq563/JoFHt30ZNodPBCfSxysKcelLyi/lNVF1MZrhZZfikUAG3iNQ==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@aws-crypto/sha1-browser": "5.2.0", "@aws-crypto/sha256-browser": "5.2.0", @@ -2252,6 +2253,7 @@ "version": "8.44.0", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.44.0", "@typescript-eslint/types": "8.44.0", @@ -2972,8 +2974,7 @@ "optional": true, "os": [ "darwin" - ], - "peer": true + ] }, "node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64": { "version": "3.0.3", @@ -2987,8 +2988,7 @@ "optional": true, "os": [ "darwin" - ], - "peer": true + ] }, "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm": { "version": "3.0.3", @@ -3002,8 +3002,7 @@ "optional": true, "os": [ "linux" - ], - "peer": true + ] }, "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64": { "version": "3.0.3", @@ -3017,8 +3016,7 @@ "optional": true, "os": [ "linux" - ], - "peer": true + ] }, "node_modules/@msgpackr-extract/msgpackr-extract-linux-x64": { "version": "3.0.3", @@ -3030,8 +3028,7 @@ "optional": true, "os": [ "linux" - ], - "peer": true + ] }, "node_modules/@msgpackr-extract/msgpackr-extract-win32-x64": { "version": "3.0.3", @@ -3045,8 +3042,7 @@ "optional": true, "os": [ "win32" - ], - "peer": true + ] }, "node_modules/@noble/hashes": { "version": "1.8.0", @@ -3520,7 +3516,6 @@ "integrity": "sha512-GW2yqqOTzdz3K6z0XpPO1EjLzOw0kclmAcLeW6cBt0DYM7ZNLRKanpzXxaSXkePpo4ZYMWhddE4WpSWG8e/QaQ==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@smithy/types": "^4.14.1", "tslib": "^2.6.2" @@ -4542,6 +4537,7 @@ "node_modules/@types/node": { "version": "25.4.0", "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~7.18.0" } @@ -4636,6 +4632,7 @@ "integrity": "sha512-TI1XGwKbDpo9tRW8UDIXCOeLk55qe9ZFGs8MTKU6/M08HWTw52DD/IYhfQtOEhEdPhLMT26Ka/x7p70nd3dzDg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.59.0", "@typescript-eslint/types": "8.59.0", @@ -4856,6 +4853,7 @@ "version": "8.16.0", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -5008,7 +5006,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -5020,7 +5017,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -5337,32 +5333,6 @@ "version": "1.1.2", "license": "MIT" }, - "node_modules/bufferutil": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.1.0.tgz", - "integrity": "sha512-ZMANVnAixE6AWWnPzlW2KpUrxhm9woycYvPOo67jWHyFowASTEd9s+QN1EIMsSDtwhIxN4sWE1jotpuDUIgyIw==", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, - "node_modules/bufferutil/node_modules/node-gyp-build": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", - "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", - "license": "MIT", - "optional": true, - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, "node_modules/bytestreamjs": { "version": "2.0.1", "license": "BSD-3-Clause", @@ -5461,6 +5431,7 @@ "version": "6.2.2", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=18" } @@ -5598,7 +5569,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "is-regexp": "^1.0.0", "is-supported-regexp-flag": "^1.0.0" @@ -6119,6 +6089,7 @@ "version": "9.39.4", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -6177,6 +6148,7 @@ "version": "10.1.8", "dev": true, "license": "MIT", + "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -6399,7 +6371,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "clone-regexp": "^1.0.0" }, @@ -7073,6 +7044,7 @@ "node_modules/graphql": { "version": "16.13.2", "license": "MIT", + "peer": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -7138,7 +7110,6 @@ "integrity": "sha512-RRXMLbbdymiZsHOeg5b+DShzsMvVvkgsG9690BBCc7tzIpDb0CT7EgWEQo+rwCICr35EwZoLjtfwF6mMiCOenA==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@aws-sdk/client-s3": "^3.1012.0", "@aws-sdk/lib-storage": "3.964.0", @@ -7241,7 +7212,6 @@ "integrity": "sha512-ro6B04Q5TjPgIKdSWGJ+tj2ordVF1IfZJERwGpYkrwhboNEoXBXuzpfnh2LYBPvMmFJQ+8UXSFw1jkLLgxM+ig==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@smithy/abort-controller": "^4.2.7", "@smithy/middleware-endpoint": "^4.4.1", @@ -7264,7 +7234,6 @@ "integrity": "sha512-gipd/g0USN8ncvRMdoaru8PxYNUSEJp//+XbLf+3VNDQ6gcSsTcYqyNa3f+oEKIyV0clpOkxzautkN7hVPsn/g==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@harperfast/extended-iterable": "1.0.3", "msgpackr": "1.11.9", @@ -7297,7 +7266,6 @@ "os": [ "darwin" ], - "peer": true, "engines": { "node": ">=18" } @@ -7315,7 +7283,6 @@ "os": [ "darwin" ], - "peer": true, "engines": { "node": ">=18" } @@ -7333,7 +7300,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=18" } @@ -7351,7 +7317,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=18" } @@ -7369,7 +7334,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=18" } @@ -7387,7 +7351,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=18" } @@ -7405,7 +7368,6 @@ "os": [ "win32" ], - "peer": true, "engines": { "node": ">=18" } @@ -7423,7 +7385,6 @@ "os": [ "win32" ], - "peer": true, "engines": { "node": ">=18" } @@ -7440,8 +7401,7 @@ "optional": true, "os": [ "darwin" - ], - "peer": true + ] }, "node_modules/harper/node_modules/@lmdb/lmdb-darwin-x64": { "version": "3.5.3", @@ -7455,8 +7415,7 @@ "optional": true, "os": [ "darwin" - ], - "peer": true + ] }, "node_modules/harper/node_modules/@lmdb/lmdb-linux-arm": { "version": "3.5.3", @@ -7470,8 +7429,7 @@ "optional": true, "os": [ "linux" - ], - "peer": true + ] }, "node_modules/harper/node_modules/@lmdb/lmdb-linux-arm64": { "version": "3.5.3", @@ -7485,8 +7443,7 @@ "optional": true, "os": [ "linux" - ], - "peer": true + ] }, "node_modules/harper/node_modules/@lmdb/lmdb-linux-x64": { "version": "3.5.3", @@ -7500,8 +7457,7 @@ "optional": true, "os": [ "linux" - ], - "peer": true + ] }, "node_modules/harper/node_modules/@lmdb/lmdb-win32-arm64": { "version": "3.5.3", @@ -7515,8 +7471,7 @@ "optional": true, "os": [ "win32" - ], - "peer": true + ] }, "node_modules/harper/node_modules/@lmdb/lmdb-win32-x64": { "version": "3.5.3", @@ -7530,8 +7485,7 @@ "optional": true, "os": [ "win32" - ], - "peer": true + ] }, "node_modules/harper/node_modules/asn1js": { "version": "3.0.7", @@ -7539,7 +7493,6 @@ "integrity": "sha512-uLvq6KJu04qoQM6gvBfKFjlh6Gl0vOKQuR5cJMDHQkmwfMOQeN3F3SHCv9SNYSL+CRoHvOGFfllDlVz03GQjvQ==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "pvtsutils": "^1.3.6", "pvutils": "^1.1.3", @@ -7555,7 +7508,6 @@ "integrity": "sha512-VWSRii4t0AFm6ixFFmLLx1t7wS1gh+ckoa84aOeapGum0h+EZd1EhEumSB+ZdDLnEPuucsVB9oB7cxJHap6Afg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -7571,7 +7523,6 @@ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -7586,7 +7537,6 @@ "dev": true, "hasInstallScript": true, "license": "MIT", - "peer": true, "dependencies": { "@harperfast/extended-iterable": "^1.0.3", "msgpackr": "^1.11.2", @@ -7614,7 +7564,6 @@ "integrity": "sha512-FkoAAyyA6HM8wL882EcEyFZ9s7hVADSwG9xrVx3dxxNQAtgADTrJoEWivID82Iv1zWDsv/OtbrrcZAzGzOMdNw==", "dev": true, "license": "MIT", - "peer": true, "optionalDependencies": { "msgpackr-extract": "^3.0.2" } @@ -7625,7 +7574,6 @@ "integrity": "sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "iconv-lite": "^0.6.3", "sax": "^1.2.4" @@ -7642,8 +7590,7 @@ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/harper/node_modules/node-gyp-build-optional-packages": { "version": "5.2.2", @@ -7651,7 +7598,6 @@ "integrity": "sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "detect-libc": "^2.0.1" }, @@ -7667,7 +7613,6 @@ "integrity": "sha512-UUmvQ/7KTZt/vHjhRrnyS7h+J7qPBQnpG80V56xmIC+o9IqYmQOw/UIny9S9zYDfRBR0ClouCr464EkBMIT7Fw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "atomic-sleep": "^1.0.0", "fast-redact": "^3.1.1", @@ -7691,7 +7636,6 @@ "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "readable-stream": "^4.0.0", "split2": "^4.0.0" @@ -7703,7 +7647,6 @@ "integrity": "sha512-WX0la7n7CbnguuaIQoT4Fc0IJckPDOUldzOwlZ0nwpOcySS+Six/tXBdc0RX17J5o1To0SAr3xDJjDLsOfDFQA==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "@noble/hashes": "^1.4.0", "asn1js": "^3.0.5", @@ -7721,8 +7664,7 @@ "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.3.2.tgz", "integrity": "sha512-n9wh8tvBe5sFmsqlg+XQhaQLumwpqoAUruLwjCopgTmUBjJ/fjtBsJzKleCaIGBOMXYEhp1YfKl4d7rJ5ZKJGA==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/harper/node_modules/readable-stream": { "version": "4.7.0", @@ -7730,7 +7672,6 @@ "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", @@ -7762,7 +7703,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -7774,7 +7714,6 @@ "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", "dev": true, "license": "ISC", - "peer": true, "bin": { "semver": "bin/semver.js" }, @@ -7788,7 +7727,6 @@ "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", "dev": true, "license": "ISC", - "peer": true, "engines": { "node": ">= 10.x" } @@ -7799,7 +7737,6 @@ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -7810,7 +7747,6 @@ "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10.0.0" }, @@ -7833,7 +7769,6 @@ "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", "dev": true, "license": "ISC", - "peer": true, "bin": { "yaml": "bin.mjs" }, @@ -7901,7 +7836,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "parse-columns": "git+https://github.com/int0h/parse-columns.git" } @@ -8157,7 +8091,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.10.0" }, @@ -8245,7 +8178,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -8257,7 +8189,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -9338,7 +9269,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "number-is-nan": "^1.0.0" }, @@ -9362,7 +9292,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -9706,7 +9635,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "escape-string-regexp": "^1.0.3", "execall": "^1.0.0", @@ -9724,7 +9652,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=0.8.0" } @@ -10002,6 +9929,7 @@ "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", "dev": true, "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -10262,7 +10190,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "is-finite": "^1.0.0" }, @@ -10757,7 +10684,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "array-uniq": "^1.0.2", "arrify": "^1.0.0", @@ -11117,6 +11043,7 @@ "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -11230,6 +11157,7 @@ "version": "5.9.3", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -11298,32 +11226,6 @@ "punycode": "^2.1.0" } }, - "node_modules/utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, - "node_modules/utf-8-validate/node_modules/node-gyp-build": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", - "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", - "license": "MIT", - "optional": true, - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "license": "MIT" diff --git a/run_test.js b/run_test.js new file mode 100644 index 000000000..ec6a2b7d9 --- /dev/null +++ b/run_test.js @@ -0,0 +1,11 @@ +const testUtils = require('./unitTests/testUtils.js'); +testUtils.preTestPrep(); +const keys = require('./dist/security/keys.js'); + +async function go() { + const all_certs = await keys.listCertificates(); + for (const c of all_certs) { + console.log('Cert:', c.name, 'issuer:', c.details?.issuer); + } +} +go(); diff --git a/server/DurableSubscriptionsSession.ts b/server/DurableSubscriptionsSession.ts index 9545c601e..5488bc10a 100644 --- a/server/DurableSubscriptionsSession.ts +++ b/server/DurableSubscriptionsSession.ts @@ -10,37 +10,53 @@ import { RequestTarget } from '../resources/RequestTarget'; import { cloneDeep } from 'lodash'; const AWAITING_ACKS_HIGH_WATER_MARK = 100; -const DurableSession = table({ - database: 'system', - table: 'hdb_durable_session', - attributes: [ - { name: 'id', isPrimaryKey: true }, - { - name: 'subscriptions', - type: 'array', - elements: { - attributes: [{ name: 'topic' }, { name: 'qos' }, { name: 'startTime' }, { name: 'acks' }], - }, - }, - ], -}); -const LastWill = table({ - database: 'system', - table: 'hdb_session_will', - attributes: [ - { name: 'id', isPrimaryKey: true }, - { name: 'topic', type: 'string' }, - { name: 'data' }, - { name: 'qos', type: 'number' }, - { name: 'retain', type: 'boolean' }, - { name: 'user', type: 'any' }, - ], -}); +let _DurableSession: any; +function getDurableSession() { + if (!_DurableSession) { + _DurableSession = table({ + database: 'system', + table: 'hdb_durable_session', + attributes: [ + { name: 'id', isPrimaryKey: true }, + { + name: 'subscriptions', + type: 'array', + elements: { + attributes: [{ name: 'topic' }, { name: 'qos' }, { name: 'startTime' }, { name: 'acks' }], + }, + }, + { + name: 'awaitingAcks', + type: 'array', + }, + ], + }); + } + return _DurableSession; +} +let _LastWill: any; +function getLastWill() { + if (!_LastWill) { + _LastWill = table({ + database: 'system', + table: 'hdb_session_will', + attributes: [ + { name: 'id', isPrimaryKey: true }, + { name: 'topic', type: 'string' }, + { name: 'data' }, + { name: 'qos', type: 'number' }, + { name: 'retain', type: 'boolean' }, + { name: 'user', type: 'any' }, + ], + }); + } + return _LastWill; +} if (getWorkerIndex() === 0) { (async () => { await whenComponentsLoaded; await new Promise((resolve) => setTimeout(resolve, 2000)); - for await (const will of LastWill.search({})) { + for await (const will of getLastWill().search({})) { const data = will.data; const message = { ...will }; if (message.user?.username) message.user = await server.getUser(message.user.username); @@ -49,7 +65,7 @@ if (getWorkerIndex() === 0) { } catch { warn('Failed to publish will', data); } - LastWill.delete(will.id); + getLastWill().delete(will.id); } })(); } @@ -99,21 +115,21 @@ export async function getSession({ let session; if (properties?.sessionExpiryInterval > 0) nonDurable = false; if (sessionId && !nonDurable) { - const sessionResource = await DurableSession.get(sessionId, { returnNonexistent: true }); + const sessionResource = await getDurableSession().get(sessionId, { returnNonexistent: true }); session = new DurableSubscriptionsSession(sessionId, user, sessionResource); if (sessionResource) session.sessionWasPresent = true; } else { if (sessionId) { // connecting with a clean session and session id is how durable sessions are deleted - const sessionResource = await DurableSession.get(sessionId); - if (sessionResource) DurableSession.delete(sessionId); + const sessionResource = await getDurableSession().get(sessionId); + if (sessionResource) getDurableSession().delete(sessionId); } session = new SubscriptionsSession(sessionId, user); } if (will) { will.id = sessionId; will.user = { username: user?.username }; - LastWill.put(will); + getLastWill().put(will); } if (keepalive) { // keep alive is the interval in seconds that the client will send a ping to the server @@ -361,13 +377,13 @@ class SubscriptionsSession { transaction(context, async () => { try { if (!clientTerminated) { - const will = await LastWill.get(this.sessionId); + const will = await getLastWill().get(this.sessionId); if (will) { await publish(will, will.data, context); } } } finally { - await LastWill.delete(this.sessionId); + await getLastWill().delete(this.sessionId); } }).catch((error) => { warn(`Error publishing MQTT will for ${this.sessionId}`, error); @@ -462,7 +478,7 @@ export class DurableSubscriptionsSession extends SubscriptionsSession { } subscription.acks.push(update.timestamp); trace('Received ack', topic, update.timestamp); - DurableSession.put(this.sessionRecord, { source: true }); // add source: true context to bypass any overloaded checks, as skipping this can lead to increased load + getDurableSession().put(this.sessionRecord, { source: true }); // add source: true context to bypass any overloaded checks, as skipping this can lead to increased load return; } } @@ -475,7 +491,7 @@ export class DurableSubscriptionsSession extends SubscriptionsSession { subscription.startTime = update.timestamp; } } - DurableSession.put(this.sessionRecord, { source: true }); + getDurableSession().put(this.sessionRecord, { source: true }); // TODO: Increment the timestamp for the corresponding subscription, possibly recording any interim unacked messages } @@ -502,6 +518,6 @@ export class DurableSubscriptionsSession extends SubscriptionsSession { startTime, }; }); - return DurableSession.put(this.sessionRecord); + return getDurableSession().put(this.sessionRecord); } } diff --git a/server/serverHelpers/Request.ts b/server/serverHelpers/Request.ts index 7c746490a..aebcd5331 100644 --- a/server/serverHelpers/Request.ts +++ b/server/serverHelpers/Request.ts @@ -206,7 +206,7 @@ export class Request { return capturedHeaders.get(name); }, getHeaders() { - return Object.fromEntries(capturedHeaders); + return Object.fromEntries(capturedHeaders.entries()); }, hasHeader(name: string) { return capturedHeaders.has(name); diff --git a/test_output.txt b/test_output.txt new file mode 100644 index 000000000..e40aa19d2 --- /dev/null +++ b/test_output.txt @@ -0,0 +1,3283 @@ +> mocha 'unitTests/**/*test.*js' --exclude 'unitTests/apiTests/**/*' --exclude 'unitTests/dataLayer/harperBridge/**/*' --exclude 'unitTests/resources/**/*' +Current directory /home/kzyp/dev/ts-fixes/bin + test CLI operations + - Test describe_table returns the table + - Test describe_all when the table doesnt exist + - Test SQL query + - Test search_by_id returns a record + Test install module +Cert: Harper-Certificate-Authority issuer: CN=Harper-Certificate-Authority C=USA ST=Colorado L=Denver O=Harper-Certificate-Authority +Cert: Harper-Certificate-Authority-localhost issuer: CN=Harper-Certificate-Authority-localhost C=USA ST=Colorado L=Denver O=HarperDB\, Inc. +Cert: Unit Test issuer: CN=Unit Test CA C=USA ST=Colorado L=Denver O=Unit Test CA +Cert: Unit Test CA issuer: CN=Unit Test CA C=USA ST=Colorado L=Denver O=Unit Test CA +Cert: localhost issuer: CN=Harper-Certificate-Authority-localhost C=USA ST=Colorado L=Denver O=HarperDB\, Inc. +Cert: valid-test-cert issuer: CN=Unit Test CA C=USA ST=Colorado L=Denver O=Unit Test CA + ✔ Test error from installer is handled correctly + Test status module + ✔ Test status is returned as expected + ✔ Test status when nothing is running + Test upgrade.js + upgrade() + - Nominal case - upgrade runs to completion w/o update obj passed in as arg + - Nominal case - upgrade runs to completion w update obj passed in as arg + - Should exit process if no upgrade obj arg is passed AND getVersionUpdateInfo returns null - i.e. versions are current + - Should exit process if no upgrade obj arg is passed AND there is an issue getting the current version + - Should exit process if upgradePrompt returns false + - Should exit process with code 1 if upgradePrompt throws an exception + - Should exit process with code 1 if boot prop file does not exist - i.e. HDB has not been installed + - Should exit process with code 1 if settings file does not exist - i.e. HDB has not been installed + - Test error from runUpgrade is handled + runUpgrade() + ✔ Nominal case + ✔ Should catch and throw exception from runUpgradeDirectives + ✔ Should catch an exception from insertHdbUpgradeInfo and continue - i.e. NOT rethrow + Test printToLogAndConsole + ✔ Should log to console and final logger + Component + with singular pattern + with files as a string + ✔ should instantiate without any other options + ✔ should instantiate with urlPath option + ✔ should throw an error if the pattern contains ".." + ✔ should throw an error if the pattern starts with "/" + with files as an object + ✔ should instantiate without any other options + ✔ should instantiate with urlPath option + ✔ should instantiate with files.only option set to files + ✔ should instantiate with files.only option set to directories + ✔ should instantiate with files.ignore option set to a string + ✔ should throw an error if the pattern contains ".." + ✔ should throw an error if the pattern starts with "/" + with multiple patterns + with files as a string + ✔ should instantiate without any other options + ✔ should instantiate with urlPath option + ✔ should throw an error if any pattern contains ".." + ✔ should throw an error if any pattern starts with "/" + with files as an object + ✔ should instantiate without any other options + ✔ should instantiate with urlPath option + ✔ should instantiate with files.only option set to files + ✔ should instantiate with files.only option set to directories + ✔ should instantiate with files.ignore option set to a string + ✔ should throw an error if any pattern contains ".." + ✔ should throw an error if any pattern starts with "/" + ComponentLoader Status Integration + Basic component status tracking + ✔ should initialize loading status for non-root components + ✔ should track loading for components with trusted loaders + - should mark component as failed when it loads no functionality + Component status verification + ✔ should properly set status in registry after successful load + ✔ should handle component loading errors gracefully + ComponentV1 + with a valid directory structure + ✔ should warn about leading '/' and resolve it relative to root + ✔ should warn about leading '/' and resolve it relative to root with glob star + ✔ should prepend urlPath + ✔ should warn about deprecated 'path' option, and handle it as 'urlPath' + ✔ should resolve glob pattern `/*` correctly + ✔ should resolve glob pattern `/**/*` correctly + ✔ should handle `root` option when it matches the file pattern + ✔ should resolve all files and directories within the specified directory glob + ✔ should resolve a specific file + ✔ should resolve a specific file with `./` + ✔ should resolve a specific directory + ✔ should ignore specified files + ✔ should return early if root handleDirectory returns true + ✔ should return early if root setupDirectory returns true + with pattern '*' + ✔ should resolve correctly with configuration defaults + ✔ should resolve correctly with configuration `only: 'all'` + ✔ should resolve correctly with configuration `only: 'files'` + ✔ should resolve correctly with configuration `only: 'directories'` + ✔ should call setup methods instead of handle when in main thread + ✔ should warn about deprecated `root` option and handle it appropriately + with pattern '**/*' + ✔ should resolve correctly with configuration defaults + ✔ should resolve correctly with configuration `only: 'all'` + ✔ should resolve correctly with configuration `only: 'files'` + ✔ should resolve correctly with configuration `only: 'directories'` + options validation + ✔ should throw an error if files is not a non-empty string, array of non-empty strings, or an object + ✔ should throw an error if files.source is invalid + ✔ should throw an error if files.only is invalid + ✔ should throw an error if files.ignore is invalid + ✔ should throw an error if root is invalid + ✔ should throw an error if path is invalid + ✔ should throw an error if urlPath is invalid + ✔ should throw an error if the files option contains `..` as a string + ✔ should throw an error if the files option contains `..` as an array + ✔ should throw an error if the files.source option contains `..` as a string + ✔ should throw an error if the files.source option contains `..` as an array + deriveCommonPatternBase + ✔ should derive common pattern base from ["web/index.html","web/style.css"] + ✔ should derive common pattern base from ["web","static"] + ✔ should derive common pattern base from ["web/static/foo","web/static/bar"] + ✔ should derive common pattern base from ["a/b/c/d","a/b/c/e","a/b/f"] + ✔ should derive common pattern base from ["web"] + ✔ should derive common pattern base from ["web/index.html"] + ✔ should derive common pattern base from ["index.html","style.css"] + deriveGlobOptions + ✔ should handle files as a string + ✔ should handle files as an array of strings + ✔ should handle files as an object with source and ignore + ✔ should handle files as an object with only set to "files" + ✔ should handle files as an object with only set to "directories" + ✔ should handle files as an object with no ignore or only properties + EntryHandler + ✔ should instantiate and emit events for adding and removing files and directories (111ms) + ✔ should await ready event via `ready` property + ✔ should emit file change events + ✔ should handle updating the config (202ms) + ✔ should resolve the correct urlPath for files + ✔ should resolve the correct urlPath for files with `./` + ✔ should avoid matching within an excluded base + ✔ should correctly resolve similar url paths for directories + ✔ should correctly resolve similar url paths for files + ✔ should emit all file events before ready resolves + Global Variable Isolation in testJSWithDeps +Verifying we can access console.log in transitive module in application +Verifying we can access console.log in application + ✔ should isolate global variables when loading the component (92ms) +Verifying we can access console.log in transitive module in application +Verifying we can access console.log in application + ✔ should be able to use VM loading with current context and load component +Verifying we can access console.log in transitive module in application +Verifying we can access console.log in application + ✔ should be able to load component with package dependency containment (52ms) +Verifying we can access console.log in transitive module in application +Verifying we can access console.log in application + ✔ should be able to load component with SES compartment (170ms) +Verifying we can access console.log in transitive module in application +Verifying we can access console.log in application + ✔ should enforce process spawning restrictions +Verifying we can access console.log in transitive module in application +Verifying we can access console.log in application + ✔ should allow fork with allowed commands +Verifying we can access console.log in transitive module in application +Verifying we can access console.log in application + ✔ should reuse existing processes with same name (1012ms) +Verifying we can access console.log in transitive module in application +Verifying we can access console.log in application + ✔ should restart process when version is upgraded +Verifying we can access console.log in transitive module in application +Verifying we can access console.log in application + ✔ should handle ESM circular dependencies correctly + ✔ should handle CJS circular dependencies correctly + ✔ should load packages that depend on harper through VM + ✔ should load packages without harper dependency natively +Verifying we can access console.log in transitive module in application +Verifying we can access console.log in application + ✔ should handle CJS modules from node_modules correctly + OptionsWatcher + ✔ should instantiate with a file path and emit a ready event + ✔ should instantiate and emit ready even if the file does not exist + ✔ should await ready event via `ready()` method + ✔ should correctly return the initial configuration + ✔ should continue to watch if file is removed and recreated (109ms) + ✔ should emit a remove event if the respective name is deleted + ✔ should handle default config resolution (106ms) + change event from modifying underlying config file + ✔ should handle updating an array to an object and vice versa + with top-level primitive (string, number, boolean, null) and array values + ✔ should handle updating + ✔ should handle creating + ✔ should handle deleting + with nested primitives (string, number, boolean, null) and array values + ✔ should handle updating + ✔ should handle creating + ✔ should handle deleting + with top-level object values + ✔ should handle updating + ✔ should handle creating + ✔ should handle deleting + with nested object values + ✔ should handle updating + ✔ should handle creating + ✔ should handle deleting + change event when root config value is a scalar + ✔ should handle updating from scalar to scalar without throwing + ✔ should handle updating from scalar to object without throwing + ✔ should handle updating from object to scalar without throwing + requestRestart + ✔ should update the shared buffer + resolveBaseURLPath + ✔ should resolve to / when no path, or an empty path is provided + ✔ should resolve to `//` when a path is provided without a leading `.` character + ✔ should resolve `.` to `` + ✔ should error when path starts with `..` + Scope + ✔ should create a default entry handler (103ms) + ✔ should create a default entry handler with urlPath (104ms) + ✔ should call requestRestart if no entry handler is provided + ✔ should call requestRestart if no options handler is provided (102ms) + ✔ should emit error for missing default entry handler + ✔ should support custom entry handlers + ✔ should support synchronous handleEntry with event-based initial load tracking + Component Status Public API + statusForComponent() API + ✔ should provide fluent interface for status reporting + ✔ should report healthy status + ✔ should report healthy status without message + ✔ should report warning status + ✔ should report error status with Error object + ✔ should report loading status + ✔ should report loading status with default message + ✔ should report unknown status + ✔ should reuse builder instances + ✔ should return undefined for non-existent component + lifecycle API + ✔ should handle component loading lifecycle + ✔ should handle component failure + reset API + ✔ should clear all component statuses + STATUS constants + ✔ should expose status level constants + ComponentStatus + constructor + ✔ should create a ComponentStatus with all parameters + ✔ should create a ComponentStatus without optional parameters + ✔ should accept string as error + updateStatus + ✔ should update status and message + ✔ should clear error when status is not ERROR + ✔ should keep error when status remains ERROR + ✔ should update without message + markHealthy + ✔ should set status to healthy with custom message + ✔ should set status to healthy with default message + ✔ should clear error when marking healthy + markError + ✔ should set status to error with Error object + ✔ should set status to error with string error + ✔ should use error message when no custom message provided + markWarning + ✔ should set status to warning with message + ✔ should clear error when marking warning + markLoading + ✔ should set status to loading with custom message + ✔ should set status to loading with default message + status check methods + ✔ should correctly identify healthy status + ✔ should correctly identify error status + ✔ should correctly identify loading status + ✔ should correctly identify warning status + getSummary + ✔ should return summary with message + ✔ should return summary without message + ✔ should handle all status levels + status transitions + ✔ should transition through multiple states correctly + ComponentStatusRegistry + reset + ✔ should clear all statuses + setStatus + ✔ should set component status with all parameters + ✔ should set component status without optional parameters + ✔ should overwrite existing status + ✔ should throw error for invalid component name + ✔ should throw error for invalid status level + getStatus + ✔ should return undefined for non-existent component + ✔ should return ComponentStatus instance + getAllStatuses + ✔ should return empty map initially + ✔ should return all registered statuses + reportHealthy + ✔ should set status to healthy with message + ✔ should set status to healthy without message + reportError + ✔ should set status to error with Error object + ✔ should set status to error with string error + reportWarning + ✔ should set status to warning with message + lifecycle management methods + initializeLoading + ✔ should set status to loading with custom message + ✔ should set status to loading with default message + markLoaded + ✔ should set status to healthy with custom message + ✔ should set status to healthy with default message + markFailed + ✔ should set status to error with all parameters + ✔ should set status to error with string error + getComponentsByStatus + ✔ should return components with specific status + ✔ should return empty array for status with no components + ✔ should return correct component objects + getStatusSummary + ✔ should return initial summary with zero counts + ✔ should count components by status + aggregation functionality (via getAggregatedFromAllThreads) + ✔ should aggregate single component from multiple threads + ✔ should detect abnormalities when statuses differ + ✔ should prioritize non-healthy messages + ✔ should handle status priority correctly + ✔ should handle worker index in status data + ✔ should handle main thread correctly + static getAggregatedFromAllThreads method + ✔ should collect and aggregate statuses + getAggregatedStatusFor method + basic aggregation scenarios + ✔ should return status for exact component match only + ✔ should return aggregated status for sub-components only + ✔ should combine exact match with sub-components + ✔ should return unknown status when component not found + status priority and aggregation logic + ✔ should prioritize error over other statuses + ✔ should prioritize loading over healthy statuses + ✔ should return healthy when all components healthy + ✔ should handle mixed status scenarios correctly + details and message generation + ✔ should include details when components have issues + ✔ should not include details when all components healthy + ✔ should generate descriptive messages for problem components + ✔ should format component keys correctly in messages + edge cases and error handling + ✔ should handle empty consolidated statuses gracefully + ✔ should handle null/undefined consolidated statuses + ✔ should work with pre-provided consolidated statuses + ✔ should fetch consolidated statuses when not provided + ✔ should handle missing latestMessage gracefully + CrossThread Module + CrossThreadStatusCollector + ✔ should collect status from local thread only when no responses (1002ms) + ✔ should collect status from multiple threads (101ms) + ✔ should handle ITC send failure + ✔ should handle collection timeout (51ms) + ✔ should complete early when all threads respond (50ms) + ✔ should reuse listener across multiple collections (2001ms) + ✔ should properly clean up resources + StatusAggregator + ✔ should aggregate single component from single thread + ✔ should detect abnormalities when statuses differ + ✔ should prioritize non-healthy messages + ✔ should handle status priority correctly + ✔ should handle main thread correctly + ✔ should handle worker index in status data + Component Status Errors + ComponentStatusError + ✔ should create base error with default status code + ✔ should create base error with custom status code + CrossThreadTimeoutError + ✔ should create timeout error with details + ITCError + ✔ should create ITC error without cause + ✔ should create ITC error with cause + AggregationError + ✔ should create aggregation error + ComponentStatusOperationError + ✔ should create operation error + CrossThreadCollectionError + ✔ should create collection error for partial success + ✔ should create collection error for complete failure + ✔ should provide detailed diagnostics + Component Status API + statusForComponent + ✔ should return a ComponentStatusBuilder instance + ✔ should return the same instance for the same component name + ✔ should return different instances for different component names + ComponentStatusAPI methods + warning + ✔ should set component status to warning + error + ✔ should set component status to error with message only + ✔ should set component status to error with message and Error object + healthy + ✔ should set component status to healthy with message + ✔ should set component status to healthy without message + loading + ✔ should set component status to loading with message + ✔ should set component status to loading without message + unknown + ✔ should set component status to unknown with message + ✔ should set component status to unknown without message + get + ✔ should return undefined for non-existent component + ✔ should return the current status of the component + ✔ should reflect status changes + Integration with componentStatusRegistry + ✔ should properly integrate with the global registry + ✔ should work with registry methods + Multiple component workflow + ✔ should handle multiple components independently + Status transition scenarios + ✔ should handle component lifecycle transitions + componentStatusRegistry singleton + ✔ should export a ComponentStatusRegistry instance + ✔ should be a singleton instance + ✔ should have all ComponentStatusRegistry methods + ✔ should work with basic operations + configHelpers + getBackupDirPath + ✔ should return path to backup directory + ✔ should handle paths with trailing slash + ✔ should handle relative paths + ✔ should use BACKUP_DIR_NAME constant from hdbTerms + configUtils - applyRuntimeEnvVarConfig + ✔ should skip when no env vars set + ✔ should apply HARPER_DEFAULT_CONFIG when set + ✔ should apply HARPER_SET_CONFIG when set + ✔ should apply both env vars when both set + ✔ should warn and skip when rootPath not found + ✔ should write config file after applying env vars + ✔ should throw error if config doc has errors + ✔ should log error and rethrow on file write failure + ✔ should skip file write when configFilePath is not provided + ✔ should pass options parameter to applyRuntimeEnvConfig + error handling in YAML processing + ✔ should log error and rethrow when applyRuntimeEnvConfig throws (most likely scenario) + ✔ should log error and rethrow when YAML.stringify() fails + ✔ should log error and rethrow when YAML.parseDocument() fails + Test configUtils module + Test atomicWriteFile function + ✔ writes content to the target path + ✔ overwrites an existing file + ✔ writes via temp file then rename so target is never truncated mid-write + ✔ leaves no temp file behind after a successful write + ✔ generates a unique temp path even when pid and timestamp are identical + Test getDefaultConfig function + ✔ Test that if the in-memory object exists, the correct default value is returned + Test getConfigValue function + ✔ Test if param is defined in instantiated default config, returns in-memory value + ✔ Test if param isnt defined in instantiated default config, returns undefined + ✔ Test if in-memory obj doesnt exist, returns undefined + Test initConfig function + ✔ Test in-memory obj undefined, function reads config doc and adds values to object + ✔ Test parameter "force" is true, function reads config doc and adds values to object + ✔ Test in-memory obj undefined, config file path undefined and error is caught + Test validateConfig function +[main/0] [info]: Detected 20 cores and 32768MB on this machine, defaulting threads.count to 19 + ✔ Test error message is thrown if there is a validation error + ✔ Test necessary parameters are setIn by validator + Test updateConfigObject function + ✔ Test happy path in-memory obj is updated + ✔ Test logger trace message if param doesnt exist + Test updateConfigValue function + ✔ Test happy path where backup and update_config_obj are true + ✔ Test happy path with parsed_args and where backup and update_config_obj are false + ✔ Test that if there is no in-memory obj, initConfig is hit PLUS it handles error with bad param + ✔ Test config not updated if values are the same + ✔ Test string env values matching typed config values are detected as equal + ✔ Test string env value differing from typed config value triggers update + Test castConfigValue function + ✔ Test number value returns number + ✔ Test if value is boolean, boolean is returned + ✔ Test if value is true/false string, boolean is returned + ✔ Test if value is undefined or undefined as string, null is returned + ✔ Test if value is an object, string, or array, the same data type is returned + Test getConfiguration function + ✔ Test a config object is returned + Test setConfiguration function + ✔ Test happy path success response returned + ✔ Test error handled if updateConfigValue throws error + Test readConfigFile function + ✔ Test happy path, function returns json config object + ✔ Test that function handles error if boot props file doesnt exist + Test initOldConfig function + ✔ Test updates in-memory config object + Test setSchemasConfig function + ✔ Test all schemas config is added to config doc + Test port conflict resolution with environment variables + ✔ should allow explicitly setting port to null when HARPER_SET_CONFIG sets securePort to same value + ✔ should allow explicitly setting port to null when HARPER_SET_CONFIG sets securePort for http + ✔ should auto-null operationsApi port when HARPER_SET_CONFIG sets securePort to same value + ✔ should auto-null http port when HARPER_SET_CONFIG sets securePort to same value + ✔ should auto-null operationsApi port when HARPER_DEFAULT_CONFIG sets securePort to same value + ✔ should auto-null http port when HARPER_DEFAULT_CONFIG sets securePort to same value + ✔ should allow explicitly setting port to null with HARPER_DEFAULT_CONFIG + composeConfigFromEnv + ✔ returns an empty object when no env vars and no base are provided + ✔ returns a clone of base when no env vars are set + ✔ does not mutate the base when env vars override values + ✔ layers HARPER_DEFAULT_CONFIG below the base (base wins on conflict, defaults fill gaps) + ✔ applies HARPER_SET_CONFIG on top of everything + ✔ reads values set by HARPER_SET_CONFIG under a nested path + ✔ treats an empty-string env var as unset + ✔ throws when env var contains invalid JSON + HARPER_DEFAULT_CONFIG - true defaults behavior + ✔ should NOT override existing config values at runtime (config file priority) + ✔ should SET values that do not exist in config + ✔ should UPDATE values it previously set (on subsequent runs) + ✔ should NOT override value if user edited it after HARPER_DEFAULT_CONFIG set it + ✔ should UPDATE value set during install when env var changes at runtime + ✔ should restore original value when key removed from HARPER_DEFAULT_CONFIG + ✔ should DELETE new keys when removed from HARPER_DEFAULT_CONFIG (no original value) + ✔ should handle complex deletions with mix of restored and deleted keys + ✔ should handle deeply nested config changes + ✔ should track originalValues correctly across multiple changes + harperConfigEnvVars - Edge Cases + deleteNestedValue + ✔ should handle deleting from non-existent path gracefully + ✔ should handle deleting when intermediate path is not an object + loadConfigState + ✔ should handle corrupted state file gracefully + ✔ should handle state file without originalValues (backwards compatibility) + detectConfigDrift + ✔ should detect when user manually changes a value + ✔ should not detect drift for values set by HARPER_SET_CONFIG + removeValuesWithSource + ✔ should remove all values from a specific source + cleanupRemovedEnvVar + ✔ should handle cleanup when env var was never set + storeOriginals edge cases + ✔ should not store original when value is null + ✔ should not store original when value is undefined + early return cases + ✔ should return early when no env vars are set + drift detection at install vs runtime + ✔ should not detect drift during install + filterArgsAgainstRuntimeConfig + Basic filtering + ✔ should return args unchanged when HARPER_SET_CONFIG is not set + ✔ should filter out args that are in HARPER_SET_CONFIG + ✔ should handle nested config objects + ✔ should be case-insensitive + Docker Compose scenario + ✔ should filter Dockerfile ENV vars when HARPER_SET_CONFIG overrides them + Edge cases + ✔ should handle empty HARPER_SET_CONFIG + ✔ should handle invalid JSON in HARPER_SET_CONFIG + ✔ should handle null values in HARPER_SET_CONFIG + ✔ should handle arrays in HARPER_SET_CONFIG + Does NOT filter HARPER_DEFAULT_CONFIG + ✔ should NOT filter args that are only in HARPER_DEFAULT_CONFIG + HARPER_SET_CONFIG + Install-time behavior + ✔ should apply HARPER_SET_CONFIG during install + ✔ should override HARPER_DEFAULT_CONFIG values during install + ✔ should track HARPER_SET_CONFIG in state file + Runtime behavior + ✔ should apply HARPER_SET_CONFIG at runtime + ✔ should override HARPER_DEFAULT_CONFIG at runtime + ✔ should override user edits (force override) + ✔ should delete NEW values when key removed from HARPER_SET_CONFIG + ✔ should RESTORE original values when key removed from HARPER_SET_CONFIG + ✔ should RESTORE original value when key removed from HARPER_SET_CONFIG via changed env var + ✔ should update values when HARPER_SET_CONFIG changes + Precedence + ✔ should follow precedence: SET_CONFIG > user > DEFAULT_CONFIG > file + harperConfigEnvVars + hashConfig + ✔ produces different hashes for different configs + ✔ produces same hash for same config with different key order + ✔ produces different hashes for nested config differences + ✔ handles arrays correctly in hash + ✔ produces same hash for deeply nested configs with different key order + parseConfigEnvVar + ✔ parses valid JSON + ✔ returns null for empty string + ✔ returns null for undefined + ✔ returns null for null + ✔ trims whitespace + ✔ throws ConfigEnvVarError for invalid JSON + ✔ throws ConfigEnvVarError for non-object JSON (array) + ✔ throws ConfigEnvVarError for non-object JSON (string) + ✔ throws ConfigEnvVarError for non-object JSON (number) + ✔ includes env var name in error + ✔ includes original error in ConfigEnvVarError + ✔ parses complex nested JSON + ConfigEnvVarError + ✔ has correct properties + ✔ works without originalError + ✔ is instanceof Error + RootConfigWatcher + ✔ should instantiate and watch the root Harper config file + ✔ should detect changes written via temp-file + rename (atomic write) + Test bulkLoad.js + Test csvDataLoad + - Test csvDataLoad nominal case with valid file and valid column names/data + - Test csvDataLoad with non-SU role evaluates attr-level perms + - Test csvDataLoad with attr-level perms issues - returns errors + - Test csvDataLoad invalid column names, expect exception + - Test csvDataLoad missing data, expect exception + - Test csvDataLoad bad csv data, expect nothing loaded message + - Test csvDataLoad incomplete csv data, expect nothing loaded message + Test csvURLLoad function + - Test bad URL throws validation error + - Test for nominal behaviour and success message is returned + Test downloadCSVFile function + - Test error is handled from request promise module + - Test for nominal behaviour, stubs are called as expected + - Test that error from mkdirSync is handled correctly + Test validateURLResponse function + - Test that bad error code is handled + - Test non-supported content type is handled + - Test empty response body is handled + Test csvFileLoad function + - Test validation throws error + - Test success message is returned + - Test exception from papaparse is caught and logged + Test importFromS3 function + - NOMINAL - Should call through and return results + - NOMINAL - Should add `file_type` and `file_path` variables to the json message - csv + - NOMINAL - Should add `file_type` and `file_path` variables to the json message - json + - Should use buildTopLevelErrMsg to handle any error thrown + Test fileLoad function + - Should call papaParse if file is CSV + - Should call insertJson if file is JSON + - Should throw an error if file_type is not supported + Test validateChunk function + - Test validation function returns if no data + - Test verifyBulkLoadAttributePerms method is called when user is non-SU + - Test parser is paused/resumed and validation called + - Test error is logged and reject promise returned + Test insertChunk function + - Test validation function returns if no data + - Test parser is paused/resumed and callBulkLoad is called + - Test error is logged and reject promise returned + Test callPapaParse function + - Test readstream and papaparse are called and insert results are returned + - Test that error is logged and thrown + Test insertJson function + - NOMINAL - Should call through and return results + - ERROR - Should return a HDB error if the readStream emits an error + Test bulkFileLoad function + - Test action defaults to insert and correct results are returned + - Test update is called and returned result is correct + - Test error is thrown if invalid action is passed + - Test insert error caught and thrown + Tests for delete.js + Test deleteFilesBeforeFunction + ✔ Test that validation error returned + ✔ Test that Invalid date format error returned +[main/0] [info]: Finished deleting files before 2018-06-14 + ✔ Test for nominal behaviour, bridge stubbed called and info logged + ✔ Test no schema error is returned + test deleteAuditLogsBefore function + ✔ Test that validation error returned + ✔ Test that date string is invalid + ✔ Test that epoch value is valid +[main/0] [info]: Finished deleting audit logs before 1778624822919 + ✔ Test ok with stub + Test deleteRecords function + ✔ Test that validation error is thrown from bad delete object + ✔ Test for nominal behaviour, success msg is returned + ✔ Test that error from bridge is caught and thrown + ✔ Test that error from schema/table check is handled + Test export.js + Test export_local + ✔ Nominal Call to export_local with csv file + ✔ Nominal Call to export_local with json file + ✔ Call to export_local with bad path + ✔ Call to export_local with search exception thrown + ✔ Test validation error is handled correctly + Test confirmPath + ✔ Nominal case of confirmPath + ✔ call confirmPath with bad path + ✔ call confirmPath with non directory path + ✔ call confirmPath with undefined path + ✔ Test access denied error is handled correctly + ✔ Test access error message is handled + Test saveToLocal + ✔ Nominal case of saveToLocal with json + ✔ Nominal case of saveToLocal with csv + ✔ Test error is thrown if file_path invalid + ✔ Test error is thrown if source format invalid + ✔ Test error is thrown if data not found + ✔ Test error is thrown if format invalid + ✔ Call saveToLocal with empty data, this is valid + Test export_to_s3 + ✔ Nominal call export CSV to S3 + ✔ Nominal call export JSON to S3 + ✔ Test missing S3 object error thrown + ✔ Test missing aws_access_key_id error thrown + ✔ Test missing aws_secret_access_key error thrown + ✔ Test missing bucket error thrown + ✔ Test missing key error thrown + ✔ Test bad format error thrown + ✔ Test error from getRecords is handled correctly + Test exportCoreValidation function + ✔ Test format missing message is returned + ✔ Test invalid format message is returned + ✔ Test search operation missing message is returned + ✔ Test search operation value wrong message returned + Test getRecords function + ✔ Test search by value operation is selected + ✔ Test search by hash operation is selected + ✔ Test search by SQL operation is selected + ✔ Test invalid search operation error thrown + ✔ Test search operation not supported error thrown + Test hdbInfoController module + Test insertHdbInstallInfo() + - test insert install info - nominal case + - test insert install info - throws exception + Test insertHdbUpgradeInfo() + - test insert nominal case + - test insert - search throws exception + - test insert - search returns no errors, still expect to run + - test insert - insert throws exception + Test getAllHdbInfoRecords() + - Should return the results from the hdb_info table search - nominal case + - Should log error if thrown from search function and return [] + Test getLatestHdbInfoRecord() + - It should return the most recent info record + - It should return undefined if search returns no records + Test getVersionUpdateInfo() + - getVersionUpdateInfo nominal test + - getVersionUpdateInfo - no result returned if versions are the same + - getVersionUpdateInfo - pre-upgrade version newer than upgrade version, but only minor difference + - getVersionUpdateInfo nominal test, upgrade that does not require a directive + - getVersionUpdateInfo - error thrown if downgrading major version + - getVersionUpdateInfo - error thrown if version is too old + - test getVersionUpdateInfo - version does not exist + Test checkIfInstallIsSupported() + - Test it throws error message if hdb_info table doesnt exist + - Test it throws error message if data version is too old + Test insert module + Test upsert method + ✔ NOMINAL - should return upsert response with upserted_hashes value + ✔ Should return HdbError if operation is not upsert + ✔ Should return HdbError if there is a schema validation error + ✔ Should return HdbError if insertValidator returns error + Test returnObject method + ✔ Test for INSERT + ✔ Test for UPDATE + ✔ Test for UPSERT + Test insertData method + ✔ NOMINAL - should return insert response with inserted_hashes value + ✔ Should return HdbError if operation is not insert + ✔ Should return HdbError if insertValidator returns error + ✔ Should return HdbError if schema table does not exist + Test updateData method + ✔ NOMINAL - should return update response with updated_hashes value with existing rows + ✔ NOMINAL - should return update response with updated_hashes value with out existing rows + ✔ Should return HdbError if operation is not update + ✔ Should return HdbError if insertValidator returns error + ✔ Should return HdbError if schema table does not exist + test readAuditLog module + - test no schema + - test no table + - test invalid search type + - test happy path + - Test table validation error returned + - Test auditLog not set in config err + Test schema module + Create schema + - should return valid stub from createSchemaStructure + - should catch thrown error from createSchemaStructure + Create schema structure + - should throw schema already exists error + - should call bridge and return success message + Create table + - should return valid stub from createTableStructure + - should catch thrown error from createTableStructure + Create table structure + - should catch thrown error from validation.create_table_object + - should throw table already exists error message + - should check that table has been inserted with clustering on + - should throw clustering not enabled error + - should call all stubs and return success message + - should call createTable without setting table.residence + - should catch and throw validation error + Drop Schema + - Test that bridge stub is called as expected and success msg is returned + - Test schema does not exist error is thrown + - Test error from bridge drop schema is caught, thrown and logged + - Test schema obj validation catches and throws error + Drop table + - Test that validation error is caught and thrown + - Test stubs are called as expected and success message is returned + - Test that an error from bridge method drop table is caught and logged + - Test table not found error thrown + Drop attribute + - should throw a validation error + - should throw cannot drop a hash attribute error + - should call all functions and return a success message + - Test error is thrown when trying to drop updated time + - Test table not found error thrown + Test dropAttributeFromGlobal function + - Test that attribute is removed from global schema + Create attribute + - should return attribute structure with clustering off + Test describeAll + - describeAll, test nominal case + - describeAll, test search exception + - describeAll, test descTable exception + Test describeSchema + - describeSchema, test nominal case + - describeSchema, test no schema error + - describeSchema, test search exception + - describeSchema, test descTable exception + - describeSchema, validation failure + Test describeTable + - describeTable, test nominal case + - describeTable, test validation failure + Test SQL Update/Insert/Delete + SQL UPDATE + - should update entries via SQL UPDATE + - should increment postcode twice concurrently via SQL UPDATE with correct isolation/serialization + - SQL DELETE + - SQL DELETE concurrently + - SQL INSERT + - SQL INSERT concurrently + Test SQL Engine + constructor() + ✔ should call four class methods when instantiated + ✔ should throw an exception if no statement argument is provided + search() + ✔ test function call with alias in select with no from + ✔ test function call with no alias in select with no from + ✔ test select with function that has single quotes with no alias + ✔ test select with function that has single quotes with alias + ✔ should return all rows when there is no WHERE clause + ✔ should return matching row based on WHERE clause + ✔ test a query where the same column has the table name in front and then not, to make sure the sql generates correctly + ✔ test a query where the same column has the table name in front and then not, to make sure the sql generates correctly #2 + ✔ should return matching rows based on WHERE clause + ✔ should return [] if no rows meet WHERE clause + ✔ should return the result of a operation with only a calculation + search() - testing variety of SQL statements + ✔ Basic select by hash returns requested attribute values for hash + ✔ Basic select by hash with wildcard returns requested attribute values for matching hashes + ✔ Basic select by value returns requested attributes for matching rows + ✔ Basic select by value with wildcard returns requested attributes for matching rows + ✔ should sort employees by hash in asc order + ✔ should return results when reserved words are used for schema.table AND are backticked + ✔ should return dot & double dot attribute values + ✔ should return orders sorted by orderid in desc order (61ms) + ✔ should return orders ordered by attribute not included in select statement + ✔ should return orders ordered by attribute not included in select statement - without table alias + ✔ should return orders ordered by attribute with inconsistent table alias + ✔ should return all orders data ordered by attribute with inconsistent table alias + ✔ should return count of records with attr value equal to null (44ms) + ✔ should return count of records with attr value NOT equal to null + ✔ should return complex join sorted by summed attribute value and joined company name in desc order (184ms) + ✔ should return requested attributes from 5 table join statement for specified companyname (76ms) + ✔ should count customers and group by country attribute + ✔ should return the top 10 products by unitprice based on limit and order by + - should return the top 10 products by ROUND(unitprice) based on limit and order by + ✔ should return count min max avg sum price of products + ✔ should return rounded unit price and group by calculated value + ✔ should return results based on wildcard and min value parameters + ✔ should return longtext values based on regex + _checkEmptySQL() + ✔ should return empty array if attributes and columns are set in class instance + ✔ should return the result of a sql operation if sql is only calculation + _getColumns() + ✔ should collect column data from the statement and set it to column property on class + ✔ should collect column data from statement columns, joins, and order by and set to columns property + ✔ should search for ORDER BY element and replace the column alias with the expression from SELECT + ✔ test not needing table alias on attributes that are uniquely named between tables + _getTables() + ✔ test multiple attributes from ONE table sets one table in this.data and gets hash_name from global.schema + ✔ test multiple attributes from multiple table sets multiple tables in this.data and gets hash_name from global.schema + _conditionsToFetchAttributeValues() + ✔ should NOT set exact_search_values property when there is no WHERE clause + ✔ should set exact_search_values property with data from WHERE clause + ✔ should perform same as test above but with a test hash value of zero + ✔ should set multiple values to exact_search_values property with data from WHERE IN clause + ✔ should set comparator_search_values property with < comparator logic from WHERE clause + ✔ should set comparator_search_values property with <= comparator logic from WHERE clause + ✔ should set comparator_search_values property with > comparator logic from WHERE clause + ✔ should set comparator_search_values property with >= comparator logic from WHERE clause + ✔ should not set comparator_search_values if the expression.left is null + ✔ should not set comparator_search_values if the expression.right is null + ✔ should set multiple comparator_search_values if the WHERE clause has multiple different attr conditions + ✔ should set multiple comparator_search_values.comparators values if the WHERE clause has multiple same attr conditions + _backtickAllSchemaItems() + ✔ should add backticks to all schema elements in statement property + _findColumn() + ✔ should return full column data for requested column + ✔ should return column data for alias + ✔ should NOT return data for column that does not exist + _addFetchColumns() + ✔ should add columns from JOIN clause to fetch_attributes property + ✔ should add columns from ORDER BY clause to fetch_attributes property + ✔ should add columns from WHERE clause to fetch_attributes property + ✔ should NOT add columns to fetch_attributes property if not found + _getFetchAttributeValues() + ✔ should call simpleSQLQuery and return results for simple SELECT statement + ✔ should set values to the data[table].__mergedData property for specified hash attributes from WHERE clause + ✔ should set values to the data[table].__mergedData property for specified attribute value and associated hash key/value pairs from WHERE clause + ✔ should set values to the data[table].__mergedData property for specified attributes from JOIN clause + ✔ should set values to the data[table].__mergedData property for specified hash from ORDER BY clause + ✔ should set values to the data[table].__mergedData property for specified attribute value from ORDER BY clause + ✔ should set row attr values that do not come back as null in final row data in to the data[table].__mergedData property + _getFinalAttributeData() + ✔ should return/skip if row_count equals 0 + ✔ should consolidate unique columns/attributes and pass them to _getData() + _getData() + ✔ should set data.merged_data property with hash attributes values + ✔ should set data.merged_data property with hash attributes values for multiple tables + ✔ should set longtext/blob values in the data.__mergedData property + _processJoins() + ✔ should remove rows from `__mergedData` that do not meet WHERE clause + ✔ should update merged_data for each table based on overlap of JOIN clause + ✔ should update __mergedData for longtext blobs based on WHERE statement + _finalSQL() + ✔ should return final sql results sorted by id in DESC order + _buildSQL() + - should parse columns to remove extra alias in UPPER function clause + ✔ should return initial statement string if there are not column functions clauses + Test update module + Tests update function + ✔ Tests update function with simple where query + ✔ Tests update function WITHOUT where query + ✔ Tests update function with where query, but value does not exist + ✔ Tests update function updating multiple columns with multiple wheres. + ✔ Tests update function with != where query + ✔ Tests update function with null where query + ✔ Tests update function throws error + Test createUpdateRecord function + ✔ NOMINAL - should assign value from column expression to record's columnid + ✔ Tests that an error is thrown + ✔ Tests alasql compile called if value not in column expression + Test updateRecords function + ✔ NOMINAL - should return update response + Test installer module + - Test checkForPromptOverride gets prompts and config vars + - Test checkForExistingInstall + - Test termsAgreement doesnt prompt if override value passed + - Test termsAgreement logs and exits if answer not yes + - Test createBootPropertiesFile calls all the things to make file then sets env props + - Test createConfigFile assigns all the args and calls createConfig then init + - Test createConfigFile calls rollback if create config throws error + - Test rollbackInstall calls remove and process exit + - Test createAdminUser calls addRole then addUser + - Test installPrompts passes correct schema and override works + - Test createSuperUser calls create admin user with correct params + - Test createClusterUser calls create admin user with correct params + - Test insertHdbVersionInfo calls insert with correct param + - Test displayCmdEnvVar function logs generic password message and not password + - Test displayCmdEnvVar function logs prompt message and value + - Test checkForEmptyValue returns message if value empty + - Test checkForEmptyValue returns undefined if value not empty + Test install function + - Test that all functions needed for install are called + HARPER_DEFAULT_CONFIG integration + - applies HARPER_DEFAULT_CONFIG during config file creation + - merges HARPER_DEFAULT_CONFIG with OOTB defaults + - replaces arrays from HARPER_DEFAULT_CONFIG + - throws error on invalid JSON in HARPER_DEFAULT_CONFIG + - works without HARPER_DEFAULT_CONFIG set + Test password module + Hashing SHA256 + ✔ should generate a valid hash + ✔ should fail validation for incorrect password + test MD5 + ✔ should generate a valid MD5 hash + ✔ test that legacy hashes are validated correctly using current validator + Test Asynchronous Hashing (Argon2id) + ✔ should generate a valid async hash (112ms) + ✔ should fail async validation for incorrect password (129ms) + Empty Hash Validation + ✔ should fail sync validation for empty hash + ✔ should fail async validation for empty hash + Test authorize function + ✔ Cannot complete request Basic authorization: User not found + ✔ Cannot complete request Basic authorization: User is inactive + ✔ Cannot complete request Basic authorization: Invalid password + ✔ Can authorize with correct username and password Basic authorization + ✔ Cannot complete request Other authorization: User not found + ✔ Cannot complete request Other authorization: User is inactive + ✔ Cannot complete request Other authorization: Invalid password + ✔ Can authorize with correct username and password Other authorization + test authorize function for JWT + ✔ test hdb_admin operation token + ✔ test old_user operation token + ✔ test non-existent user operation token + ✔ test bad operation token + ✔ test expired operation token + ✔ test hdb_admin refresh token + ✔ test old_user refresh token + ✔ test non-existent refresh user + ✔ test bad refresh token + ✔ test expired refresh token + Test checkPermissions function + ✔ validate permission object, should get error when object is incomplete + ✔ no permission role in object should error + ✔ super_user permission can authorized + ✔ Not authorized to access schema when no schema name + ✔ Not authorized to access table when no table name + ✔ Not authorized to insert table when tables no attribute + ✔ Not authorized insert to table, missing restrict attribute + ✔ Not authorized insert restrict attribute name and id are false to table + ✔ Not authorized insert restrict attribute name is ture and id is false to table + ✔ can authorized with have restrict attribute true + ✔ can authorized with not have restrict attribute + auth.ts - certificate verification integration + mTLS certificate verification in authentication middleware + ✔ should skip certificate verification when mTLS is not configured + ✔ should skip certificate verification when not authorized by TLS +[main/0] [info] [auth-event] [authentication]: AuthAuditLog { + username: 'test-client', + status: 'success', + type: 'authentication', + originating_ip: '192.168.1.100', + request_method: 'GET', + path: '/test', + auth_strategy: 'mTLS' +} + ✔ should verify certificate when mTLS is configured and authorized + ✔ should reject request when certificate is revoked + ✔ should reject request when certificate verification fails +[main/0] [info] [auth-event] [authentication]: AuthAuditLog { + username: 'custom-username', + status: 'success', + type: 'authentication', + originating_ip: '192.168.1.100', + request_method: 'GET', + path: '/test', + auth_strategy: 'mTLS' +} + ✔ should handle mTLS with custom user field + ✔ should handle mTLS with null user (no user mapping) +[main/0] [info] [auth-event] [authentication]: AuthAuditLog { + username: 'common-name-client', + status: 'success', + type: 'authentication', + originating_ip: '192.168.1.100', + request_method: 'GET', + path: '/test', + auth_strategy: 'mTLS' +} + ✔ should use Common Name when user is set to CN +[main/0] [info] [auth-event] [authentication]: AuthAuditLog { + username: 'test-client', + status: 'success', + type: 'authentication', + originating_ip: '192.168.1.100', + request_method: 'GET', + path: '/test', + auth_strategy: 'mTLS' +} + ✔ should handle certificate verification with different statuses +[main/0] [info] [auth-event] [authentication]: AuthAuditLog { + username: 'test-client', + status: 'success', + type: 'authentication', + originating_ip: '192.168.1.100', + request_method: 'GET', + path: '/test', + auth_strategy: 'mTLS' +} + ✔ should pass mtlsConfig to verifyCertificate for configuration + authentication error logging + - should log certificate verification failures + certificateVerification/certificateVerificationSource.ts + class exports + ✔ should export CertificateVerificationSource class + ✔ should extend Resource class + get() method - CRL verification + ✔ should handle CRL cache key and return result structure + ✔ should calculate expiresAt based on cacheTtl + get() method - OCSP verification + ✔ should detect OCSP method from cache key prefix + get() method - error handling + ✔ should return null when no requestContext available + ✔ should return null when certPem is missing + ✔ should return null when issuerPem is missing + ✔ should throw for unsupported verification method + ✔ should throw for cache key with no prefix + get() method - result consistency + ✔ should include checked_at timestamp + ✔ should preserve certificate_id in result + ✔ should include all required fields in result + method detection + ✔ should detect CRL method from cache key prefix + ✔ should identify OCSP vs CRL by prefix + ✔ should detect unknown method for invalid prefix + certificateVerification/crlVerification.ts + module exports + ✔ should export verifyCRL function + ✔ should export performCRLCheck function + verifyCRL() main API + ✔ should handle disabled CRL verification + ✔ should return result structure with valid field + ✔ should handle no CRL distribution points gracefully + ✔ should use provided CRL URLs instead of extracting + ✔ should convert Buffer to PEM format for processing + ✔ should handle config with all optional fields + ✔ should handle minimal config with defaults + ✔ should return cached field in result + CRL signature verification + ✔ should reject invalid CRL signatures in fail-closed mode + ✔ should reject invalid CRL signatures in fail-open mode + performCRLCheck() core logic + no CRL distribution points + ✔ should return good status when no distribution points extracted + ✔ should use provided CRL URLs instead of extracting from cert (76ms) + utility function extraction + ✔ should extract serial number and issuer key for composite ID (66ms) + ✔ should throw when extraction functions fail + certificateVerification/index.ts + module exports + ✔ should export verifyCertificate function + verifyCertificate() orchestration + disabled configuration + ✔ should return disabled status when config is false + ✔ should return disabled status when mtlsConfig is null + insufficient certificate chain + ✔ should return no-issuer-cert when chain length < 2 + ✔ should return no-issuer-cert when first cert has no issuer + CRL verification path + ✔ should attempt CRL verification when CRL URLs present and enabled + ✔ should return immediately on CRL revoked result + ✔ should fall back to OCSP when CRL returns unknown + ✔ should skip CRL when disabled in config + ✔ should skip CRL when no distribution points + ✔ should handle CRL verification errors gracefully + OCSP verification path + ✔ should attempt OCSP verification when OCSP URLs present and enabled + ✔ should skip OCSP when disabled in config + ✔ should skip OCSP when no responder URLs + ✔ should handle OCSP verification errors gracefully + failure mode handling + ✔ should reject when no verification available with fail-closed + ✔ should allow when no verification available with fail-open + ✔ should reject when all methods fail with fail-closed + ✔ should allow when all methods fail with fail-open + certificateVerification/ocspVerification.ts + module exports + ✔ should export verifyOCSP function + ✔ should export performOCSPCheck function + verifyOCSP() main API + ✔ should handle disabled OCSP verification + ✔ should return result structure with valid field + ✔ should convert Buffer to PEM format for processing + ✔ should handle fail-closed mode correctly + ✔ should handle fail-open mode correctly + ✔ should handle config with all optional fields + ✔ should handle minimal config with defaults + ✔ should return cached field in result + ✔ should handle provided OCSP URLs + ✔ should handle empty OCSP URLs array + ✔ should handle null certificate input gracefully + ✔ should handle empty buffer input + ✔ should handle very short timeout + performOCSPCheck() error handling + ✔ should handle generic OCSP errors + ✔ should return result with status field + certificateVerification/pkijs-ed25519-patch.ts + patch module exports + ✔ should export applyEd25519Patch function + ✔ should apply patch without errors + Ed25519 OID constants validation + ✔ should recognize standard Ed25519 and Ed448 OIDs + ✔ should validate algorithm names + EdDSA algorithm properties + ✔ should understand EdDSA built-in hashing + ✔ should handle algorithm parameter structures + bit string handling logic + ✔ should handle bit strings with unused bits + ✔ should handle bit strings without unused bits + error handling patterns + ✔ should handle verification errors gracefully + ✔ should handle missing crypto API gracefully + integration patterns + ✔ should understand proper import order requirements + ✔ should validate patch application pattern + CryptoEngine.getHashAlgorithm patch + ✔ should return placeholder for Ed25519 algorithm + ✔ should return placeholder for Ed448 algorithm + ✔ should delegate to original for non-EdDSA algorithms + CryptoEngine.getAlgorithmByOID patch + ✔ should return Ed25519 algorithm for Ed25519 OID + ✔ should return Ed448 algorithm for Ed448 OID + ✔ should delegate to original for non-EdDSA OIDs + ✔ should return result for unknown OIDs without throwing + CryptoEngine.getAlgorithmParameters patch + ✔ should return Ed25519 parameters for sign operation + ✔ should return Ed25519 parameters for verify operation + ✔ should return Ed448 parameters for sign operation + ✔ should return Ed448 parameters for verify operation + ✔ should delegate to original for non-EdDSA algorithms + Certificate.getPublicKey patch + ✔ should handle Ed25519 public key extraction + ✔ should handle Ed448 public key extraction + Certificate.verify patch + ✔ should return false for invalid Ed25519 certificate verification + ✔ should return false for invalid Ed448 certificate verification + CryptoEngine.verifyWithPublicKey patch + ✔ should return false when crypto.subtle is unavailable for Ed25519 + ✔ should return false when crypto.subtle is unavailable for Ed448 + ✔ should handle BIT STRING signature with unused bits + ✔ should not trim signature when no unused bits + patch preservation of original behavior + ✔ should not affect RSA certificate operations + ✔ should not affect ECDSA algorithm parameters + certificateVerification/verificationConfig.ts + configuration constants + ✔ should export required constants + ✔ should export OCSP defaults from validation module + ✔ should export CRL defaults from validation module + ✔ should generate User-Agent string with version + cached configuration function + ✔ should export getCachedCertificateVerificationConfig function + ✔ should handle falsy mtls configurations + ✔ should return false for mtls: true (cert verification disabled by default) + ✔ should handle complex configuration objects + ✔ should handle CRL configuration + ✔ should handle edge cases + caching behavior + ✔ should cache results for repeated calls + ✔ should handle object configurations + ✔ should handle complex nested configuration objects + ✔ should handle invalid config gracefully with fail-safe behavior + ✔ should handle invalid timeout values gracefully + ✔ should handle invalid cacheTtl values gracefully + ✔ should handle invalid errorCacheTtl values gracefully + ✔ should handle zero cacheTtl values gracefully + ✔ should handle negative cacheTtl values gracefully + ✔ should accept very large cacheTtl values + ✔ should handle invalid gracePeriod values gracefully + ✔ should accept zero gracePeriod + boolean shorthand config (crl: true, ocsp: true) + ✔ should handle crl: true shorthand with defaults + ✔ should handle ocsp: true shorthand with defaults + ✔ should handle both crl: true and ocsp: true together + ✔ should handle crl: true with additional overrides + ✔ should handle ocsp: true with additional overrides + certificateVerification/verificationUtils.ts + bufferToPem function + ✔ should export bufferToPem function + ✔ should convert buffer to PEM format correctly + ✔ should handle empty buffer + ✔ should split long base64 into appropriate lines + pemToBuffer function + ✔ should export pemToBuffer function + ✔ should convert PEM to ArrayBuffer correctly + ✔ should handle PEM with whitespace + cache key generation + ✔ should export createCacheKey function + ✔ should create consistent cache keys + ✔ should create different keys for different methods + ✔ should export createCRLCacheKey function + ✔ should create CRL cache keys + ✔ should export createRevokedCertificateId function + ✔ should create composite revoked certificate IDs + certificate chain extraction + ✔ should export extractCertificateChain function + ✔ should extract single certificate + ✔ should extract certificate chain with issuer + ✔ should handle self-signed certificate + ✔ should handle missing raw data + ✔ should handle long certificate chains + ✔ should handle null issuer certificate + error handling for certificate parsing + ✔ should handle invalid certificates gracefully + ✔ should handle various PEM formats + ✔ should handle different certificate types in bufferToPem + ✔ should properly handle line wrapping in bufferToPem + ✔ should handle additional data in cache keys + cache key edge cases + ✔ should handle createCacheKey without additional data + ✔ should create different keys for same cert with different methods + ✔ should create different keys for different certificates + ✔ should create different keys for different issuers + ✔ should handle createCRLCacheKey with various URL formats + ✔ should handle createRevokedCertificateId with special characters + ✔ should handle createRevokedCertificateId with long values + table getter functions + ✔ should export getCertificateCacheTable function + ✔ should return certificate cache table with correct structure + ✔ should return same table instance on multiple calls + PEM format edge cases + ✔ should handle pemToBuffer with minimal valid PEM + ✔ should handle bufferToPem with empty buffer + ✔ should handle bufferToPem with exactly 64 chars of base64 + ✔ should handle pemToBuffer with Windows line endings + ✔ should handle pemToBuffer with mixed line endings + extractCertificateChain edge cases + ✔ should handle certificate with undefined issuerCertificate property + ✔ should handle very long certificate chains + ✔ should handle certificate chain with identical adjacent certificates + Test PermissionResponseObject class + Test handleInvalidItem method - + ✔ should return response object w/ err message in invalid_schema_items + ✔ should return empty unauthorized_access array even if populated before + Test addInvalidItem method - + ✔ should add item if schema_table key is not include unauthorized_access + ✔ should NOT add item if schema_table key is include unauthorized_access + security/impersonation.ts + applyImpersonation - gate check + ✔ should reject non-super-user with 403 + ✔ should reject user with no role + ✔ should reject null authenticatedUser + ✔ should reject undefined authenticatedUser + ✔ should reject user with role but no permission property + applyImpersonation - payload validation + ✔ should reject null payload + ✔ should reject payload with neither username, role_name, nor role + ✔ should reject payload with empty username and no role + ✔ should reject payload with non-object role + ✔ should reject payload with role missing permission + ✔ should reject array payload + ✔ should reject role with null permission + ✔ should reject operations field that is not an array + ✔ should reject non-string entries in operations array + ✔ should reject invalid operations entries + ✔ should accept valid operations including group names + applyImpersonation - Mode A (inline permissions) + ✔ should return synthetic user with inline permissions + ✔ should use provided username for audit context + ✔ should force super_user: false even if payload says true + ✔ should force cluster_user: false even if payload says true + ✔ should use Mode A (inline) when both role and username are provided + applyImpersonation - Mode B (existing user lookup) + ✔ should return cloned user from cache + ✔ should throw 404 for non-existent user + ✔ should force super_user: false on looked-up super user + ✔ should force cluster_user: false on looked-up cluster user + ✔ should NOT mutate the original cache entry after enforceDowngrade + ✔ should reject impersonation of inactive user with 403 + ✔ should handle looked-up user with no role gracefully + applyImpersonation - Mode C (role name lookup) + ✔ should return synthetic user with the looked-up role permissions + ✔ should use provided username for audit context + ✔ should throw 404 for non-existent role name + ✔ should force super_user: false on looked-up role + ✔ should force cluster_user: false on looked-up role + ✔ should NOT mutate the original role record + ✔ should prefer Mode A when both role and role_name are provided + applyImpersonation - audit trail + ✔ should set _impersonated and _impersonatedBy on the result + ✔ should set _impersonated role id consistently across all modes + scopedImport + ✔ should import a module + ✔ should throw an error importing an invalid CommonJS module + ✔ should throw an error importing a CommonJS module with invalid dependency + ✔ should throw an error importing an invalid ESM module + ✔ should resolve require("harperdb") to harper exports + ✔ should throw an error importing an ESM module with invalid dependency + ✔ should handle dynamic import() from a CJS module + import.meta compatibility + ✔ should populate import.meta.url, filename, dirname, and resolve for ESM modules + symlinked module resolution + ✔ should resolve relative CJS require through a symlinked module + ✔ should resolve relative ESM import through a symlinked module + Test keys module + ✔ Test loadCertificates loads certs from config file + ✔ Test getReplicationCert returns the correct cert + ✔ Test getReplicationCertAuth returns the correct CA + ✔ Test generateCertificates happy path + ✔ Test getCertAuthority happy path +[main/0] [notify] [tls]: A suitable replication certificate was not found, creating new self singed cert named: localhost + ✔ Test reviewSelfSignedCert create a new cert (184ms) + ✔ Test updateConfigCert builds new cert config correctly + ✔ hostnamesFromCert returns the correct hostnames + ✔ getPrimaryHostName with subject + ✔ can extract the hostnames from a certificate + ✔ Test setCertTable with malformed certificate - illegal ASN.1 padding + ✔ Test setCertTable with valid certificate should work + ✔ Test setCertTable error handling suggestion for cloneNode issue + ✔ Test generateCertAuthority includes subjectKeyIdentifier extension for OCSP support (378ms) + generateSerialNumber + ✔ should generate valid hex serial numbers + ✔ should generate positive ASN.1 integers (high bit cleared) + ✔ should generate unique serial numbers + updateConfigCert - HARPER_SET_CONFIG interaction + ✔ still writes tls_privateKey when HARPER_SET_CONFIG does not manage it + ✔ does not overwrite tls.privateKey managed by HARPER_SET_CONFIG + Test permissionsTranslator module + test structure_user scenarios + ✔ test structure_user = true + ✔ test structure_user = ["dev"] + Test getRolePermissions method - translation cases + ✔ All true table perms passed with one attribute_permissions object mixed values + ✔ All true table perms passed with one attribute_permissions object all true + ✔ All true table perms passed with one attribute_permissions object all values false + ✔ Mixed table perms passed with one attribute_permissions object all values false + ✔ Mixed table perms passed with one attribute_permissions object all values true + ✔ Mixed table perms passed with one attribute_permissions object with mixed values + ✔ Multiple tables perms passed with multiple attribute_permissions object with mixed values + ✔ All table perms passed are false with one attribute_permissions object all values false - schema.read perm should be false + Test getRolePermissions method - edge cases + ✔ All true table perms passed with no attribute_permissions - expect same perms returned + ✔ translateRolePermissions step should only use non-system schema values + ✔ Pass SU role - expect same permissions to be returned + ✔ Pass same role twice and expect cached permission returned the 2nd time + ✔ Pass roles w/ diff '__updatedtime__' and expect new, non-cached permissions returned both times + ✔ Pass same role w/ diff schema and expect different, non-cached permissions returned both times + Test getTableAttrPerms function + ✔ NOMINAL - should return table perms with correct system time and other perms values + ✔ Should ignore non-READ perms for system time when setting describe perm value + security/role.js + getRoleByName() + ✔ should pass correct search parameters + ✔ should return null when search returns no results + ✔ should return the first matching role + test getJWTRSAKeys function + ✔ test rsa_keys is undefined, happy path + ✔ test rsa_keys is undefined, passphrase file does not exist + ✔ test rsa_keys is undefined, private key file does not exist + ✔ test rsa_keys is undefined, public key file does not exist + ✔ test rsa_keys is defined + test createTokens + ✔ test validation + ✔ test happy path + ✔ test update failed + ✔ test update skipped the record + test validateOperationToken function + ✔ test hdb_admin token + ✔ test old_user token + ✔ test non-existent user + ✔ test bad token + ✔ test expired token + test validateRefreshToken function + ✔ test hdb_admin token + ✔ test old_user token + ✔ test non-existent user + ✔ test bad token + ✔ test expired token + test refreshOperationToken function + ✔ test no body + ✔ test no token + ✔ test hdb_admin token + ✔ test old_user token + ✔ test non-existent user + user.ts Unit Tests + Test addUser + ✔ should add four new users each with the correct hash function (99ms) + ✔ should throw an error if role is not found + Test alterUser + ✔ should alter a user password successfully + ✔ should throw an error if validation fails + Test dropUser + ✔ should drop a user successfully + ✔ should throw an error if user does not exist + Test findAndValidateUser + ✔ should find and validate a user successfully + ✔ should throw an error if user is inactive + ✔ should validate a user with no hash_function value + Test userInfo, listUsersExternal, getSuperUser and getClusterUser + ✔ should return user info + ✔ should return a list of users + ✔ should return the super user + Test custom functions operations + ✔ Test initial cf status values + Test custom function project operations + ✔ Test addComponent creates the project folder with the correct name + ✔ Test getCustomFunctions returns object with proper length and content + ✔ Test packageCustomFunctionProject properly tars up a project directory + ✔ Test setCustomFunction creates a function file as expected + ✔ Test setCustomFunction updates a function file as expected +[main/0] [info]: Empty parameter sent to getConfigValue + ✔ Test dropCustomFunctionProject drops project as expected + Test component operations + ✔ Test getComponents happy path (5001ms) + ✔ Test getComponents includes status information when component status exists + ✔ Test getComponents shows unknown status when component not in status map (5004ms) + ✔ Test getComponents handles getAggregatedFromAllThreads error gracefully + ✔ Test getComponents passes consolidatedStatuses to getAggregatedStatusFor + ✔ Test getComponents handles getAggregatedStatusFor errors gracefully + ✔ Test getComponents shows different statuses for different components + ✔ Test getComponentFile happy path + ✔ Test setComponentFile happy path + Test deployComponent force flag + ✔ Test deployComponent allows overwriting existing user component without force flag + ✔ Test deployComponent allows deploying new component without force flag + ✔ Test deployComponent prevents overwriting core component without force flag + ✔ Test deployComponent allows overwriting core component with force flag + ✔ Test deployComponent prevents overwriting multiple core component names + Test operationsValidation module + Test checkProjectExists function + ✔ Test message returned if project does not exist + ✔ Test project is returned if project exists + ✔ Test message is returned if fs exists throws error + Test checkFileExists function + ✔ Test message is returned if file does not exist + ✔ Test file is returned if it does exist + ✔ Test message is returned if fs exists throws error + Test getDropCustomFunctionValidator function + ✔ Test validation messages are returned + ✔ Test alphanumeric validation messages are returned + Test setCustomFunctionValidator function + ✔ Test validation messages are returned + ✔ Test alphanumeric validation messages are returned + Test addCustomFunctionProjectValidator function + ✔ Test validation messages are returned + ✔ Test alphanumeric validation messages are returned + Test dropCustomFunctionProjectValidator function + ✔ Test validation messages are returned + ✔ Test alphanumeric validation messages are returned + Test ipcUtils module + Test validateEvent function + ✔ Test non object error returned + ✔ Test missing type error returned + ✔ Test missing message error returned + ✔ Test invalid event type error returned + ✔ Test missing originator error returned + Test constructor functions + ✔ Test SchemaEventMsg + ✔ Test UserEventMsg + Test hdbChildIpcHandler module + Test user event handler function + ✔ Test User Handler log error upon setUsersWithRolesCache failure + ✔ Test User Handler calls setUsersWithRolesCache on valid event + ✔ Test User Handler logs error on invalid event (missing type) + ✔ Test User Handler logs error on invalid event (missing message) + ✔ Test User Handler addListener functionality + Test schema event handler function + ✔ Test Schema Handler logs error on invalid event (missing type) + ✔ Test Schema Handler logs error on invalid event (missing message) + Test componentStatusRequestHandler function + ✔ Test componentStatusRequestHandler logs error on invalid event (missing type) + ✔ Test componentStatusRequestHandler logs error on invalid event (missing message) + ✔ Test componentStatusRequestHandler logs error on invalid event (missing originator) + ✔ Test componentStatusRequestHandler processes valid event without error + Test ITCEventObject class + ✔ Test new ITCEventObject is correct shape + Test itcUtils module + Test validateEvent function + ✔ Test non object error returned + ✔ Test missing type error returned + ✔ Test missing message error returned + ✔ Test invalid event type error returned + ✔ Test missing originator error returned + Test constructor functions + ✔ Test SchemaEventMsg + ✔ Test UserEventMsg + Test parseMessage + ✔ Nominal case, parse with no errors + ✔ Invalid message json + ✔ Invalid operation specified + ✔ Invalid job id + ✔ Invalid job + ✔ Invalid json + ✔ Invalid runner message + ✔ Test the operation switch statement + Test runJob + ✔ Nominal case, run stubbed dataload + ✔ Throw exception during update to test error handling + ✔ Invalid message json + ✔ Invalid job id + ✔ Invalid job + ✔ Invalid json + ✔ Invalid runner message + ✔ Throw exception during csv data load + Test jobs.js + Test getJob & getJobsByStartDate handlers + ✔ nominal case, call handleGetJobsByStartDate. + ✔ nominal case, call handleGetJobsByStartDate if end_datetime + ✔ call getJobsInDateRange, throw an error to test catch. + ✔ nominal case, call handleGetJob + ✔ nominal case, call handleGetJob if end_datetime + ✔ call handleGetJob, throw an error to test catch. + Test addJob + ✔ nominal case, add a job to the schema. +[main/0] [info]: invalid job type specified: bad type. + ✔ test calling addJob, invalid job type, expect false. + ✔ test calling addJob with first search id collision, expect true +[main/0] [info]: job parameter is invalid + ✔ test calling addJob with null job. + ✔ test validation msg from CSV URL load is handled as expected + ✔ test validation msg from CSV data load is handled as expected + ✔ test validation msg from import S3 file is handled as expected + ✔ test error result is returned + ✔ test error result is returned when error with duplicate id search + ✔ test error result is returned when error with insert + ✔ test error result is returned when inserted hashes length is zero + Test getJobsInDateRange + ✔ nominal case, search in date ranges. + ✔ Search with invalid from date, expect error. + ✔ Search with invalid to date, expect error. + ✔ Search valid input, no results expected. + ✔ test custom error message is thrown + Test getJobById + ✔ nominal case, find 1 job by ID. + ✔ Search with null id, expect error + ✔ test custom error message is thrown + Test updateJob + ✔ Nominal case of updateJob + ✔ Nominal case of updateJob, check end time updated + ✔ Test bad object check + ✔ Test missing id check + topoSort + ✔ returns empty array unchanged + ✔ returns single element unchanged + ✔ preserves registration order when no constraints + ✔ enforces `before` constraint + ✔ enforces `after` constraint + ✔ preserves config order as tiebreaker: auth before rest when both unconstrained + ✔ config: rest, authentication, static → auth pulled before rest + ✔ `before` applies to the FIRST registered entry with that name + ✔ `after` applies to the LAST registered entry with that name + ✔ reference to unknown name is a no-op + ✔ calls onCycle and returns original order when cycle detected + buildLinearChain + ✔ returns fallback when entry list is empty + ✔ calls the single listener with (request, next) + ✔ calls listeners in sorted order and threads next correctly + ✔ short-circuits when a listener returns without calling next + resolveDeps + ✔ returns same entries when no after deps + ✔ pulls in a dep that is in the registry but not the entry list + ✔ resolves transitive deps: A after B, B after C + ✔ does NOT pull in entries referenced only by `before` + ✔ ignores unknown dep names + matchesRoute + ✔ matches everything when no constraints + ✔ matches exact urlPath + ✔ matches urlPath with sub-path + ✔ does NOT match a path that is merely a string-prefix (segment boundary required) + ✔ does NOT match a completely different path + ✔ matches virtual host (ignoring port in Host header) + ✔ does NOT match wrong host + ✔ requires both host and urlPath to match + makeCallbackChain + ✔ flat chain: no sub-routes, calls middleware in registration order + ✔ flat chain: before/after constraints override registration order + ✔ filters by port: only includes matching port entries + ✔ port "all" entries appear in every port chain + ✔ routes to sub-chain by urlPath + ✔ routes to sub-chain by host + ✔ sub-route auto-pulls auth via `after` dependency + ✔ sub-route with `after` dep: dep runs once, not twice + ✔ specificity: host+path wins over path-only for same urlPath prefix + ✔ longer urlPath wins over shorter prefix + stripPrefix + ✔ strips the prefix from pathname + ✔ strips the prefix from url + ✔ returns "/" when pathname equals prefix exactly + ✔ does not mutate the original request + ✔ sub-route chain receives stripped pathname + ✔ sub-route chain receives "/" for exact prefix match + ✔ default chain receives unmodified pathname + ✔ treats trailing slash on prefix as equivalent (no malformed paths) + ✔ reflects downstream pathname mutations (lazy evaluation) + normalizeUrlPath + ✔ returns undefined for undefined/empty + ✔ preserves root "/" + ✔ strips a single trailing slash + ✔ leaves paths without trailing slash unchanged + matchesRoute with trailing slash + ✔ matches sub-paths when route.urlPath ends with "/" + variadic dispatch with requestArgIndex + ✔ forwards all positional args to the inner chain (default chain) + ✔ routes by urlPath using arg at requestArgIndex, preserves other args (sub-route) + ✔ upgrade-style signature: forwards (request, socket, head) when routing + onCycle callback + ✔ invokes onCycle and falls back to registration order when cycles exist + ✔ is wired through makeCallbackChain + Test operationsServer module + Test calculateRestHttpURL + ✔ Chooses https when httpSecurePort provided + ✔ Chooses can use non-standard ports + ✔ Chooses http when httpSecurePort not provided + ✔ Uses configured port instead of the one from the request + ✔ Uses configured port instead of the one from the request + ✔ Uses port from the request if not otherwise configured + ✔ Uses the hostname from the request + ✔ Assume port forwarding and SSL termination with non-localhost, non-ips + REST - parseHeaderValue + ✔ should not be vulnerable to denial of service + Test Headers + Create and modify headers + ✔ should handle headers + ✔ should handle append with commas + ✔ should handle append with commas on a Map + ✔ construct headers from object + ✔ construct headers from Map and merge + ✔ should handle multiple Set-Cookie headers correctly + ✔ should keep non-Set-Cookie headers with arrays merged (not split) + ✔ should handle set() with array values and ensure array elements are strings + ✔ should handle appendHeader with headers.set path (no append method) + ✔ should handle appendHeader with plain object (no set or append) + ✔ should handle mergeHeaders with Set-Cookie on target without append method + ✔ should handle mergeHeaders with Set-Cookie on target with append method + ✔ should handle mergeHeaders with plain object target + ✔ should handle mergeHeaders with single Set-Cookie value (not array) + ✔ should handle mergeHeaders with Map target and single existing Set-Cookie + ✔ should handle mergeHeaders with Map target and array existing Set-Cookie + ✔ should verify mergeHeaders returns the same target (modifies in place) + Test JSONStream module + Streaming + ✔ Streams object + ✔ Streams array + ✔ Streams generator + ✔ Streams async generator + Request class + peerCertificate getter + ✔ should call getPeerCertificate with true to get full certificate chain + ✔ should return null when socket has no certificate + ✔ should handle empty certificate object + ✔ should ensure certificate chain is available for OCSP verification + other getters + ✔ should return correct protocol based on socket encryption + ✔ should return correct IP address + ✔ should return authorized status + ✔ should return mtlsConfig from server + ✔ should return correct pathname + ✔ should return correct host + ✔ should return correct absoluteURL + ✔ should handle pathname setter + ✔ should return httpVersion + ✔ should return isAborted status + body getter + ✔ should create RequestBody instance lazily + ✔ should proxy event handling to node request + ✔ should proxy pipe to node request + sendEarlyHints method + ✔ should send early hints with link header + ✔ should merge link with additional headers + withNodeAdapter + nodeRequest argument + ✔ reflects current method and url + ✔ reflects middleware-mutated headers + ✔ has lowercase header keys + ✔ delegates socket to the underlying IncomingMessage socket + nodeResponse — writeHead + ✔ resolves response with correct status and headers + ✔ is idempotent — second writeHead call is a no-op + ✔ accepts array-of-pairs header format + ✔ accepts flat alternating-array header format + ✔ sets headersSent after writeHead + nodeResponse — setHeader / end path + ✔ resolves response with headers set before end() + ✔ captures statusCode set directly + ✔ getHeader / hasHeader / removeHeader work + nodeResponse — body streaming + ✔ end() with a chunk delivers the body + ✔ multiple write() calls are streamed in order + ✔ end() with no body yields an empty body + ✔ sets writableEnded after end() + ✔ emits finish event after body is fully written + ✔ write() invokes callback-as-second-arg after chunk is written + ✔ end() invokes callback-as-second-arg after body is flushed + nodeResponse — setHeader multi-value + ✔ preserves Set-Cookie as separate values + ✔ setHeader with a single string value works normally + nodeResponse — destroy + ✔ rejects the response promise with the provided error + ✔ rejects the response promise when destroyed with no error + ✔ does not reject the response promise when destroy called after headers flushed + ✔ propagates destroy error to body consumer after headers are flushed + async handler + ✔ rejects the response promise when async handler throws before writing headers + ✔ does not double-reject after headers are flushed when async handler throws + Headers class + ✔ should get headers case-insensitively + ✔ should set headers case-insensitively + ✔ should check header existence case-insensitively + ✔ should delete headers case-insensitively + ✔ should iterate over headers + ✔ should return header keys + ✔ should return header values + ✔ should iterate with forEach + test requestTimePlugin + ✔ test Server-Timing header + Test serverHandlers.js module + handleServerUncaughtException() + ✔ Should send error to console and log before exiting process + serverErrorHandler() + ✔ Should send a response with error message and 500 code when an plain Error is passed + ✔ Should send a response with custom error message and 400 code when included in error passed + ✔ Should send a response with custom error message object and 400 code when included in error passed + ✔ Should send a response with custom error message object when included in standard error type passed + ✔ Should send a response with custom message object when included when an object is passed + ✔ Should handle error passed as a string + reqBodyValidationHandler() + ✔ Should not reject if request is valid + ✔ Should throw error if request has no body + ✔ Should throw error if request includes an empty body object + ✔ Should throw error if request body is a string/not valid JSON + ✔ Should throw error if request body does not include an `operation` property + ✔ Should throw error if request body does not include an value in its `operation` property + authHandler() + ✔ Should pass auth for valid nominal request + ✔ Should pass auth for valid request for create auth tokens operation + ✔ Should throw error if thrown from auth + authAndEnsureUserOnRequest() + ✔ Should pass auth for valid nominal request + ✔ Should pass auth for valid request for create auth tokens operation + ✔ Should throw error if thrown from auth + handlePostRequest() + ✔ Should return the result from the operation function + ✔ Should call processLocalTransaction with result of chooseOperation + ✔ Should handle error thrown from chooseOperation + ✔ Should handle error thrown from processLocalTransaction + Test serverUtilities.js module + Test chooseOperation + ✔ Nominal path with insert operation. + ✔ Invalid operation specified in json. + test getOperationFunction + ✔ test insert + ✔ test update + ✔ test upsert + ✔ test SEARCH_BY_HASH + ✔ test SEARCH_BY_VALUE + ✔ test SEARCH + ✔ test SQL + ✔ test CSV_DATA_LOAD + ✔ test CSV_FILE_LOAD + ✔ test CSV_URL_LOAD + ✔ test CREATE_SCHEMA + ✔ test CREATE_TABLE + ✔ test CREATE_ATTRIBUTE + ✔ test DROP_SCHEMA + ✔ test DROP_TABLE + ✔ test DROP_ATTRIBUTE + ✔ test DESCRIBE_SCHEMA + ✔ test DESCRIBE_TABLE + ✔ test DESCRIBE_ALL + ✔ test DELETE + ✔ test ADD_USER + ✔ test ALTER_USER + ✔ test DROP_USER + ✔ test LIST_USERS + ✔ test LIST_ROLES + ✔ test ADD_ROLE + ✔ test ALTER_ROLE + ✔ test DROP_ROLE + ✔ test USER_INFO + ✔ test READ_LOG + ✔ test SET_CONFIGURATION + ✔ test EXPORT_TO_S3 + ✔ test DELETE_FILES_BEFORE + ✔ test EXPORT_LOCAL + ✔ test SEARCH_JOBS_BY_START_DATE + ✔ test GET_JOB + ✔ test RESTART + ✔ test CATCHUP + ✔ test SYSTEM_INFORMATION + ✔ test DELETE_AUDIT_LOGS_BEFORE + ✔ test READ_AUDIT_LOG + Test processLocalTransaction + ✔ Should return results from callOperationFunctionAsAwait() method + ✔ Should handle error thrown from callOperationFunctionAsAwait() method + ✔ Should handle error returned from operation function caller + ✔ Should wrap non-object results in message object + ✔ Should not log request body for read_log operation + ✔ Should strip sensitive fields from logged request body + server.status.definitions + constants + ✔ should export STATUS_DEFINITIONS with correct structure + ✔ should export STATUS_IDS with all status types + ✔ should export DEFAULT_STATUS_ID as primary + exported constants structure + ✔ should ensure STATUS_IDS contains all keys from STATUS_DEFINITIONS + ✔ should validate the structure of exported constants + server.status + ✔ should set status + ✔ should get specific status + ✔ should get complete status with just primary set + ✔ should get complete status + ✔ should fail validation on test status + ✔ should validate availability status values + getAllStatus functionality + ✔ should return system status, component status, and restart flag when calling get without id + ✔ should handle empty component status gracefully + ✔ should continue working if component status functions are unavailable + storageReclamation module + onStorageReclamation + ✔ should register handler when skipThreadCheck is true + ✔ should register handler on last worker thread + ✔ should not register handler on non-last worker thread + ✔ should register multiple handlers for the same path + ✔ should register handlers for different paths + ✔ should set reclamation timer after first handler registration + ✔ should not create duplicate timers on subsequent registrations + ✔ should initialize handler entry with priority 0 + setAvailableSpaceRatioGetter + ✔ should allow setting custom space ratio getter + ✔ should reset to default getter when passed null + runReclamationHandlers + ✔ should not call handler when space is above threshold +[main/0] [info]: Running storage reclamation handler for /test/path with priority 2 + ✔ should call handler when space is below threshold +[main/0] [info]: Running storage reclamation handler for /test/path with priority 2 +[main/0] [info]: Running storage reclamation handler for /test/path with priority 0.5 + ✔ should call handler with priority 0 after space is reclaimed +[main/0] [info]: Running storage reclamation handler for /path/low with priority 2 + ✔ should handle multiple paths independently + ✔ should handle errors in space ratio getter gracefully +[main/0] [info]: Running storage reclamation handler for /test/path with priority 2 + ✔ should handle errors in handler gracefully +[main/0] [info]: Running storage reclamation handler for /test/path with priority 2 +[main/0] [info]: Running storage reclamation handler for /test/path with priority 2 + ✔ should call multiple handlers for the same path + ✔ should not log when handler returns undefined + ✔ should not call handler when space is exactly at threshold + ✔ should reschedule timer after running handlers +[main/0] [info]: Running storage reclamation handler for /test/path with priority 2 + ✔ should update entry priority after each run +[main/0] [info]: Running storage reclamation handler for /test/path with priority 2 +[main/0] [info]: Running storage reclamation handler for /test/path with priority 0.5 + ✔ should not call handler on third run when space stays normal +[main/0] [info]: Running storage reclamation handler for /path/ok with priority 2 + ✔ should continue processing other paths after one path errors + throttle test + ✔ will throttle calls to a function + ✔ will limit the queue length of throttled functions (100ms) + ✔ throttled calls propagate errors + UDS mirror (writeUdsMetadata, cleanup helpers) + writeUdsMetadata + ✔ writes pid, tid, and port to the YAML file + ✔ writes certificate name and hostnames + ✔ writes certificate PEM as a YAML block scalar + ✔ includes privateKeyFile path when key_file is present + ✔ writes certificate authorities when present + ✔ writes empty certificates list when secureContexts is empty + ✔ de-duplicates contexts that are shared across multiple hostnames + ✔ logs an error if the file cannot be written + registerUdsCleanupPaths + cleanupUdsFiles + ✔ cleanupUdsFiles removes registered socket and yaml files + ✔ cleanupUdsFiles does not throw when files are already gone + cleanupSocketsDirectory + ✔ removes all files in the sockets directory when enabled + ✔ does nothing when tls.unixDomainSockets is not enabled + ✔ does not throw when the sockets directory does not exist + Test functions from alasqlFunctionImporter w/ alasql + ✔ should return CURRENT_DATE() value in YYYY-MM-DD format + ✔ should return CURRENT_TIME() value in HH:mm:ss.SSS format + ✔ should EXTRACT the correct date parts + ✔ should return DATE() value in YYYY-MM-DDTHH:mm:ss.SSSZZ format + ✔ should return DATE_FORMAT() value in provided format + ✔ should return correct new date after time is added in DATE_ADD() + ✔ should return correct new date after time is subtracted in DATE_SUB() + ✔ should return correct difference between the two dates provided to DATE_DIFF() + ✔ should return correct difference between the two dates based on interval provided to DATE_DIFF() + ✔ should return NOW() value in unix epoch format + ✔ should return GETDATE() value in unix epoch format + ✔ should return CURRENT_TIMESTAMP value in unix epoch format + ✔ should return GET_SERVER_TIME value as local timestamp in YYYY-MM-DDTHH:mm:ss.SSSZZ format + ✔ should return OFFSET_UTC value in YYYY-MM-DDTHH:mm:ss.SSSZZ format + Test sql_statement_bucket Class + Test getDeleteAttributes + ✔ Nominal, pull attributes in delete statement + ✔ Pull attributes from delete statement with no where clause + ✔ Pull attributes from delete statement with no table clause + Test getInsertAttributes + ✔ Nominal, pull attributes in Insert statement + ✔ Pull attributes from insert statement with no table clause + Test getUpdateAttributes + ✔ Nominal, pull attributes in update statement + ✔ Pull attributes from update statement with no table clause + Test getSelectAttributes + ✔ Nominal, pull attributes in Select statement + ✔ Nominal, pull attributes in Select statement with cross schema join + ✔ Pull attributes from insert statement with no table clause + Test getRecordAttributesAST + ✔ Nominal case, valid, reasonably complex AST with attributes. + ✔ Nominal case, valid AST with CROSS SCHEMA JOIN +[main/0] [info]: table specified as steffen not found. + ✔ Nominal case, INVALID table in WHERE, reasonably complex AST with attributes. + Test getAttributesBySchemaTableName + ✔ Nominal, get attributes expected from select parsing + Test getAllTables + ✔ Nominal, get all tables expected from select parsing + Test getAllTables + ✔ Nominal, get all tables expected from select parsing + Test AWSConnector module + Test getS3AuthObj function + ✔ should return value from call to new S3 object returned from getS3AuthObj + Test common_utils module + ✔ Test ms_to_time + Test errorizeMessage + ✔ Nominal, pass message + ✔ Pass in null + ✔ Pass in undefined + Test isEmpty + ✔ Pass in null value, expect true + ✔ Pass in undefined value, expect true + ✔ Pass in value, expect false + ✔ Pass in empty value, expect false + Test isEmptyOrZeroLength + ✔ Pass in null value, expect true + ✔ Pass in undefined value, expect true + ✔ Pass in value, expect false + ✔ Pass in empty value, expect true + ✔ Pass in 0, expect true + ✔ Pass in string with all spaces, expect false + Test listHasEmptyValues + ✔ Pass in null value, expect true + ✔ Pass in null value, expect true + ✔ Pass in undefined value, expect true + ✔ Pass in value, expect false + ✔ Pass in empty value, expect false + Test listHasEmptyOrZeroLengthValues + ✔ Pass in null value, expect true + ✔ Pass in null value, expect true + ✔ Pass in undefined value, expect true + ✔ Pass in value, expect false + ✔ Pass in empty value, expect true + Test buildFolderPath + ✔ Pass in null, expect empty string + ✔ Pass in empty string, expect empty string + ✔ Pass in values with mixed null and empty string, expect double slashes where empty values would be + ✔ Pass in values mixed with numbers and strings, expect a path + Test isBoolean + ✔ Pass in null, expect false + ✔ Pass in undefined, expect false + ✔ Pass in empty string, expect false + ✔ Pass in spaces, expect false + ✔ Pass in string, expect false + ✔ Pass in 1, expect false + ✔ Pass in 0, expect false + ✔ Pass in number, expect false + ✔ Pass in array, expect false + ✔ Pass in object, expect false + ✔ Pass in true, expect true + ✔ Pass in false, expect true + ✔ Pass in evaluation, expect true + Test autoCast + ✔ Pass in null, expect null + ✔ Pass in 0.10056344792246819, expect 0.10056344792246819 as number + ✔ Pass in "0.059_111.519", expect "0.059_111.519" as string + ✔ Pass in "0.059,111.519", expect "0.059,111.519" as string + ✔ Pass in "0.059.111.519", expect "0.059.111.519" as string + ✔ Pass in undefined, expect undefined + ✔ Pass in empty string, expect empty string + ✔ Pass in spaces, expect spaces + ✔ Pass in string of null, expect null + ✔ Pass in string of undefined, expect undefined + ✔ Pass in string of true, expect boolean true + ✔ Pass in uppercase string of true, expect boolean true + ✔ Pass in uppercase string of false, expect boolean false + ✔ Pass in uppercase string of null, expect value of null + ✔ Pass in string of 42, expect number 42 + ✔ Pass in string of 0, expect number 0 + ✔ Pass in string of 42.42, expect number 42.42 + ✔ Pass in string of '0102', expect string '0102' + ✔ Pass in string surrounded by brackets, expect string surrounded by brackets + ✔ Pass in false, expect false + ✔ Pass in true, expect true + ✔ Pass in 1, expect 1 + ✔ Pass in 0, expect 0 + ✔ Pass in date , expect date back + ✔ Pass in array , expect array back + ✔ Pass in array of various values , expect array back + ✔ Pass in object , expect object back + ✔ Pass in number with e in it , string back + ✔ Pass in number with e in it , string back 2 + ✔ Pass in number with e in it , string back 3 + ✔ Pass in number with a in it , string back 3 + ✔ Pass in number with E in it , string back + ✔ Pass in number with E in it , string back 2 + ✔ Pass in number with E in it , string back 3 + ✔ Pass in number with A in it , string back 3 + autoCastBooleanStrict + ✔ should cast "true" to true + ✔ should cast "false" to false + ✔ should cast "TRUE" to true + ✔ should cast "FALSE" to false + ✔ should cast "True" to true + ✔ should cast "False" to false + ✔ should cast "TrUe" to true + ✔ should cast "FaLsE" to false + ✔ should leave "foo" intact + ✔ should leave 42 intact + ✔ should leave an object intact + Test escapeRawValue + ✔ Pass in null, expect null + ✔ Pass in undefined, expect undefined + ✔ Pass in "", expect "" + ✔ Pass in ".", expect "U+002E" + ✔ Pass in "..", expect "U+002EU+002E" + ✔ Pass in "...", expect "..." + ✔ Pass in "words..", expect "words.." + ✔ Pass in "word.s.", expect "word.s." + ✔ Pass in "hello/this/is/some/text", expect "helloU+002FthisU+002FisU+002FsomeU+002Ftext" + Test unescapeValue + ✔ Pass in null, expect null + ✔ Pass in undefined, expect undefined + ✔ Pass in "", expect "" + ✔ Pass in "U+002E", expect "." + ✔ Pass in "U+002EU+002E", expect ".." + ✔ Pass in "words..", expect "words.." + ✔ Pass in "word.s.", expect "word.s." + ✔ Pass in "wordsU+002EU+002E", expect "wordsU+002EU+002E" + ✔ Pass in "wordU+002EsU+002E", expect "wordU+002EsU+002E" + ✔ Pass in "hello/this/is/some/text", expect "hello/this/is/some/text" + ✔ Pass in "helloU+002FthisU+002FisU+002FsomeU+002Ftext" , expect "hello/this/is/some/text" + Test checkGlobalSchemaTable + ✔ should throw schema does not exist message + ✔ should throw table does not exist message + Test removeBOM function + ✔ Test that the BOM is removed + ✔ Test if parameter not string error thrown + Test checkSchemaTableExist + - Test no schema + - Test no table + Test isObject + ✔ Should return true with simple object + ✔ Should return true with array + ✔ Should return false with string + ✔ Should return false with null + Test environmentManager module + Test getHdbBasePath + ✔ Test that getHdbBasePath and setHdbBasePath + Test get function + ✔ Test expected value is returned + ✔ Test if value is undefined it returns undefined + Test setProperty function + ✔ Test expected values are passed + ✔ Test with invalid property, expect exception + Test doesPropFileExist function + ✔ Test it returns true + ✔ Test it catches error, logs trace message, and returns false + Test initSync function + ✔ Tests config env initialized + Test initTestEnvironment function + - Test properties are set with no test config obj + - Test properties are set with test config obj + test systemInformation module + ✔ test getSystemInformation function (102ms) + ✔ call getSystemInformation 2nd time to test cache + ✔ test getTimeInfo function + ✔ test getCPUInfo function (73ms) + ✔ test getMemoryInfo function + ✔ test getDiskInfo function (67ms) + ✔ test getNetworkInfo function (727ms) + ✔ test getHDBProcessInfo function (1583ms) + ✔ test systemInformation function fetch all attributes (91ms) + ✔ test systemInformation function fetch some attributes + ✔ test systemInformation function fetch all of the attributes (75ms) + ✔ test getTableSize function + Test geoArea + ✔ Pass in no argument geoJSON, expect error + ✔ Pass in null value, expect error + ✔ Pass in number value, expect error + ✔ Pass in polygon geojson, expect 4559449.809365065 + ✔ Pass in point geojson, expect 0 + Test geoLength + ✔ Pass in no argument geoJSON, expect error + ✔ Pass in null value, expect error + ✔ Pass in number value, expect error + ✔ Pass in polygon geojson and invalid units, expect error + ✔ Pass in polygon geojson, expect 10.037307809946478 + ✔ Pass in polygon geojson and miles, expect 6.236893920719556 + ✔ Pass in point geojson and radians, expect 0 + ✔ Pass in line geojson, expect 1.359089002130181 + Test geoCircle + ✔ Pass in no argument geoJSON, expect error + ✔ Pass in null value, expect error + ✔ Pass in number value, expect error + ✔ Pass in point value but no radius, expect error + ✔ Pass in point, radius and invalid units, expect error + ✔ Pass in point, radius of 1, expect matching polygons + ✔ Pass in point, radius of 1 in miles, expect matching polygons + Test geoDifference + ✔ Pass in no argument geoJSON, expect error + ✔ Pass in null value, expect error + ✔ Pass in first poly and null, expect error + ✔ Pass in null, second poly, expect error + ✔ Pass in number value, expect error + ✔ Pass mile poly and kilometer poly to diff, expect matching polygons + ✔ Pass kilometer poly and mile poly to diff, expect null + Test geoDistance + ✔ Pass in no argument geoJSON, expect error + ✔ Pass in null value, expect error + ✔ Pass in first poly and null, expect error + ✔ Pass in null, second poly, expect error + ✔ Pass in number value, expect error + ✔ Pass in 2 points, no units, expect 1.359089002130181 + ✔ Pass in 2 points, second as array, expect 1.359089002130181 + ✔ Pass in 2 points, second as array as string, expect 1.359089002130181 + ✔ Pass in 2 points, miles, expect 0.8444987536102792 + Test geoNear + ✔ Pass in no argument geoJSON, expect error + ✔ Pass in null value, expect error + ✔ Pass in first poly and null, expect error + ✔ Pass in null, second poly, expect error + ✔ Pass in number value, expect error + ✔ Pass in 2 points and a non-numeric value for distance, expect error + ✔ Pass in 2 points, distance of 1, no units expect false + ✔ Pass in 2 points, distance of 1, no units, second as string expect false + ✔ Pass in 2 points,distance of 1, units of miles, expect true + Test geoContains + ✔ Pass in no argument geoJSON, expect error + ✔ Pass in null value, expect error + ✔ Pass in first poly and null, expect error + ✔ Pass in null, second poly, expect error + ✔ Pass in number value, expect error + ✔ Pass in 1 mile radius and enterprise coworking point, expect true + ✔ Pass in 2 polys, expect false + Test geoEqual + ✔ Pass in no argument geoJSON, expect error + ✔ Pass in null value, expect error + ✔ Pass in first poly and null, expect error + ✔ Pass in null, second poly, expect error + ✔ Pass in number value, expect error + ✔ Pass in 1 mile radius and enterprise coworking point, expect false + ✔ Pass in 2 unmatching points, expect false + ✔ Pass in 2 matching points, expect true + ✔ Pass in 2 matching points, second as string, expect true + Test geoCrosses + ✔ Pass in no argument geoJSON, expect error + ✔ Pass in null value, expect error + ✔ Pass in first poly and null, expect error + ✔ Pass in null, second poly, expect error + ✔ Pass in number value, expect error + ✔ Pass in 1 mile radius and enterprise coworking point, expect true + ✔ Pass in 2 unmatching points, expect false + ✔ Pass in 2 matching points, expect true + ✔ Pass in 2 polys where one exists in the other, expect true + Test geoConvert + ✔ Pass in no argument geoJSON, expect error + ✔ Pass in null value, expect error + ✔ Pass in coordinates and null, expect error + ✔ Pass in null, geo type, expect error + ✔ Pass in number value, expect error + ✔ Pass in coordinates & invalid type, expect error + ✔ Pass in point coodinates, matches geo json point + ✔ Pass in line coodinates, matches geo json line + ✔ Pass in polygon coodinates, matches geo json polygon + test alaSQLExtension module + test searchJSON function + ✔ pass no args + ✔ pass null to first arg + ✔ pass empty string to first arg + ✔ pass number to first arg + ✔ pass no value to 2nd arg + ✔ pass null value to 2nd arg + ✔ pass number to 2nd arg + ✔ basic test + Test getTableSchema function + - Can get dog table from dev schema + - Can get table from dog schema + - Can get table from bird schema + - Can get table hdb_attribute from system schema + - Can get table hdb_schema from system schema + - Can get table hdb_user from system schema + - Can get table hdb_role from system schema + - Can get table hdb_job from system schema + - Can get table hdb_license from system schema + - Can get table hdb_nodes from system schema + - Error should be shown when trying to get the table that doesn't have in system and dev schema + - Error should be shown when trying to get the table that doesn't have in system and dev + Test if no table object + - Should show error when get not have table on dev schema + Test if have dog table object + - global.hdb_schema["dev"]["dog"] Should equal TABLE_INFO_DEV_DOG + - if global.hdb_schema is empty + - if dev schema is empty + Test if have cat table object + - global.hdb_schema["dev"]["cat"] Should equal TABLE_INFO_DEV_CAT + - if global.hdb_schema is empty + - if dev schema is empty + Test if have bird table object + - global.hdb_schema["dev"]["bird"] Should equal TABLE_INFO_DEV_BIRD + - if global.hdb_schema is empty + - if dev schema is empty + Test getSystemSchema function + - Should equal system_schema json + test checkJWTTokenExist function + ✔ test happy path (237ms) + ✔ test keys exist + Test isHdbInstalled function + ✔ Test two calls to fs stat with the correct arguments happy path + ✔ Test ENOENT err code returns false + ✔ Test non ENOENT error is handled as expected + Test harper_logger module + ✔ Test suppressLogging function + Test initLogSettings function + ✔ Test that all log settings values are initialized if settings file exists + ✔ Test that if error code is not ENOENT error is handled correctly + Test createLogRecord function + ✔ Test record is correctly returned if message is a string + ✔ Test record is correctly returned if message array has multiple args with object + ✔ Test record is correctly returned if called by an instance of an error + ✔ Test record is correctly returned if message is an object + ✔ Test record is correctly returned if message is an error with a cause + Test notify, fatal, error, warn, info, debug, and trace functions + - Test info log logs to file and stream for non-processManagement process + - Test info log writes to stdout for processManagement process + - Test trace log logs to file and stream for non-processManagement process + - Test trace log writes to stdout for processManagement process + - Test error log logs to file and stream for non-processManagement process + - Test error log writes to stdout for processManagement process + - Test debug log logs to file and stream for non-processManagement process + - Test debug log writes to stdout for processManagement process + - Test notify log logs to file and stream for non-processManagement process + - Test notify log writes to stdout for processManagement process + - Test fatal log logs to file and stream for non-processManagement process + - Test fatal log writes to stdout for processManagement process + - Test warn log logs to file and stream for non-processManagement process + - Test warn log writes to stdout for processManagement process + Test getPropsFilePath function + ✔ Test home dir returned if os.homedir throws error + ✔ Test root dir used if home dir undefined + Test setLogLevel function + ✔ Test the correct hierarchical logs are logged when level set to trace (100ms) + ✔ Test the correct hierarchical logs are logged when level set to debug (101ms) + ✔ Test the correct hierarchical logs are logged when level set to info (101ms) + ✔ Test the correct hierarchical logs are logged when level set to warn (101ms) + ✔ Test the correct hierarchical logs are logged when level set to error (100ms) + ✔ Test the correct hierarchical logs are logged when level set to fatal (100ms) + ✔ Test the correct hierarchical logs are logged when level set to notify (101ms) + Test setLogLevel function on conditional logger + ✔ Test the correct hierarchical logs are available when level set to debug + ✔ Test the correct hierarchical logs are available when level set to warn + ✔ Test the correct hierarchical logs are available when level set to fatal + Test HTTP logger +[main/0] [info] [http]: GET /test HTTPS/1.1 content-type: application/json 200 3.71ms id: 1 + ✔ Test the correct output from HTTP logger on GET (101ms) +[main/0] [info] [http]: POST /post-test HTTP/1.1 content-type: application/json 201 5.13ms id: 2 + ✔ Test the correct output from HTTP logger on POST (101ms) + Test global logger + ✔ Test using the global logger (100ms) + ✔ Test using an application scoped logger (102ms) + Test logRotator module +[main/0] [notify]: hdb.log rotated, old log moved to /home/kzyp/dev/ts-fixes/unitTests/utility/logging/testLogger/HDB-2026-05-12T22-27-29.115Z.log + ✔ Test that log file is rotated if log has exceeded max size (350ms) +[main/0] [notify]: hdb.log rotated, old log moved to /home/kzyp/dev/ts-fixes/unitTests/utility/logging/testLogger/HDB-2026-05-12T22-27-29.466Z.log + ✔ Test that log file is rotated if interval has exceeded its set value (351ms) +[main/0] [notify]: hdb.log rotated, old log moved to /home/kzyp/dev/ts-fixes/unitTests/utility/logging/testLogger/HDB-2026-05-12T22-27-29.817Z.log +rotated log contents 2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 1 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 2 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 3 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 4 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 5 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 6 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 7 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 8 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 9 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 10 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 11 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 12 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 13 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 14 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 15 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 16 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 17 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 18 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 19 +2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 20 + ✔ Test log is compressed when rotated (351ms) + ✔ Test error logged if max size and interval not defined (51ms) + ✔ Test error logged if rotation path is undefined (51ms) + Test readLog module + Test readLog function + ✔ Test bad request throws validation error + ✔ Test no filter with correct number of logs returned + ✔ Test if level, from, and until are defined, correct results are returned + ✔ Test if level, from, and until are defined, PLUS start, correct results are returned + ✔ Test if level and from are defined, correct results are returned + ✔ Test if level and from are defined, PLUS start, correct results are returned + ✔ Test if level and until are defined, correct results are returned + ✔ Test if level and until are defined, PLUS count and start, correct results are returned + ✔ Test if from and until are defined, correct results are returned + ✔ Test if from and until are defined, PLUS limit, correct results are returned + ✔ Test if level is defined, correct results are returned + ✔ Test if level is defined, PLUS desc order, correct results are returned + ✔ Test if level is defined, PLUS asc order, correct results are returned + ✔ Test if there are no logs for the given parameters, empty array returned + ✔ Test if until is defined, correct results are returned + Test pushLineToResult function + ✔ Test if order is desc, line handled correctly + ✔ Test if order is asc, line handled correctly + ✔ Test line added to array if order not specified + Test insertDescending and insertAscending functions + ✔ Test insertDescending adds value to array in correct position + ✔ Test insertAscending adds value to array in correct position + test mount_hdb module +[main/0] [info]: Directory mount/test/hdb created +[main/0] [info]: Directory mount/test/hdb/backup created +[main/0] [info]: Directory mount/test/hdb/keys created +[main/0] [info]: Directory mount/test/hdb/log created +[main/0] [info]: Directory mount/test/hdb/database created +[main/0] [info]: Directory mount/test/hdb/components created + ✔ Test mountHdb calls makeDirectory happy path + Test operation_authorization + ✔ required_permissions should include settings for all API operations + Test verifyPermsAst + ✔ NOMINAL, test verify with proper syntax, expect true +[main/0] [info]: Required insert permission not found for insertData operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 + ✔ Test verify AST with table insert perm false, expect false + ✔ Test verify AST with table perm true but all attr perms false, expect false +[main/0] [info]: operation fart not found. + ✔ Test with bad operations, expect false + ✔ Test select wildcard with proper perms, expect true + ✔ Test select wildcard with read attribute restriction false, expect false + ✔ Test select wildcard with one attribute permission true, expect true + ✔ Test cannot delete from system table error returned + Test verifyPerms +[main/0] [info]: null required parameter in verifyPerms + ✔ Pass in bad values, expect false + ✔ Check return if user has su. Expect true +[main/0] [info]: No role permissions set (this is OK). + ✔ Pass function instead of function name. Expect empty array (no errors) +[main/0] [info]: No role permissions set (this is OK). + ✔ Pass function name instead of function. Expect empty array (no errors) + ✔ Pass in JSON with no schemas restrictions defined, expect invalid schema error + ✔ Pass in JSON with schemas but no table perms defined, expect perms errors + ✔ Pass in JSON with schemas and table dog defined but describe false for all, expect invalid schema result + ✔ (NOMINAL) - Pass in JSON with schemas and table dog defined, insert allowed, expect true + ✔ Pass in JSON with schemas and table dog defined, insert allowed, attr insert restriction false. expect false + ✔ Pass in get_job request as non-super user. expect true + ✔ Pass in search_jobs_by_start_date request as super user. expect true +[main/0] [info]: operation handleGetJobsByStartDate requires SU permissions. + ✔ Pass in search_jobs_by_start_date request as non-super user. expect false + ✔ Pass in get_job request as super user. expect true +[main/0] [info]: Required read permission not found for test method operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 + ✔ Test operation with read & insert required, but user only has insert. False expected + ✔ Pass in JSON with operation = update and with fully restricted timestamp attr, expect false + ✔ Pass in JSON with operation = update and with non-restricted timestamp value, expect error + ✔ (NOMINAL) - Pass in JSON with action = insert, insert allowed, expect true + ✔ Pass in JSON with action = update, TABLE fully restricted, expect error +[main/0] [info]: Required update permission not found for csvDataLoad update operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 + ✔ Pass in JSON with action = update, TABLE update restricted, expect error +[main/0] [info]: operation bad method not found. + ✔ Test bad method. False expected + ✔ NOMINAL - Pass in JSON with su, function that requires su. Expect true. +[main/0] [info]: operation addUser requires SU permissions. + ✔ Pass in JSON with no su, function that requires su. Expect false. + ✔ Test error is thrown from trying to drop system schema + ✔ Test error is thrown from trying to drop system table + ✔ Test error is thrown from trying to drop system attribute + ✔ Test create_schema with structure_user = true +[main/0] [info]: operation createSchema requires SU permissions. + ✔ Test create_schema with structure_user = ["dev"] + ✔ Test create_table with structure_user = true + ✔ Test create_table with structure_user = ["dev"] + ✔ Test create_table with structure_user = ["dev"], no access to schema "nope" + ✔ Test create_attribute with structure_user = true + ✔ Test create_attribute with structure_user = ["dev"] + ✔ Test create_attribute with structure_user = ["dev"], no access to schema "nope" + ✔ Test drop_attribute with structure_user = true + ✔ Test drop_attribute with structure_user = ["dev"] + ✔ Test drop_attribute with structure_user = ["dev"], no access to schema "nope" + ✔ Test drop_schema with structure_user = true +[main/0] [info]: operation dropSchema requires SU permissions. + ✔ Test drop_schema with structure_user = ["dev"] + ✔ Test drop_table with structure_user = true + ✔ Test drop_table with structure_user = ["dev"] + ✔ Test drop_table with structure_user = ["dev"], no access to schema "nope" + Test checkAttributePerms + ✔ Nominal path - Pass in JSON with insert attribute required. Expect true. + ✔ Pass in JSON with insert attribute required, but role does not have insert perm. Expect false. + ✔ Pass in JSON with action = update, attrs on table have update restricted, expect error + ✔ NOMINAL - Pass in JSON with op = upsert, attrs on table have insert/update perms + ✔ Pass in JSON with op = upsert, attrs on table have update restricted, expect error + ✔ Pass in JSON with op = upsert, new attrs for table w/ attr restricted, expect error + ✔ Pass invalid operation. Expect false. +[main/0] [info]: no attributes specified in checkAttributePerms. + ✔ Pass invalid json. Expect false. + Test getRecordAttributes + ✔ Nominal case, valid JSON with attributes. Expect set with size of 4 +[main/0] [info]: TypeError: Cannot read properties of null (reading 'action') + at getRecordAttributes (/home/kzyp/dev/ts-fixes/utility/operation_authorization.js:744:12) + at Context. (/home/kzyp/dev/ts-fixes/unitTests/utility/operation_authorization.test.js:1189:17) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) + ✔ pass invalid JSON with attributes. Expect empty set. + ✔ Nominal case pass JSON with no records. Expect empty set. + ✔ Nominal case, valid JSON for search_by_conditions + ✔ Nominal case, valid JSON for search_by_conditions w/ deprecated property names + ✔ Nominal case, valid JSON for search_by_value + ✔ Nominal case, valid JSON for search_by_value w/ deprecated property names + Test getAttributePermissions + ✔ Nominal case, valid JSON with attributes in the role. +[main/0] [info]: no hdb_user specified in getAttributePermissions + ✔ invalid JSON, Expect zero length Map returned + ✔ JSON with no restrictions in the role. Expect false + ✔ JSON with super user. Expect zero length back + Test hasPermissions +[main/0] [info]: hasPermissions has an invalid parameter + ✔ Test invalid parameter + ✔ Test nominal path, insert required. Expect true +[main/0] [info]: Required insert permission not found for insertData operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 + ✔ Test insert required but missing from table perms. Expect false. + ✔ NOMINAL - Test upsert op with insert/update perms TRUE +[main/0] [info]: Required insert permission not found for upsertData operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 + ✔ Test upsert op with insert perms false - expect error +[main/0] [info]: Required update permission not found for upsertData operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 + ✔ Test upsert op with update perms false - expect error +[main/0] [info]: Required insert permission not found for upsertData operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 +[main/0] [info]: Required update permission not found for upsertData operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 + ✔ Test upsert op with insert/update perms false - expect error + Test operations permissions + verifyPerms() — operations allowlist +[main/0] [info]: TypeError: Cannot read properties of undefined (reading 'forEach') + at getRecordAttributes (/home/kzyp/dev/ts-fixes/utility/operation_authorization.js:748:20) + at Object.verifyPerms (/home/kzyp/dev/ts-fixes/utility/operation_authorization.js:532:22) + at Context. (/home/kzyp/dev/ts-fixes/unitTests/utility/operation_authorization.test.js:1555:27) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) +[main/0] [info]: No role permissions set (this is OK). + ✔ (NOMINAL) op in read_only group with table READ perm — search allowed + ✔ op NOT in operations list — insert blocked even with table perms + ✔ SU-only op in operations — restart granted without super_user + ✔ SU-only op NOT in operations — restart denied + ✔ get_configuration granted via operations (SU-only bypass) + ✔ dual gate — op in operations but table READ perm false — search denied at CRUD level +[main/0] [info]: operation restart requires SU permissions. + ✔ no operations set — SU-only op still denied for non-SU user (no regression) +[main/0] [info]: No role permissions set (this is OK). + ✔ no operations set — normal data op works as before (no regression) + Test callOperationFunctionAsAwait + ✔ Nominal with no followup function, expect pass + ✔ Nominal with followup function, expect pass + ✔ Error in test function, expect exception & followup not run + ✔ Error in followup function, expect exception & was_run to be true + ✔ Pass invalid function, expect exception + ✔ Pass variable instead of function, expect exception + operationPermissions + OPERATION_PERMISSION_GROUPS + ✔ read_only contains expected read operations + ✔ read_only does not contain write operations + ✔ standard_user contains everything in read_only + ✔ standard_user contains data manipulation operations + ✔ standard_user does not contain token management operations + ✔ standard_user does not contain schema DDL operations + ✔ admin_read contains elevated read operations + ✔ admin_read does not contain data write operations + expandOperationsPerms() + ✔ expands a group name to its member operations + ✔ group does not include write operations + ✔ passes through an individual operation name directly + ✔ combines a group and individual operations into a union set + ✔ returns an empty set for an empty array + validateOperations() + ✔ returns null for valid individual operations + ✔ returns null for valid group names + ✔ returns null for a mix of operations and group names + ✔ returns null for an empty array + ✔ returns the invalid entry for an unknown operation + ✔ returns the first invalid entry when multiple are invalid + ✔ returns a stringified value for non-string entries + packageUtils + ✔ should export the HarperDB package.json as packageJson + ✔ should export the HarperDB package root as PACKAGE_ROOT + Test restartHdb scripts + - Test reload and then delete are called as expected + Test signalling module + ✔ Test signalSchemaChange happy path + ✔ Test signalSchemaChange sad path + ✔ Test signalUserChange happy path + ✔ Test signalUserChange sad path + Test bulkDeleteValidator module + ✔ Test table required returned + ✔ Test date required returned + ✔ Test invalid date returned + ✔ Test timestamp required returned + ✔ Test invalid timestamp returned + Test configValidator module + ✔ Test routesValidator validation bad values + ✔ Test routesValidator validation more bad values + ✔ Test validateRotationInterval invalid unit + ✔ Test validateRotationInterval invalid value + Test config schema in configValidator function + ✔ Test itc and localStudio in config_schema with bad values + ✔ Test logging in config_schema with bad values + ✔ Test operationsApi in config_schema with bad values + Test doesPathExist function + ✔ Test happy path, returns null + ✔ Test path doesnt exist, returns corresponding message + Test validateRotationMaxSize function + ✔ Test it returns a helper message if value isnt a number + Test setDefaultThreads function + ✔ Test happy path, correct info message is logged and correct number of processes returned + Test setDefaultRoot function + ✔ Test throws error if hdb_root is undefined + ✔ Test error throws if config param isnt real + ✔ Test that if customFunctions.root is undefined, one is created + ✔ Test that if logging.root is undefined, one is created + Test deleteValidator module + ✔ Test table required returned + ✔ Test hash_values required returned + ✔ Test hash_values invalid returned + Test fileLoadValidator module + Test validate module + ✔ should return table cant be blank error from dataObject + ✔ should return must be alpha numeric error on table + ✔ should return must be alpha numeric error on schema + ✔ should return cannot exceed 250 characters error on schema + ✔ should return cannot exceed 250 characters error on table + ✔ should return action is required to be be either insert, update or upsert + ✔ should return s3 cant be blank error from s3FileObject + ✔ should return s3.aws_access_key_id must be a string error from s3FileObject + ✔ should return s3.key cant be blank error from s3FileObject + ✔ should return s3.key must have valid ext error from s3FileObject + ✔ should return null w/ valid s3FileObject + ✔ should return validate `presence` error but NOT `type` error if both issues are caught + Test postValidateChecks function + ✔ should return an error from common_utils.checkGlobalSchemaTable + ✔ should return an error from accessSync + Test dataObject, urlObject and fileObject functions + ✔ should call validateObject and postValidateChecks with dataObject + ✔ should call validateObject and postValidateChecks with urlObject + ✔ should call validateObject and postValidateChecks with fileObject + Test insertValidator + ✔ Test validator happy path result is undefined + ✔ Test validator happy path result is undefined with number schema/table + ✔ Test validator returns missing table message + ✔ Test validator returns missing records message + ✔ Test validator returns no slashes or backticks message + ✔ Test validator returns not allowed to be empty message + ✔ Test validator returns too long message + ✔ Test validator returns invalid attribute name message with empty attribute + ✔ Test validator returns invalid attribute name message multiple + Test installValidator module + ✔ Test validation error returned all values bad + ✔ Test validation error returned some values bad + Test readLogValidator module + ✔ Test happy path validation returns undefined + ✔ Test from datetime invalid returned + ✔ Test until datetime invalid returned + ✔ Test level invalid returned + ✔ Test order invalid returned + ✔ Test limit invalid returned + ✔ Test start invalid returned + ✔ Test happy path validation with log name without extension returns undefined + ✔ Test log_name path traversal invalid returned + ✔ Test log_name with Windows backslash traversal invalid returned + ✔ Test log_name with non-.log extension invalid returned + ✔ Test log_name doesn't exist returned + Test role_validation module + test exposed module functions + ✔ addRoleValidation() - nominal case - call and return results from customValidate + ✔ alterRoleValidation() - nominal case - call and return results from customValidate + ✔ dropRoleValidation() - nominal case - call and return results from validateObject + customValidate() + ✔ NOMINAL - should return null for valid ADD_ROLE object + ✔ NOMINAL - should return null for valid SU ADD_ROLE object + ✔ NOMINAL - should return null for valid structure_user = true ADD_ROLE object + ✔ NOMINAL - should return error for invalid structure_user = ["dev", "blah"] ADD_ROLE object + ✔ NOMINAL - should return error for invalid structure_user = "wut" ADD_ROLE object + ✔ NOMINAL - should return null for valid structure_user = ["dev"] ADD_ROLE object + ✔ NOMINAL - should return null for valid ALTER_ROLE object + ✔ NOMINAL - should return null for valid SU ALTER_ROLE object + ✔ Invalid key in role_obj - expect error returned + ✔ Invalid keys in role_obj - expect error returned + ✔ Role key missing from role_obj - expect error returned + ✔ Permission key missing from role_obj - expect error returned + ✔ Role and permissions key missing from role_obj - expect error returned + ✔ Role id missing from alter_role_obj - expect error returned + ✔ Permission key missing from alter_role_obj - expect error returned + ✔ Id and permissions key missing from alter_role_obj - expect error returned + ✔ SU permission true w/ permissions - expect error thrown + ✔ Role_obj passed with no schema values - expect NO validation results + ✔ Role_obj passed with missing table READ perm - expect error returned + ✔ Role_obj passed with missing table INSERT perm - expect error returned + ✔ Role_obj passed with missing table UPDATE perm - expect error returned + ✔ Role_obj passed with missing table DELETE perm - expect error returned + ✔ Role_obj passed with missing table CRUD perms - expect error returned + ✔ Role_obj passed with missing table READ & INSERT perms - expect error returned + ✔ Role_obj passed with missing table READ & INSERT perms - expect error returned + ✔ Role_obj passed with missing table attribute READ perm - expect error returned + ✔ Role_obj passed with missing table attribute INSERT perm - expect error returned + ✔ Role_obj passed with missing table attribute UPDATE perm - expect error returned + ✔ Role_obj passed with missing table attribute name key/value - expect error returned + ✔ Role_obj passed with invalid table READ perm - expect error returned + ✔ Role_obj passed with invalid table INSERT perm - expect error returned + ✔ Role_obj passed with invalid table UPDATE perm - expect error returned + ✔ Role_obj passed with invalid table DELETE perm - expect error returned + ✔ Role_obj passed with invalid table CRUD perms - expect error returned + ✔ Role_obj passed with invalid table READ & INSERT perms - expect error returned + ✔ Role_obj passed with invalid READ & INSERT perm values across two tables - expect error returned + ✔ Role_obj passed with invalid table attribute READ perm - expect error returned + ✔ Role_obj passed with invalid table attribute INSERT perm - expect error returned + ✔ Role_obj passed with invalid table attribute UPDATE perm - expect error returned + ✔ Role_obj passed with invalid table attribute name key/value - expect error returned + ✔ Role_obj passed with mismatched table/table attribute CRUD perms - expect error returned + ✔ Role_obj passed with mutliple mismatched table/table attribute CRUD perms - expect error returned + ✔ Role_obj passed with random key value in table permission - expect error returned + ✔ Role_obj passed with random key value in table attr permission - expect error returned + operations permission validation + ✔ NOMINAL - operations with group name [read_only] returns null + ✔ NOMINAL - operations with individual valid op names returns null + ✔ NOMINAL - operations mixing group and individual ops returns null + ✔ NOMINAL - operations without schema perms (ops-only role) returns null + ✔ ERROR - operations as string (not array) returns validation error + ✔ ERROR - operations as boolean true (not array) returns validation error + ✔ ERROR - operations with invalid op name returns validation error + ✔ ERROR - operations with mix of valid and invalid ops — error for invalid only + ✔ ERROR - super_user role with operations rejected by SU constraint + test checkSchemaExists function + - test describeSchema throws an error + - test describeSchema fetches the schema + test checkSchemaTableExists + - test describeSchema returns message + - test describeTable errors + - test describeTable returns nothing + - test describeTable returns the table + statusValidator + ✔ should export status constants + ✔ should validate status schemas structure + ✔ should accept valid status values + ✔ should reject invalid status values + Test transactionLogValidator + ✔ Test readTransactionLogValidator + ✔ Test deleteTransactionLogsBeforeValidator + Test validateWrapper module + Test validateObject function + ✔ should return error when validate object is undefined + ✔ should return error when constraints object is undefined + ✔ should return null if nothing returned from validate method + ✔ should return validation message as error from validate method + Test validateObjectAsync function + ✔ should return error when validate object is undefined + ✔ should return error when constraints object is undefined + ✔ should return null if nothing returned from validate method + ✔ should return validation message as error from validate method + 1837 passing (27s) + 197 pending +Starting inspector on 127.0.0.1:9229 failed: address already in use +(node:8877) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit +(Use `node --trace-warnings ...` to show where the warning was created) +(node:8877) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unhandledRejection listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit +[main/0] [error]: I am a log +[main/0] [error]: Error: Could not load component 'dataLoader' for application 'error-component' due to: DataLoader failed to initialize + at Context. (/home/kzyp/dev/ts-fixes/unitTests/components/componentLoader.test.js:223:61) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate. (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) +[main/0] [warn] [harper]: Configuration file /tmp/harper-test-components-rrfWNS/error-component/harperdb-config.yaml was deleted. Reverting to default configuration. Recreate it to restore the options watcher. +[main/0] [warn] [harper]: Configuration file /tmp/harper-test-components-rrfWNS/test-component/harperdb-config.yaml was deleted. Reverting to default configuration. Recreate it to restore the options watcher. +[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js +(node:742459) ExperimentalWarning: VM Modules is an experimental feature and might change at any time +[main/0] [warn]: Logging from testJSWithDeps/resources.js +[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js +[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js +[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js +[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js +[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js +[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js +[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js +[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js +[main/0] [warn] [test-component]: Configuration file /tmp/harper.unit-test.options-watcher-O30wyP/config.yaml was deleted. Reverting to default configuration. Recreate it to restore the options watcher. +[main/0] [warn] [jsResource]: Configuration file /tmp/harper.unit-test.options-watcher-yttI3W/config.yaml was deleted. Reverting to default configuration. Recreate it to restore the options watcher. +[main/0] [error] [componentStatus.crossThread]: ITC failure during component status collection: Inter-thread communication failed during sendItcEvent: ITC failure +[main/0] [warn] [env-config]: Failed to load config state file, starting fresh: /tmp/hdb-edge-test-1778624829440/backup/.harper-config-state.json: Expected property name or '}' in JSON at position 1 (line 1 column 2) +[main/0] [warn] [env-config]: Failed to parse HARPER_SET_CONFIG for arg filtering SyntaxError: Unexpected token 'o', "not valid json" is not valid JSON + at JSON.parse () + at filterArgsAgainstRuntimeConfig (/home/kzyp/dev/ts-fixes/config/harperConfigEnvVars.ts:133:20) + at Context. (/home/kzyp/dev/ts-fixes/unitTests/config/harperConfigEnvVars-filter.test.js:170:19) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) +[main/0] [error]: database 'imnotaschema' does not exist +[main/0] [error]: database 'imnotaschema' does not exist +[main/0] [error]: path is missing. +[main/0] [error]: format invalid. must be one of the following values: json, csv +[main/0] [error]: path './zaphodbeeblebrox' does not exist +[main/0] [error]: path './harperdb.js' does not exist +[main/0] [error]: access to path './' is denied +[main/0] [error]: Oh no an error +[main/0] [error]: Error: Error getting records + at Context. (/home/kzyp/dev/ts-fixes/unitTests/dataLayer/export.test.js:618:28) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) +[main/0] [error]: Operation range_search is not support by export. +[main/0] [error]: AST statement for SQL select process cannot be empty +[main/0] [error]: TypeError: Cannot use 'in' operator to search for 'value' in undefined + at (/home/kzyp/dev/ts-fixes/dataLayer/update.js:65:15) + at Array.forEach () + at createUpdateRecord (/home/kzyp/dev/ts-fixes/dataLayer/update.js:64:11) + at Object.assertErrorSync (/home/kzyp/dev/ts-fixes/unitTests/testUtils.js:462:22) + at Context. (/home/kzyp/dev/ts-fixes/unitTests/dataLayer/update.test.js:361:14) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) +[main/0] [warn]: ClientError: Cannot complete request: User is inactive + at findAndValidateUser (/home/kzyp/dev/ts-fixes/security/user.ts:402:9) + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:214:46) { + statusCode: 401 +} +[main/0] [warn]: JsonWebTokenError: jwt malformed + at module.exports [as verify] (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:70:17) + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) +[main/0] [warn]: TokenExpiredError: jwt expired + at /home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:190:21 + at getSecret (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:97:14) + at module.exports [as verify] (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:101:10) + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) { + expiredAt: 2026-05-12T22:27:12.000Z +} +[main/0] [warn]: ClientError: Cannot complete request: User is inactive + at findAndValidateUser (/home/kzyp/dev/ts-fixes/security/user.ts:402:9) + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:214:46) { + statusCode: 401 +} +[main/0] [warn]: Error: Invalid token + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:216:10) +[main/0] [warn]: JsonWebTokenError: jwt malformed + at module.exports [as verify] (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:70:17) + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) +[main/0] [warn]: TokenExpiredError: jwt expired + at /home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:190:21 + at getSecret (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:97:14) + at module.exports [as verify] (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:101:10) + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) { + expiredAt: 2026-05-12T22:27:12.000Z +} +[main/0] [error] [auth-event] [authentication]: Certificate verification failed: revoked for revoked-client +[main/0] [error] [auth-event] [authentication]: Certificate verification failed: unknown for unknown-client +[main/0] [warn] [crl-verification]: CRL data is stale or missing, treating as unknown +[main/0] [warn] [crl-verification]: CRL data is stale or missing, treating as unknown +[main/0] [warn] [cert-verification]: CRL verification failed: Error: CRL download failed +[main/0] [warn] [cert-verification]: OCSP verification failed: Error: OCSP request failed +[main/0] [warn] [cert-verification]: CRL verification failed: Error: CRL failed +[main/0] [warn] [cert-verification]: OCSP verification failed: Error: OCSP failed +[main/0] [warn] [cert-verification]: CRL verification failed: Error: CRL failed +[main/0] [warn] [cert-verification]: OCSP verification failed: Error: OCSP failed +[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:7f1577f881c46b14de7409500ff6edd2f6a815fbfa7fb7be234ef9137f956786 for hdb_certificate_cache + at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) +[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) +[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:a9680c51e2d4f3f69810aa5536788b71d8458b297d4f33333b80b17e790fbb0c for hdb_certificate_cache + at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) +[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:a9680c51e2d4f3f69810aa5536788b71d8458b297d4f33333b80b17e790fbb0c for hdb_certificate_cache + at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) +[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) +[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:c21cff9273dd4eaa2401904dec940504b6c0cdbad0d6f99422801a97f6148344 for hdb_certificate_cache + at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) +[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:c21cff9273dd4eaa2401904dec940504b6c0cdbad0d6f99422801a97f6148344 for hdb_certificate_cache + at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) +[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) +[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:c21cff9273dd4eaa2401904dec940504b6c0cdbad0d6f99422801a97f6148344 for hdb_certificate_cache + at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) +[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) +[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:c21cff9273dd4eaa2401904dec940504b6c0cdbad0d6f99422801a97f6148344 for hdb_certificate_cache + at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) +[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) +[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:c21cff9273dd4eaa2401904dec940504b6c0cdbad0d6f99422801a97f6148344 for hdb_certificate_cache + at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) +[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) +[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of null (reading 'toString') + at bufferToPem (/home/kzyp/dev/ts-fixes/security/certificateVerification/verificationUtils.ts:21:24) + at Object.verifyOCSP (/home/kzyp/dev/ts-fixes/security/certificateVerification/ocspVerification.ts:60:33) + at Context. (/home/kzyp/dev/ts-fixes/unitTests/security/certificateVerification/ocspVerification.test.js:189:37) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) +[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) +[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:a694dd2793a628e1eb2bf1658a1683498244b2b62188cff657442d634d276ac2 for hdb_certificate_cache + at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) +[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) +[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:c21cff9273dd4eaa2401904dec940504b6c0cdbad0d6f99422801a97f6148344 for hdb_certificate_cache + at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) + at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) +[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) +(node:742459) ExperimentalWarning: The Ed448 Web Crypto API algorithm is an experimental feature and might change at any time +[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: "failureMode" must be one of [fail-open, fail-closed] +[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: "failureMode" must be one of [fail-open, fail-closed] +[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: OCSP timeout must be at least 1000ms (1 second) +[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: CRL cacheTtl must be at least 1000ms (1 second) +[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: OCSP errorCacheTtl must be at least 1000ms (1 second) +[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: CRL cacheTtl must be at least 1000ms (1 second) +[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: OCSP cacheTtl must be at least 1000ms (1 second) +[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: CRL gracePeriod must be at least 0ms +[main/0] [warn] [cert-verification-utils]: Failed to extract revocation URLs: InvalidCharacterError: Invalid character +[main/0] [warn] [cert-verification-utils]: Failed to extract CRL distribution points: InvalidCharacterError: Invalid character +[main/0] [error] [cert-verification-utils]: Failed to extract OCSP URLs: InvalidCharacterError: Invalid character +[main/0] [error] [cert-verification-utils]: Failed to extract serial number: InvalidCharacterError: Invalid character +[main/0] [error] [cert-verification-utils]: Failed to extract issuer key ID: InvalidCharacterError: Invalid character +[main/0] [error] [tls]: Error applying TLS for Unit Test Error: error:05800074:x509 certificate routines::key values mismatch + at Object.tls.createSecureContext (/home/kzyp/dev/ts-fixes/security/keys.js:692:14) + at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:789:32) + at (/home/kzyp/dev/ts-fixes/security/keys.js:854:4) + at new Promise () + at SNICallback.SNICallback.initialize (/home/kzyp/dev/ts-fixes/security/keys.js:732:31) + at Object.getReplicationCert (/home/kzyp/dev/ts-fixes/security/keys.js:133:20) + at Context. (/home/kzyp/dev/ts-fixes/unitTests/security/keys.test.js:116:31) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) { + library: 'x509 certificate routines', + reason: 'key values mismatch', + code: 'ERR_OSSL_X509_KEY_VALUES_MISMATCH' +} +[main/0] [error] [tls]: Error applying TLS for valid-test-cert Error: ENOENT: no such file or directory, open '/home/kzyp/harper/keys/test.pem' + at Object.readFileSync (node:fs:440:20) + at getPrivateKeyByName (/home/kzyp/dev/ts-fixes/security/keys.js:890:13) + at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:763:28) + at (/home/kzyp/dev/ts-fixes/security/keys.js:854:4) + at new Promise () + at SNICallback.SNICallback.initialize (/home/kzyp/dev/ts-fixes/security/keys.js:732:31) + at Object.getReplicationCert (/home/kzyp/dev/ts-fixes/security/keys.js:133:20) + at Context. (/home/kzyp/dev/ts-fixes/unitTests/security/keys.test.js:116:31) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) { + errno: -2, + code: 'ENOENT', + syscall: 'open', + path: '/home/kzyp/harper/keys/test.pem' +} +[main/0] [error] [tls]: Error applying TLS for Unit Test Error: error:05800074:x509 certificate routines::key values mismatch + at Object.tls.createSecureContext (/home/kzyp/dev/ts-fixes/security/keys.js:692:14) + at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:789:32) + at (/home/kzyp/dev/ts-fixes/security/keys.js:854:4) + at new Promise () + at SNICallback.SNICallback.initialize (/home/kzyp/dev/ts-fixes/security/keys.js:732:31) + at getReplicationCert (/home/kzyp/dev/ts-fixes/security/keys.js:133:20) + at Object.getReplicationCertAuth (/home/kzyp/dev/ts-fixes/security/keys.js:145:25) + at Context. (/home/kzyp/dev/ts-fixes/unitTests/security/keys.test.js:123:25) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) { + library: 'x509 certificate routines', + reason: 'key values mismatch', + code: 'ERR_OSSL_X509_KEY_VALUES_MISMATCH' +} +[main/0] [error] [tls]: Error applying TLS for valid-test-cert Error: ENOENT: no such file or directory, open '/home/kzyp/harper/keys/test.pem' + at Object.readFileSync (node:fs:440:20) + at getPrivateKeyByName (/home/kzyp/dev/ts-fixes/security/keys.js:890:13) + at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:763:28) + at (/home/kzyp/dev/ts-fixes/security/keys.js:854:4) + at new Promise () + at SNICallback.SNICallback.initialize (/home/kzyp/dev/ts-fixes/security/keys.js:732:31) + at getReplicationCert (/home/kzyp/dev/ts-fixes/security/keys.js:133:20) + at Object.getReplicationCertAuth (/home/kzyp/dev/ts-fixes/security/keys.js:145:25) + at Context. (/home/kzyp/dev/ts-fixes/unitTests/security/keys.test.js:123:25) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) { + errno: -2, + code: 'ENOENT', + syscall: 'open', + path: '/home/kzyp/harper/keys/test.pem' +} +[main/0] [error] [tls]: Failed to parse certificate for corrupted-base64-padding: error:0680009B:asn1 encoding routines::too long +[main/0] [error] [tls]: Failed to parse certificate for truncated-cert: error:04800066:PEM routines::bad end line +[main/0] [error] [tls]: Failed to parse certificate for invalid-chars: error:04800064:PEM routines::bad base64 decode +[main/0] [error] [tls]: Failed to parse certificate for missing-end-marker: error:04800066:PEM routines::bad end line +[main/0] [error] [tls]: Failed to parse certificate for empty-cert: error:068000A8:asn1 encoding routines::wrong tag +[main/0] [error] [tls]: Failed to parse certificate for extra-padding: error:04800064:PEM routines::bad base64 decode +[main/0] [error] [tls]: Failed to parse certificate for illegal-padding: error:0680009B:asn1 encoding routines::too long +[main/0] [error] [tls]: Failed to parse certificate for malformed-asn1: error:0680009B:asn1 encoding routines::too long +[main/0] [error] [tls]: Failed to parse certificate for broken-der: error:068000A8:asn1 encoding routines::wrong tag +[main/0] [error] [tls]: Failed to parse certificate for cert-corrupted-during-transfer: error:04800066:PEM routines::bad end line +[main/0] [error] [tls]: Failed to parse certificate for cert-with-wrong-line-endings: error:0480006C:PEM routines::no start line +[main/0] [error] [tls]: Failed to parse certificate for cert-with-encoding-issues: error:0480006C:PEM routines::no start line +[main/0] [error]: [Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPass'] { + errno: -2, + code: 'ENOENT', + syscall: 'open', + path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPass' +} +[main/0] [error]: [Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPrivate.key'] { + errno: -2, + code: 'ENOENT', + syscall: 'open', + path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPrivate.key' +} +[main/0] [error]: [Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPublic.key'] { + errno: -2, + code: 'ENOENT', + syscall: 'open', + path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPublic.key' +} +[main/0] [error]: TypeError: Cannot read properties of undefined (reading 'bypass_auth') + at Object.createTokens (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:101:43) + at Context. (/home/kzyp/dev/ts-fixes/unitTests/security/tokenAuthentication.test.js:279:30) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at cbHookRun (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:592:7) + at done (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:310:5) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:389:7) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:551:10) + at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) +[main/0] [error]: Error: bad credentials + at /home/kzyp/dev/ts-fixes/unitTests/security/tokenAuthentication.test.js:315:10 + at Object.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/behavior.js:177:32) + at functionStub (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/stub.js:44:43) + at findAndValidateUser.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) + at findAndValidateUser (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:275:26) + at Object.createTokens (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:108:35) + at Context. (/home/kzyp/dev/ts-fixes/unitTests/security/tokenAuthentication.test.js:319:30) +[main/0] [error]: [Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPass'] { + errno: -2, + code: 'ENOENT', + syscall: 'open', + path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPass' +} +[main/0] [warn]: ClientError: Cannot complete request: User is inactive + at findAndValidateUser (/home/kzyp/dev/ts-fixes/security/user.ts:402:9) + at findAndValidateUser.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) + at findAndValidateUser (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:275:26) + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:214:46) { + statusCode: 401 +} +[main/0] [warn]: JsonWebTokenError: jwt malformed + at module.exports (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:70:17) + at Function.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) + at Object.verify (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:285:26) + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) +[main/0] [warn]: TokenExpiredError: jwt expired + at /home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:190:21 + at getSecret (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:97:14) + at module.exports (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:101:10) + at Function.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) + at Object.verify (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:285:26) + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) { + expiredAt: 2026-05-12T22:27:13.000Z +} +[main/0] [warn]: ClientError: Cannot complete request: User is inactive + at findAndValidateUser (/home/kzyp/dev/ts-fixes/security/user.ts:402:9) + at findAndValidateUser.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) + at findAndValidateUser (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:275:26) + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:214:46) { + statusCode: 401 +} +[main/0] [warn]: Error: Invalid token + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:216:10) + at async Context. (/home/kzyp/dev/ts-fixes/unitTests/security/tokenAuthentication.test.js:661:11) +[main/0] [warn]: JsonWebTokenError: jwt malformed + at module.exports (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:70:17) + at Function.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) + at Object.verify (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:285:26) + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) +[main/0] [warn]: TokenExpiredError: jwt expired + at /home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:190:21 + at getSecret (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:97:14) + at module.exports (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:101:10) + at Function.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) + at Object.verify (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:285:26) + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) { + expiredAt: 2026-05-12T22:27:13.000Z +} +[main/0] [warn]: ClientError: Cannot complete request: User is inactive + at findAndValidateUser (/home/kzyp/dev/ts-fixes/security/user.ts:402:9) + at findAndValidateUser.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) + at findAndValidateUser (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:275:26) + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:214:46) { + statusCode: 401 +} +[main/0] [warn]: Error: Invalid token + at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:216:10) + at async Object.refreshOperationToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:175:2) + at async Context. (/home/kzyp/dev/ts-fixes/unitTests/security/tokenAuthentication.test.js:862:12) +[main/0] [error] [tls]: Error applying TLS for Unit Test Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/dev/ts-fixes/unitTests/envDir/keys-test/test-private-key.pem' + at Object.readFileSync (node:fs:440:20) + at getPrivateKeyByName (/home/kzyp/dev/ts-fixes/security/keys.js:890:13) + at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:763:28) + at Timeout._onTimeout (/home/kzyp/dev/ts-fixes/security/keys.js:851:38) + at listOnTimeout (node:internal/timers:608:17) + at process.processTimers (node:internal/timers:543:7) { + errno: -2, + code: 'ENOENT', + syscall: 'open', + path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/dev/ts-fixes/unitTests/envDir/keys-test/test-private-key.pem' +} +[main/0] [error] [tls]: Error applying TLS for valid-test-cert Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/test.pem' + at Object.readFileSync (node:fs:440:20) + at getPrivateKeyByName (/home/kzyp/dev/ts-fixes/security/keys.js:890:13) + at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:763:28) + at Timeout._onTimeout (/home/kzyp/dev/ts-fixes/security/keys.js:851:38) + at listOnTimeout (node:internal/timers:608:17) + at process.processTimers (node:internal/timers:543:7) { + errno: -2, + code: 'ENOENT', + syscall: 'open', + path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/test.pem' +} +[main/0] [error] [tls]: Error applying TLS for Unit Test Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/dev/ts-fixes/unitTests/envDir/keys-test/test-private-key.pem' + at Object.readFileSync (node:fs:440:20) + at getPrivateKeyByName (/home/kzyp/dev/ts-fixes/security/keys.js:890:13) + at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:763:28) + at Timeout._onTimeout (/home/kzyp/dev/ts-fixes/security/keys.js:851:38) + at listOnTimeout (node:internal/timers:608:17) + at process.processTimers (node:internal/timers:543:7) { + errno: -2, + code: 'ENOENT', + syscall: 'open', + path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/dev/ts-fixes/unitTests/envDir/keys-test/test-private-key.pem' +} +[main/0] [error] [tls]: Error applying TLS for valid-test-cert Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/test.pem' + at Object.readFileSync (node:fs:440:20) + at getPrivateKeyByName (/home/kzyp/dev/ts-fixes/security/keys.js:890:13) + at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:763:28) + at Timeout._onTimeout (/home/kzyp/dev/ts-fixes/security/keys.js:851:38) + at listOnTimeout (node:internal/timers:608:17) + at process.processTimers (node:internal/timers:543:7) { + errno: -2, + code: 'ENOENT', + syscall: 'open', + path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/test.pem' +} +[main/0] [error]: There is an error: Sinon-provided There is an error + at fake.exceptionCreator (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/default-behaviors.js:18:34) + at Object.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/behavior.js:165:35) + at Object.functionStub (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/stub.js:44:43) + at existsSync.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) + at Object.existsSync (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:270:26) + at checkProjectExists (/home/kzyp/dev/ts-fixes/components/operationsValidation.js:40:11) + at Context. (/home/kzyp/dev/ts-fixes/unitTests/server/fastifyRoutes/operationsValidation.test.js:53:19) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) +[main/0] [error]: There is an error: Sinon-provided There is an error + at fake.exceptionCreator (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/default-behaviors.js:18:34) + at Object.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/behavior.js:165:35) + at Object.functionStub (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/stub.js:44:43) + at existsSync.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) + at Object.existsSync (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:270:26) + at checkFileExists (/home/kzyp/dev/ts-fixes/components/operationsValidation.js:76:11) + at Context. (/home/kzyp/dev/ts-fixes/unitTests/server/fastifyRoutes/operationsValidation.test.js:85:19) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) +[main/0] [error]: There was an error running csvDataLoad job with id 23446155-1788-43ad-95a5-9fbc55d1bd51 - BAD UPDATE +[main/0] [error]: There was an error running csvDataLoad job with id null - invalid ID passed to updateJob +[main/0] [error]: Unable to update job with id null +[main/0] [error]: There was an error searching jobs by date: Error: Oh Noes! +[main/0] [error]: There was an error inserting a new job: Error: error with search by value +[main/0] [error]: There was an error inserting a new job: Error: error with search by value +[main/0] [error]: There was an error inserting a job for job type: csv_file_load -- Error: error inserting +[main/0] [error]: there was a problem searching for jobs from date 2017-02-01 to date 2018-07-07 Error: error with sql search +[main/0] [error]: There was an error searching for a job by id: [object Object] Error: error searching +[main/0] [error] [operation]: Error when selecting operation function - Error: Operation 'blah' not found +[main/0] [error]: Error running storage reclamation handlers Error: Disk error + at Context. (/home/kzyp/dev/ts-fixes/unitTests/server/storageReclamation.test.js:249:48) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate. (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) +[main/0] [error]: Error running storage reclamation handlers Error: Handler error + at Context. (/home/kzyp/dev/ts-fixes/unitTests/server/storageReclamation.test.js:266:65) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate. (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) +[main/0] [error]: Error running storage reclamation handlers Error: Disk error + at Context. (/home/kzyp/dev/ts-fixes/unitTests/server/storageReclamation.test.js:379:49) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate. (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) +[main/0] [warn]: Unable to locate 'hdb.pid' file, try stopping and starting Harper. This could be because Harper is not running. +[main/0] [warn]: Unable to locate 'hdb.pid' file, try stopping and starting Harper. This could be because Harper is not running. +[main/0] [warn]: Unable to locate 'hdb.pid' file, try stopping and starting Harper. This could be because Harper is not running. +[main/0] [warn]: Test of the global logger +[main/0] [warn] [test-logging-component]: Test of an application logger going to the external log +[main/0] [error]: Error calling operation: test_func_exception +[main/0] [error]: Error: This is bad! + at test_func_exception (/home/kzyp/dev/ts-fixes/unitTests/utility/OperationFunctionCaller.test.js:47:10) + at Object.callOperationFunctionAsAwait (/home/kzyp/dev/ts-fixes/utility/OperationFunctionCaller.js:20:18) + at Context. (/home/kzyp/dev/ts-fixes/unitTests/utility/OperationFunctionCaller.test.js:52:31) + at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) + at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) + at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) + at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 + at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) + at Immediate. (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) + at process.processImmediate (node:internal/timers:505:21) +[main/0] [error]: Error calling operation: test_function_as_callback +[main/0] [error]: Error: This is bad! + at followup_func_exception (/home/kzyp/dev/ts-fixes/unitTests/utility/OperationFunctionCaller.test.js:63:10) + at Object.callOperationFunctionAsAwait (/home/kzyp/dev/ts-fixes/utility/OperationFunctionCaller.js:24:10) + at async Context. (/home/kzyp/dev/ts-fixes/unitTests/utility/OperationFunctionCaller.test.js:68:10) +[main/0] [error]: ITC event message missing 'originator' property +[main/0] [error]: ITC event message missing 'originator' property +[main/0] [error]: ITC event message missing 'originator' property +[main/0] [error]: ITC event message missing 'originator' property diff --git a/unitTests/security/keys.test.js b/unitTests/security/keys.test.js index ebaae0496..64547df92 100644 --- a/unitTests/security/keys.test.js +++ b/unitTests/security/keys.test.js @@ -71,10 +71,13 @@ describe('Test keys module', () => { }); }); - afterEach(async () => { + after(async () => { sandbox.restore(); await fs.remove(test_dir); }); + afterEach(() => { + sandbox.restore(); + }); it('Test loadCertificates loads certs from config file', async () => { // Load loadCertificates is called in the before method because other tests rely on it From 4d1a45e11c1df0e07d21f72e2c131f82b895028c Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Tue, 12 May 2026 16:41:50 -0600 Subject: [PATCH 2/2] chore: clean up test artifacts and run formatter --- config/configUtils.js | 2 +- run_test.js | 11 - test_output.txt | 3283 ----------------------------------------- 3 files changed, 1 insertion(+), 3295 deletions(-) delete mode 100644 run_test.js delete mode 100644 test_output.txt diff --git a/config/configUtils.js b/config/configUtils.js index c676a38b6..10bea5068 100644 --- a/config/configUtils.js +++ b/config/configUtils.js @@ -806,7 +806,7 @@ function readConfigFile() { try { const p = getConfigFilePath(null); if (fs.existsSync(p)) return parseYamlDoc(p).toJSON(); - } catch(e) {} + } catch (e) {} } const bootPropsFilePath = hdbUtils.getPropsFilePath(); try { diff --git a/run_test.js b/run_test.js deleted file mode 100644 index ec6a2b7d9..000000000 --- a/run_test.js +++ /dev/null @@ -1,11 +0,0 @@ -const testUtils = require('./unitTests/testUtils.js'); -testUtils.preTestPrep(); -const keys = require('./dist/security/keys.js'); - -async function go() { - const all_certs = await keys.listCertificates(); - for (const c of all_certs) { - console.log('Cert:', c.name, 'issuer:', c.details?.issuer); - } -} -go(); diff --git a/test_output.txt b/test_output.txt deleted file mode 100644 index e40aa19d2..000000000 --- a/test_output.txt +++ /dev/null @@ -1,3283 +0,0 @@ -> mocha 'unitTests/**/*test.*js' --exclude 'unitTests/apiTests/**/*' --exclude 'unitTests/dataLayer/harperBridge/**/*' --exclude 'unitTests/resources/**/*' -Current directory /home/kzyp/dev/ts-fixes/bin - test CLI operations - - Test describe_table returns the table - - Test describe_all when the table doesnt exist - - Test SQL query - - Test search_by_id returns a record - Test install module -Cert: Harper-Certificate-Authority issuer: CN=Harper-Certificate-Authority C=USA ST=Colorado L=Denver O=Harper-Certificate-Authority -Cert: Harper-Certificate-Authority-localhost issuer: CN=Harper-Certificate-Authority-localhost C=USA ST=Colorado L=Denver O=HarperDB\, Inc. -Cert: Unit Test issuer: CN=Unit Test CA C=USA ST=Colorado L=Denver O=Unit Test CA -Cert: Unit Test CA issuer: CN=Unit Test CA C=USA ST=Colorado L=Denver O=Unit Test CA -Cert: localhost issuer: CN=Harper-Certificate-Authority-localhost C=USA ST=Colorado L=Denver O=HarperDB\, Inc. -Cert: valid-test-cert issuer: CN=Unit Test CA C=USA ST=Colorado L=Denver O=Unit Test CA - ✔ Test error from installer is handled correctly - Test status module - ✔ Test status is returned as expected - ✔ Test status when nothing is running - Test upgrade.js - upgrade() - - Nominal case - upgrade runs to completion w/o update obj passed in as arg - - Nominal case - upgrade runs to completion w update obj passed in as arg - - Should exit process if no upgrade obj arg is passed AND getVersionUpdateInfo returns null - i.e. versions are current - - Should exit process if no upgrade obj arg is passed AND there is an issue getting the current version - - Should exit process if upgradePrompt returns false - - Should exit process with code 1 if upgradePrompt throws an exception - - Should exit process with code 1 if boot prop file does not exist - i.e. HDB has not been installed - - Should exit process with code 1 if settings file does not exist - i.e. HDB has not been installed - - Test error from runUpgrade is handled - runUpgrade() - ✔ Nominal case - ✔ Should catch and throw exception from runUpgradeDirectives - ✔ Should catch an exception from insertHdbUpgradeInfo and continue - i.e. NOT rethrow - Test printToLogAndConsole - ✔ Should log to console and final logger - Component - with singular pattern - with files as a string - ✔ should instantiate without any other options - ✔ should instantiate with urlPath option - ✔ should throw an error if the pattern contains ".." - ✔ should throw an error if the pattern starts with "/" - with files as an object - ✔ should instantiate without any other options - ✔ should instantiate with urlPath option - ✔ should instantiate with files.only option set to files - ✔ should instantiate with files.only option set to directories - ✔ should instantiate with files.ignore option set to a string - ✔ should throw an error if the pattern contains ".." - ✔ should throw an error if the pattern starts with "/" - with multiple patterns - with files as a string - ✔ should instantiate without any other options - ✔ should instantiate with urlPath option - ✔ should throw an error if any pattern contains ".." - ✔ should throw an error if any pattern starts with "/" - with files as an object - ✔ should instantiate without any other options - ✔ should instantiate with urlPath option - ✔ should instantiate with files.only option set to files - ✔ should instantiate with files.only option set to directories - ✔ should instantiate with files.ignore option set to a string - ✔ should throw an error if any pattern contains ".." - ✔ should throw an error if any pattern starts with "/" - ComponentLoader Status Integration - Basic component status tracking - ✔ should initialize loading status for non-root components - ✔ should track loading for components with trusted loaders - - should mark component as failed when it loads no functionality - Component status verification - ✔ should properly set status in registry after successful load - ✔ should handle component loading errors gracefully - ComponentV1 - with a valid directory structure - ✔ should warn about leading '/' and resolve it relative to root - ✔ should warn about leading '/' and resolve it relative to root with glob star - ✔ should prepend urlPath - ✔ should warn about deprecated 'path' option, and handle it as 'urlPath' - ✔ should resolve glob pattern `/*` correctly - ✔ should resolve glob pattern `/**/*` correctly - ✔ should handle `root` option when it matches the file pattern - ✔ should resolve all files and directories within the specified directory glob - ✔ should resolve a specific file - ✔ should resolve a specific file with `./` - ✔ should resolve a specific directory - ✔ should ignore specified files - ✔ should return early if root handleDirectory returns true - ✔ should return early if root setupDirectory returns true - with pattern '*' - ✔ should resolve correctly with configuration defaults - ✔ should resolve correctly with configuration `only: 'all'` - ✔ should resolve correctly with configuration `only: 'files'` - ✔ should resolve correctly with configuration `only: 'directories'` - ✔ should call setup methods instead of handle when in main thread - ✔ should warn about deprecated `root` option and handle it appropriately - with pattern '**/*' - ✔ should resolve correctly with configuration defaults - ✔ should resolve correctly with configuration `only: 'all'` - ✔ should resolve correctly with configuration `only: 'files'` - ✔ should resolve correctly with configuration `only: 'directories'` - options validation - ✔ should throw an error if files is not a non-empty string, array of non-empty strings, or an object - ✔ should throw an error if files.source is invalid - ✔ should throw an error if files.only is invalid - ✔ should throw an error if files.ignore is invalid - ✔ should throw an error if root is invalid - ✔ should throw an error if path is invalid - ✔ should throw an error if urlPath is invalid - ✔ should throw an error if the files option contains `..` as a string - ✔ should throw an error if the files option contains `..` as an array - ✔ should throw an error if the files.source option contains `..` as a string - ✔ should throw an error if the files.source option contains `..` as an array - deriveCommonPatternBase - ✔ should derive common pattern base from ["web/index.html","web/style.css"] - ✔ should derive common pattern base from ["web","static"] - ✔ should derive common pattern base from ["web/static/foo","web/static/bar"] - ✔ should derive common pattern base from ["a/b/c/d","a/b/c/e","a/b/f"] - ✔ should derive common pattern base from ["web"] - ✔ should derive common pattern base from ["web/index.html"] - ✔ should derive common pattern base from ["index.html","style.css"] - deriveGlobOptions - ✔ should handle files as a string - ✔ should handle files as an array of strings - ✔ should handle files as an object with source and ignore - ✔ should handle files as an object with only set to "files" - ✔ should handle files as an object with only set to "directories" - ✔ should handle files as an object with no ignore or only properties - EntryHandler - ✔ should instantiate and emit events for adding and removing files and directories (111ms) - ✔ should await ready event via `ready` property - ✔ should emit file change events - ✔ should handle updating the config (202ms) - ✔ should resolve the correct urlPath for files - ✔ should resolve the correct urlPath for files with `./` - ✔ should avoid matching within an excluded base - ✔ should correctly resolve similar url paths for directories - ✔ should correctly resolve similar url paths for files - ✔ should emit all file events before ready resolves - Global Variable Isolation in testJSWithDeps -Verifying we can access console.log in transitive module in application -Verifying we can access console.log in application - ✔ should isolate global variables when loading the component (92ms) -Verifying we can access console.log in transitive module in application -Verifying we can access console.log in application - ✔ should be able to use VM loading with current context and load component -Verifying we can access console.log in transitive module in application -Verifying we can access console.log in application - ✔ should be able to load component with package dependency containment (52ms) -Verifying we can access console.log in transitive module in application -Verifying we can access console.log in application - ✔ should be able to load component with SES compartment (170ms) -Verifying we can access console.log in transitive module in application -Verifying we can access console.log in application - ✔ should enforce process spawning restrictions -Verifying we can access console.log in transitive module in application -Verifying we can access console.log in application - ✔ should allow fork with allowed commands -Verifying we can access console.log in transitive module in application -Verifying we can access console.log in application - ✔ should reuse existing processes with same name (1012ms) -Verifying we can access console.log in transitive module in application -Verifying we can access console.log in application - ✔ should restart process when version is upgraded -Verifying we can access console.log in transitive module in application -Verifying we can access console.log in application - ✔ should handle ESM circular dependencies correctly - ✔ should handle CJS circular dependencies correctly - ✔ should load packages that depend on harper through VM - ✔ should load packages without harper dependency natively -Verifying we can access console.log in transitive module in application -Verifying we can access console.log in application - ✔ should handle CJS modules from node_modules correctly - OptionsWatcher - ✔ should instantiate with a file path and emit a ready event - ✔ should instantiate and emit ready even if the file does not exist - ✔ should await ready event via `ready()` method - ✔ should correctly return the initial configuration - ✔ should continue to watch if file is removed and recreated (109ms) - ✔ should emit a remove event if the respective name is deleted - ✔ should handle default config resolution (106ms) - change event from modifying underlying config file - ✔ should handle updating an array to an object and vice versa - with top-level primitive (string, number, boolean, null) and array values - ✔ should handle updating - ✔ should handle creating - ✔ should handle deleting - with nested primitives (string, number, boolean, null) and array values - ✔ should handle updating - ✔ should handle creating - ✔ should handle deleting - with top-level object values - ✔ should handle updating - ✔ should handle creating - ✔ should handle deleting - with nested object values - ✔ should handle updating - ✔ should handle creating - ✔ should handle deleting - change event when root config value is a scalar - ✔ should handle updating from scalar to scalar without throwing - ✔ should handle updating from scalar to object without throwing - ✔ should handle updating from object to scalar without throwing - requestRestart - ✔ should update the shared buffer - resolveBaseURLPath - ✔ should resolve to / when no path, or an empty path is provided - ✔ should resolve to `//` when a path is provided without a leading `.` character - ✔ should resolve `.` to `` - ✔ should error when path starts with `..` - Scope - ✔ should create a default entry handler (103ms) - ✔ should create a default entry handler with urlPath (104ms) - ✔ should call requestRestart if no entry handler is provided - ✔ should call requestRestart if no options handler is provided (102ms) - ✔ should emit error for missing default entry handler - ✔ should support custom entry handlers - ✔ should support synchronous handleEntry with event-based initial load tracking - Component Status Public API - statusForComponent() API - ✔ should provide fluent interface for status reporting - ✔ should report healthy status - ✔ should report healthy status without message - ✔ should report warning status - ✔ should report error status with Error object - ✔ should report loading status - ✔ should report loading status with default message - ✔ should report unknown status - ✔ should reuse builder instances - ✔ should return undefined for non-existent component - lifecycle API - ✔ should handle component loading lifecycle - ✔ should handle component failure - reset API - ✔ should clear all component statuses - STATUS constants - ✔ should expose status level constants - ComponentStatus - constructor - ✔ should create a ComponentStatus with all parameters - ✔ should create a ComponentStatus without optional parameters - ✔ should accept string as error - updateStatus - ✔ should update status and message - ✔ should clear error when status is not ERROR - ✔ should keep error when status remains ERROR - ✔ should update without message - markHealthy - ✔ should set status to healthy with custom message - ✔ should set status to healthy with default message - ✔ should clear error when marking healthy - markError - ✔ should set status to error with Error object - ✔ should set status to error with string error - ✔ should use error message when no custom message provided - markWarning - ✔ should set status to warning with message - ✔ should clear error when marking warning - markLoading - ✔ should set status to loading with custom message - ✔ should set status to loading with default message - status check methods - ✔ should correctly identify healthy status - ✔ should correctly identify error status - ✔ should correctly identify loading status - ✔ should correctly identify warning status - getSummary - ✔ should return summary with message - ✔ should return summary without message - ✔ should handle all status levels - status transitions - ✔ should transition through multiple states correctly - ComponentStatusRegistry - reset - ✔ should clear all statuses - setStatus - ✔ should set component status with all parameters - ✔ should set component status without optional parameters - ✔ should overwrite existing status - ✔ should throw error for invalid component name - ✔ should throw error for invalid status level - getStatus - ✔ should return undefined for non-existent component - ✔ should return ComponentStatus instance - getAllStatuses - ✔ should return empty map initially - ✔ should return all registered statuses - reportHealthy - ✔ should set status to healthy with message - ✔ should set status to healthy without message - reportError - ✔ should set status to error with Error object - ✔ should set status to error with string error - reportWarning - ✔ should set status to warning with message - lifecycle management methods - initializeLoading - ✔ should set status to loading with custom message - ✔ should set status to loading with default message - markLoaded - ✔ should set status to healthy with custom message - ✔ should set status to healthy with default message - markFailed - ✔ should set status to error with all parameters - ✔ should set status to error with string error - getComponentsByStatus - ✔ should return components with specific status - ✔ should return empty array for status with no components - ✔ should return correct component objects - getStatusSummary - ✔ should return initial summary with zero counts - ✔ should count components by status - aggregation functionality (via getAggregatedFromAllThreads) - ✔ should aggregate single component from multiple threads - ✔ should detect abnormalities when statuses differ - ✔ should prioritize non-healthy messages - ✔ should handle status priority correctly - ✔ should handle worker index in status data - ✔ should handle main thread correctly - static getAggregatedFromAllThreads method - ✔ should collect and aggregate statuses - getAggregatedStatusFor method - basic aggregation scenarios - ✔ should return status for exact component match only - ✔ should return aggregated status for sub-components only - ✔ should combine exact match with sub-components - ✔ should return unknown status when component not found - status priority and aggregation logic - ✔ should prioritize error over other statuses - ✔ should prioritize loading over healthy statuses - ✔ should return healthy when all components healthy - ✔ should handle mixed status scenarios correctly - details and message generation - ✔ should include details when components have issues - ✔ should not include details when all components healthy - ✔ should generate descriptive messages for problem components - ✔ should format component keys correctly in messages - edge cases and error handling - ✔ should handle empty consolidated statuses gracefully - ✔ should handle null/undefined consolidated statuses - ✔ should work with pre-provided consolidated statuses - ✔ should fetch consolidated statuses when not provided - ✔ should handle missing latestMessage gracefully - CrossThread Module - CrossThreadStatusCollector - ✔ should collect status from local thread only when no responses (1002ms) - ✔ should collect status from multiple threads (101ms) - ✔ should handle ITC send failure - ✔ should handle collection timeout (51ms) - ✔ should complete early when all threads respond (50ms) - ✔ should reuse listener across multiple collections (2001ms) - ✔ should properly clean up resources - StatusAggregator - ✔ should aggregate single component from single thread - ✔ should detect abnormalities when statuses differ - ✔ should prioritize non-healthy messages - ✔ should handle status priority correctly - ✔ should handle main thread correctly - ✔ should handle worker index in status data - Component Status Errors - ComponentStatusError - ✔ should create base error with default status code - ✔ should create base error with custom status code - CrossThreadTimeoutError - ✔ should create timeout error with details - ITCError - ✔ should create ITC error without cause - ✔ should create ITC error with cause - AggregationError - ✔ should create aggregation error - ComponentStatusOperationError - ✔ should create operation error - CrossThreadCollectionError - ✔ should create collection error for partial success - ✔ should create collection error for complete failure - ✔ should provide detailed diagnostics - Component Status API - statusForComponent - ✔ should return a ComponentStatusBuilder instance - ✔ should return the same instance for the same component name - ✔ should return different instances for different component names - ComponentStatusAPI methods - warning - ✔ should set component status to warning - error - ✔ should set component status to error with message only - ✔ should set component status to error with message and Error object - healthy - ✔ should set component status to healthy with message - ✔ should set component status to healthy without message - loading - ✔ should set component status to loading with message - ✔ should set component status to loading without message - unknown - ✔ should set component status to unknown with message - ✔ should set component status to unknown without message - get - ✔ should return undefined for non-existent component - ✔ should return the current status of the component - ✔ should reflect status changes - Integration with componentStatusRegistry - ✔ should properly integrate with the global registry - ✔ should work with registry methods - Multiple component workflow - ✔ should handle multiple components independently - Status transition scenarios - ✔ should handle component lifecycle transitions - componentStatusRegistry singleton - ✔ should export a ComponentStatusRegistry instance - ✔ should be a singleton instance - ✔ should have all ComponentStatusRegistry methods - ✔ should work with basic operations - configHelpers - getBackupDirPath - ✔ should return path to backup directory - ✔ should handle paths with trailing slash - ✔ should handle relative paths - ✔ should use BACKUP_DIR_NAME constant from hdbTerms - configUtils - applyRuntimeEnvVarConfig - ✔ should skip when no env vars set - ✔ should apply HARPER_DEFAULT_CONFIG when set - ✔ should apply HARPER_SET_CONFIG when set - ✔ should apply both env vars when both set - ✔ should warn and skip when rootPath not found - ✔ should write config file after applying env vars - ✔ should throw error if config doc has errors - ✔ should log error and rethrow on file write failure - ✔ should skip file write when configFilePath is not provided - ✔ should pass options parameter to applyRuntimeEnvConfig - error handling in YAML processing - ✔ should log error and rethrow when applyRuntimeEnvConfig throws (most likely scenario) - ✔ should log error and rethrow when YAML.stringify() fails - ✔ should log error and rethrow when YAML.parseDocument() fails - Test configUtils module - Test atomicWriteFile function - ✔ writes content to the target path - ✔ overwrites an existing file - ✔ writes via temp file then rename so target is never truncated mid-write - ✔ leaves no temp file behind after a successful write - ✔ generates a unique temp path even when pid and timestamp are identical - Test getDefaultConfig function - ✔ Test that if the in-memory object exists, the correct default value is returned - Test getConfigValue function - ✔ Test if param is defined in instantiated default config, returns in-memory value - ✔ Test if param isnt defined in instantiated default config, returns undefined - ✔ Test if in-memory obj doesnt exist, returns undefined - Test initConfig function - ✔ Test in-memory obj undefined, function reads config doc and adds values to object - ✔ Test parameter "force" is true, function reads config doc and adds values to object - ✔ Test in-memory obj undefined, config file path undefined and error is caught - Test validateConfig function -[main/0] [info]: Detected 20 cores and 32768MB on this machine, defaulting threads.count to 19 - ✔ Test error message is thrown if there is a validation error - ✔ Test necessary parameters are setIn by validator - Test updateConfigObject function - ✔ Test happy path in-memory obj is updated - ✔ Test logger trace message if param doesnt exist - Test updateConfigValue function - ✔ Test happy path where backup and update_config_obj are true - ✔ Test happy path with parsed_args and where backup and update_config_obj are false - ✔ Test that if there is no in-memory obj, initConfig is hit PLUS it handles error with bad param - ✔ Test config not updated if values are the same - ✔ Test string env values matching typed config values are detected as equal - ✔ Test string env value differing from typed config value triggers update - Test castConfigValue function - ✔ Test number value returns number - ✔ Test if value is boolean, boolean is returned - ✔ Test if value is true/false string, boolean is returned - ✔ Test if value is undefined or undefined as string, null is returned - ✔ Test if value is an object, string, or array, the same data type is returned - Test getConfiguration function - ✔ Test a config object is returned - Test setConfiguration function - ✔ Test happy path success response returned - ✔ Test error handled if updateConfigValue throws error - Test readConfigFile function - ✔ Test happy path, function returns json config object - ✔ Test that function handles error if boot props file doesnt exist - Test initOldConfig function - ✔ Test updates in-memory config object - Test setSchemasConfig function - ✔ Test all schemas config is added to config doc - Test port conflict resolution with environment variables - ✔ should allow explicitly setting port to null when HARPER_SET_CONFIG sets securePort to same value - ✔ should allow explicitly setting port to null when HARPER_SET_CONFIG sets securePort for http - ✔ should auto-null operationsApi port when HARPER_SET_CONFIG sets securePort to same value - ✔ should auto-null http port when HARPER_SET_CONFIG sets securePort to same value - ✔ should auto-null operationsApi port when HARPER_DEFAULT_CONFIG sets securePort to same value - ✔ should auto-null http port when HARPER_DEFAULT_CONFIG sets securePort to same value - ✔ should allow explicitly setting port to null with HARPER_DEFAULT_CONFIG - composeConfigFromEnv - ✔ returns an empty object when no env vars and no base are provided - ✔ returns a clone of base when no env vars are set - ✔ does not mutate the base when env vars override values - ✔ layers HARPER_DEFAULT_CONFIG below the base (base wins on conflict, defaults fill gaps) - ✔ applies HARPER_SET_CONFIG on top of everything - ✔ reads values set by HARPER_SET_CONFIG under a nested path - ✔ treats an empty-string env var as unset - ✔ throws when env var contains invalid JSON - HARPER_DEFAULT_CONFIG - true defaults behavior - ✔ should NOT override existing config values at runtime (config file priority) - ✔ should SET values that do not exist in config - ✔ should UPDATE values it previously set (on subsequent runs) - ✔ should NOT override value if user edited it after HARPER_DEFAULT_CONFIG set it - ✔ should UPDATE value set during install when env var changes at runtime - ✔ should restore original value when key removed from HARPER_DEFAULT_CONFIG - ✔ should DELETE new keys when removed from HARPER_DEFAULT_CONFIG (no original value) - ✔ should handle complex deletions with mix of restored and deleted keys - ✔ should handle deeply nested config changes - ✔ should track originalValues correctly across multiple changes - harperConfigEnvVars - Edge Cases - deleteNestedValue - ✔ should handle deleting from non-existent path gracefully - ✔ should handle deleting when intermediate path is not an object - loadConfigState - ✔ should handle corrupted state file gracefully - ✔ should handle state file without originalValues (backwards compatibility) - detectConfigDrift - ✔ should detect when user manually changes a value - ✔ should not detect drift for values set by HARPER_SET_CONFIG - removeValuesWithSource - ✔ should remove all values from a specific source - cleanupRemovedEnvVar - ✔ should handle cleanup when env var was never set - storeOriginals edge cases - ✔ should not store original when value is null - ✔ should not store original when value is undefined - early return cases - ✔ should return early when no env vars are set - drift detection at install vs runtime - ✔ should not detect drift during install - filterArgsAgainstRuntimeConfig - Basic filtering - ✔ should return args unchanged when HARPER_SET_CONFIG is not set - ✔ should filter out args that are in HARPER_SET_CONFIG - ✔ should handle nested config objects - ✔ should be case-insensitive - Docker Compose scenario - ✔ should filter Dockerfile ENV vars when HARPER_SET_CONFIG overrides them - Edge cases - ✔ should handle empty HARPER_SET_CONFIG - ✔ should handle invalid JSON in HARPER_SET_CONFIG - ✔ should handle null values in HARPER_SET_CONFIG - ✔ should handle arrays in HARPER_SET_CONFIG - Does NOT filter HARPER_DEFAULT_CONFIG - ✔ should NOT filter args that are only in HARPER_DEFAULT_CONFIG - HARPER_SET_CONFIG - Install-time behavior - ✔ should apply HARPER_SET_CONFIG during install - ✔ should override HARPER_DEFAULT_CONFIG values during install - ✔ should track HARPER_SET_CONFIG in state file - Runtime behavior - ✔ should apply HARPER_SET_CONFIG at runtime - ✔ should override HARPER_DEFAULT_CONFIG at runtime - ✔ should override user edits (force override) - ✔ should delete NEW values when key removed from HARPER_SET_CONFIG - ✔ should RESTORE original values when key removed from HARPER_SET_CONFIG - ✔ should RESTORE original value when key removed from HARPER_SET_CONFIG via changed env var - ✔ should update values when HARPER_SET_CONFIG changes - Precedence - ✔ should follow precedence: SET_CONFIG > user > DEFAULT_CONFIG > file - harperConfigEnvVars - hashConfig - ✔ produces different hashes for different configs - ✔ produces same hash for same config with different key order - ✔ produces different hashes for nested config differences - ✔ handles arrays correctly in hash - ✔ produces same hash for deeply nested configs with different key order - parseConfigEnvVar - ✔ parses valid JSON - ✔ returns null for empty string - ✔ returns null for undefined - ✔ returns null for null - ✔ trims whitespace - ✔ throws ConfigEnvVarError for invalid JSON - ✔ throws ConfigEnvVarError for non-object JSON (array) - ✔ throws ConfigEnvVarError for non-object JSON (string) - ✔ throws ConfigEnvVarError for non-object JSON (number) - ✔ includes env var name in error - ✔ includes original error in ConfigEnvVarError - ✔ parses complex nested JSON - ConfigEnvVarError - ✔ has correct properties - ✔ works without originalError - ✔ is instanceof Error - RootConfigWatcher - ✔ should instantiate and watch the root Harper config file - ✔ should detect changes written via temp-file + rename (atomic write) - Test bulkLoad.js - Test csvDataLoad - - Test csvDataLoad nominal case with valid file and valid column names/data - - Test csvDataLoad with non-SU role evaluates attr-level perms - - Test csvDataLoad with attr-level perms issues - returns errors - - Test csvDataLoad invalid column names, expect exception - - Test csvDataLoad missing data, expect exception - - Test csvDataLoad bad csv data, expect nothing loaded message - - Test csvDataLoad incomplete csv data, expect nothing loaded message - Test csvURLLoad function - - Test bad URL throws validation error - - Test for nominal behaviour and success message is returned - Test downloadCSVFile function - - Test error is handled from request promise module - - Test for nominal behaviour, stubs are called as expected - - Test that error from mkdirSync is handled correctly - Test validateURLResponse function - - Test that bad error code is handled - - Test non-supported content type is handled - - Test empty response body is handled - Test csvFileLoad function - - Test validation throws error - - Test success message is returned - - Test exception from papaparse is caught and logged - Test importFromS3 function - - NOMINAL - Should call through and return results - - NOMINAL - Should add `file_type` and `file_path` variables to the json message - csv - - NOMINAL - Should add `file_type` and `file_path` variables to the json message - json - - Should use buildTopLevelErrMsg to handle any error thrown - Test fileLoad function - - Should call papaParse if file is CSV - - Should call insertJson if file is JSON - - Should throw an error if file_type is not supported - Test validateChunk function - - Test validation function returns if no data - - Test verifyBulkLoadAttributePerms method is called when user is non-SU - - Test parser is paused/resumed and validation called - - Test error is logged and reject promise returned - Test insertChunk function - - Test validation function returns if no data - - Test parser is paused/resumed and callBulkLoad is called - - Test error is logged and reject promise returned - Test callPapaParse function - - Test readstream and papaparse are called and insert results are returned - - Test that error is logged and thrown - Test insertJson function - - NOMINAL - Should call through and return results - - ERROR - Should return a HDB error if the readStream emits an error - Test bulkFileLoad function - - Test action defaults to insert and correct results are returned - - Test update is called and returned result is correct - - Test error is thrown if invalid action is passed - - Test insert error caught and thrown - Tests for delete.js - Test deleteFilesBeforeFunction - ✔ Test that validation error returned - ✔ Test that Invalid date format error returned -[main/0] [info]: Finished deleting files before 2018-06-14 - ✔ Test for nominal behaviour, bridge stubbed called and info logged - ✔ Test no schema error is returned - test deleteAuditLogsBefore function - ✔ Test that validation error returned - ✔ Test that date string is invalid - ✔ Test that epoch value is valid -[main/0] [info]: Finished deleting audit logs before 1778624822919 - ✔ Test ok with stub - Test deleteRecords function - ✔ Test that validation error is thrown from bad delete object - ✔ Test for nominal behaviour, success msg is returned - ✔ Test that error from bridge is caught and thrown - ✔ Test that error from schema/table check is handled - Test export.js - Test export_local - ✔ Nominal Call to export_local with csv file - ✔ Nominal Call to export_local with json file - ✔ Call to export_local with bad path - ✔ Call to export_local with search exception thrown - ✔ Test validation error is handled correctly - Test confirmPath - ✔ Nominal case of confirmPath - ✔ call confirmPath with bad path - ✔ call confirmPath with non directory path - ✔ call confirmPath with undefined path - ✔ Test access denied error is handled correctly - ✔ Test access error message is handled - Test saveToLocal - ✔ Nominal case of saveToLocal with json - ✔ Nominal case of saveToLocal with csv - ✔ Test error is thrown if file_path invalid - ✔ Test error is thrown if source format invalid - ✔ Test error is thrown if data not found - ✔ Test error is thrown if format invalid - ✔ Call saveToLocal with empty data, this is valid - Test export_to_s3 - ✔ Nominal call export CSV to S3 - ✔ Nominal call export JSON to S3 - ✔ Test missing S3 object error thrown - ✔ Test missing aws_access_key_id error thrown - ✔ Test missing aws_secret_access_key error thrown - ✔ Test missing bucket error thrown - ✔ Test missing key error thrown - ✔ Test bad format error thrown - ✔ Test error from getRecords is handled correctly - Test exportCoreValidation function - ✔ Test format missing message is returned - ✔ Test invalid format message is returned - ✔ Test search operation missing message is returned - ✔ Test search operation value wrong message returned - Test getRecords function - ✔ Test search by value operation is selected - ✔ Test search by hash operation is selected - ✔ Test search by SQL operation is selected - ✔ Test invalid search operation error thrown - ✔ Test search operation not supported error thrown - Test hdbInfoController module - Test insertHdbInstallInfo() - - test insert install info - nominal case - - test insert install info - throws exception - Test insertHdbUpgradeInfo() - - test insert nominal case - - test insert - search throws exception - - test insert - search returns no errors, still expect to run - - test insert - insert throws exception - Test getAllHdbInfoRecords() - - Should return the results from the hdb_info table search - nominal case - - Should log error if thrown from search function and return [] - Test getLatestHdbInfoRecord() - - It should return the most recent info record - - It should return undefined if search returns no records - Test getVersionUpdateInfo() - - getVersionUpdateInfo nominal test - - getVersionUpdateInfo - no result returned if versions are the same - - getVersionUpdateInfo - pre-upgrade version newer than upgrade version, but only minor difference - - getVersionUpdateInfo nominal test, upgrade that does not require a directive - - getVersionUpdateInfo - error thrown if downgrading major version - - getVersionUpdateInfo - error thrown if version is too old - - test getVersionUpdateInfo - version does not exist - Test checkIfInstallIsSupported() - - Test it throws error message if hdb_info table doesnt exist - - Test it throws error message if data version is too old - Test insert module - Test upsert method - ✔ NOMINAL - should return upsert response with upserted_hashes value - ✔ Should return HdbError if operation is not upsert - ✔ Should return HdbError if there is a schema validation error - ✔ Should return HdbError if insertValidator returns error - Test returnObject method - ✔ Test for INSERT - ✔ Test for UPDATE - ✔ Test for UPSERT - Test insertData method - ✔ NOMINAL - should return insert response with inserted_hashes value - ✔ Should return HdbError if operation is not insert - ✔ Should return HdbError if insertValidator returns error - ✔ Should return HdbError if schema table does not exist - Test updateData method - ✔ NOMINAL - should return update response with updated_hashes value with existing rows - ✔ NOMINAL - should return update response with updated_hashes value with out existing rows - ✔ Should return HdbError if operation is not update - ✔ Should return HdbError if insertValidator returns error - ✔ Should return HdbError if schema table does not exist - test readAuditLog module - - test no schema - - test no table - - test invalid search type - - test happy path - - Test table validation error returned - - Test auditLog not set in config err - Test schema module - Create schema - - should return valid stub from createSchemaStructure - - should catch thrown error from createSchemaStructure - Create schema structure - - should throw schema already exists error - - should call bridge and return success message - Create table - - should return valid stub from createTableStructure - - should catch thrown error from createTableStructure - Create table structure - - should catch thrown error from validation.create_table_object - - should throw table already exists error message - - should check that table has been inserted with clustering on - - should throw clustering not enabled error - - should call all stubs and return success message - - should call createTable without setting table.residence - - should catch and throw validation error - Drop Schema - - Test that bridge stub is called as expected and success msg is returned - - Test schema does not exist error is thrown - - Test error from bridge drop schema is caught, thrown and logged - - Test schema obj validation catches and throws error - Drop table - - Test that validation error is caught and thrown - - Test stubs are called as expected and success message is returned - - Test that an error from bridge method drop table is caught and logged - - Test table not found error thrown - Drop attribute - - should throw a validation error - - should throw cannot drop a hash attribute error - - should call all functions and return a success message - - Test error is thrown when trying to drop updated time - - Test table not found error thrown - Test dropAttributeFromGlobal function - - Test that attribute is removed from global schema - Create attribute - - should return attribute structure with clustering off - Test describeAll - - describeAll, test nominal case - - describeAll, test search exception - - describeAll, test descTable exception - Test describeSchema - - describeSchema, test nominal case - - describeSchema, test no schema error - - describeSchema, test search exception - - describeSchema, test descTable exception - - describeSchema, validation failure - Test describeTable - - describeTable, test nominal case - - describeTable, test validation failure - Test SQL Update/Insert/Delete - SQL UPDATE - - should update entries via SQL UPDATE - - should increment postcode twice concurrently via SQL UPDATE with correct isolation/serialization - - SQL DELETE - - SQL DELETE concurrently - - SQL INSERT - - SQL INSERT concurrently - Test SQL Engine - constructor() - ✔ should call four class methods when instantiated - ✔ should throw an exception if no statement argument is provided - search() - ✔ test function call with alias in select with no from - ✔ test function call with no alias in select with no from - ✔ test select with function that has single quotes with no alias - ✔ test select with function that has single quotes with alias - ✔ should return all rows when there is no WHERE clause - ✔ should return matching row based on WHERE clause - ✔ test a query where the same column has the table name in front and then not, to make sure the sql generates correctly - ✔ test a query where the same column has the table name in front and then not, to make sure the sql generates correctly #2 - ✔ should return matching rows based on WHERE clause - ✔ should return [] if no rows meet WHERE clause - ✔ should return the result of a operation with only a calculation - search() - testing variety of SQL statements - ✔ Basic select by hash returns requested attribute values for hash - ✔ Basic select by hash with wildcard returns requested attribute values for matching hashes - ✔ Basic select by value returns requested attributes for matching rows - ✔ Basic select by value with wildcard returns requested attributes for matching rows - ✔ should sort employees by hash in asc order - ✔ should return results when reserved words are used for schema.table AND are backticked - ✔ should return dot & double dot attribute values - ✔ should return orders sorted by orderid in desc order (61ms) - ✔ should return orders ordered by attribute not included in select statement - ✔ should return orders ordered by attribute not included in select statement - without table alias - ✔ should return orders ordered by attribute with inconsistent table alias - ✔ should return all orders data ordered by attribute with inconsistent table alias - ✔ should return count of records with attr value equal to null (44ms) - ✔ should return count of records with attr value NOT equal to null - ✔ should return complex join sorted by summed attribute value and joined company name in desc order (184ms) - ✔ should return requested attributes from 5 table join statement for specified companyname (76ms) - ✔ should count customers and group by country attribute - ✔ should return the top 10 products by unitprice based on limit and order by - - should return the top 10 products by ROUND(unitprice) based on limit and order by - ✔ should return count min max avg sum price of products - ✔ should return rounded unit price and group by calculated value - ✔ should return results based on wildcard and min value parameters - ✔ should return longtext values based on regex - _checkEmptySQL() - ✔ should return empty array if attributes and columns are set in class instance - ✔ should return the result of a sql operation if sql is only calculation - _getColumns() - ✔ should collect column data from the statement and set it to column property on class - ✔ should collect column data from statement columns, joins, and order by and set to columns property - ✔ should search for ORDER BY element and replace the column alias with the expression from SELECT - ✔ test not needing table alias on attributes that are uniquely named between tables - _getTables() - ✔ test multiple attributes from ONE table sets one table in this.data and gets hash_name from global.schema - ✔ test multiple attributes from multiple table sets multiple tables in this.data and gets hash_name from global.schema - _conditionsToFetchAttributeValues() - ✔ should NOT set exact_search_values property when there is no WHERE clause - ✔ should set exact_search_values property with data from WHERE clause - ✔ should perform same as test above but with a test hash value of zero - ✔ should set multiple values to exact_search_values property with data from WHERE IN clause - ✔ should set comparator_search_values property with < comparator logic from WHERE clause - ✔ should set comparator_search_values property with <= comparator logic from WHERE clause - ✔ should set comparator_search_values property with > comparator logic from WHERE clause - ✔ should set comparator_search_values property with >= comparator logic from WHERE clause - ✔ should not set comparator_search_values if the expression.left is null - ✔ should not set comparator_search_values if the expression.right is null - ✔ should set multiple comparator_search_values if the WHERE clause has multiple different attr conditions - ✔ should set multiple comparator_search_values.comparators values if the WHERE clause has multiple same attr conditions - _backtickAllSchemaItems() - ✔ should add backticks to all schema elements in statement property - _findColumn() - ✔ should return full column data for requested column - ✔ should return column data for alias - ✔ should NOT return data for column that does not exist - _addFetchColumns() - ✔ should add columns from JOIN clause to fetch_attributes property - ✔ should add columns from ORDER BY clause to fetch_attributes property - ✔ should add columns from WHERE clause to fetch_attributes property - ✔ should NOT add columns to fetch_attributes property if not found - _getFetchAttributeValues() - ✔ should call simpleSQLQuery and return results for simple SELECT statement - ✔ should set values to the data[table].__mergedData property for specified hash attributes from WHERE clause - ✔ should set values to the data[table].__mergedData property for specified attribute value and associated hash key/value pairs from WHERE clause - ✔ should set values to the data[table].__mergedData property for specified attributes from JOIN clause - ✔ should set values to the data[table].__mergedData property for specified hash from ORDER BY clause - ✔ should set values to the data[table].__mergedData property for specified attribute value from ORDER BY clause - ✔ should set row attr values that do not come back as null in final row data in to the data[table].__mergedData property - _getFinalAttributeData() - ✔ should return/skip if row_count equals 0 - ✔ should consolidate unique columns/attributes and pass them to _getData() - _getData() - ✔ should set data.merged_data property with hash attributes values - ✔ should set data.merged_data property with hash attributes values for multiple tables - ✔ should set longtext/blob values in the data.__mergedData property - _processJoins() - ✔ should remove rows from `__mergedData` that do not meet WHERE clause - ✔ should update merged_data for each table based on overlap of JOIN clause - ✔ should update __mergedData for longtext blobs based on WHERE statement - _finalSQL() - ✔ should return final sql results sorted by id in DESC order - _buildSQL() - - should parse columns to remove extra alias in UPPER function clause - ✔ should return initial statement string if there are not column functions clauses - Test update module - Tests update function - ✔ Tests update function with simple where query - ✔ Tests update function WITHOUT where query - ✔ Tests update function with where query, but value does not exist - ✔ Tests update function updating multiple columns with multiple wheres. - ✔ Tests update function with != where query - ✔ Tests update function with null where query - ✔ Tests update function throws error - Test createUpdateRecord function - ✔ NOMINAL - should assign value from column expression to record's columnid - ✔ Tests that an error is thrown - ✔ Tests alasql compile called if value not in column expression - Test updateRecords function - ✔ NOMINAL - should return update response - Test installer module - - Test checkForPromptOverride gets prompts and config vars - - Test checkForExistingInstall - - Test termsAgreement doesnt prompt if override value passed - - Test termsAgreement logs and exits if answer not yes - - Test createBootPropertiesFile calls all the things to make file then sets env props - - Test createConfigFile assigns all the args and calls createConfig then init - - Test createConfigFile calls rollback if create config throws error - - Test rollbackInstall calls remove and process exit - - Test createAdminUser calls addRole then addUser - - Test installPrompts passes correct schema and override works - - Test createSuperUser calls create admin user with correct params - - Test createClusterUser calls create admin user with correct params - - Test insertHdbVersionInfo calls insert with correct param - - Test displayCmdEnvVar function logs generic password message and not password - - Test displayCmdEnvVar function logs prompt message and value - - Test checkForEmptyValue returns message if value empty - - Test checkForEmptyValue returns undefined if value not empty - Test install function - - Test that all functions needed for install are called - HARPER_DEFAULT_CONFIG integration - - applies HARPER_DEFAULT_CONFIG during config file creation - - merges HARPER_DEFAULT_CONFIG with OOTB defaults - - replaces arrays from HARPER_DEFAULT_CONFIG - - throws error on invalid JSON in HARPER_DEFAULT_CONFIG - - works without HARPER_DEFAULT_CONFIG set - Test password module - Hashing SHA256 - ✔ should generate a valid hash - ✔ should fail validation for incorrect password - test MD5 - ✔ should generate a valid MD5 hash - ✔ test that legacy hashes are validated correctly using current validator - Test Asynchronous Hashing (Argon2id) - ✔ should generate a valid async hash (112ms) - ✔ should fail async validation for incorrect password (129ms) - Empty Hash Validation - ✔ should fail sync validation for empty hash - ✔ should fail async validation for empty hash - Test authorize function - ✔ Cannot complete request Basic authorization: User not found - ✔ Cannot complete request Basic authorization: User is inactive - ✔ Cannot complete request Basic authorization: Invalid password - ✔ Can authorize with correct username and password Basic authorization - ✔ Cannot complete request Other authorization: User not found - ✔ Cannot complete request Other authorization: User is inactive - ✔ Cannot complete request Other authorization: Invalid password - ✔ Can authorize with correct username and password Other authorization - test authorize function for JWT - ✔ test hdb_admin operation token - ✔ test old_user operation token - ✔ test non-existent user operation token - ✔ test bad operation token - ✔ test expired operation token - ✔ test hdb_admin refresh token - ✔ test old_user refresh token - ✔ test non-existent refresh user - ✔ test bad refresh token - ✔ test expired refresh token - Test checkPermissions function - ✔ validate permission object, should get error when object is incomplete - ✔ no permission role in object should error - ✔ super_user permission can authorized - ✔ Not authorized to access schema when no schema name - ✔ Not authorized to access table when no table name - ✔ Not authorized to insert table when tables no attribute - ✔ Not authorized insert to table, missing restrict attribute - ✔ Not authorized insert restrict attribute name and id are false to table - ✔ Not authorized insert restrict attribute name is ture and id is false to table - ✔ can authorized with have restrict attribute true - ✔ can authorized with not have restrict attribute - auth.ts - certificate verification integration - mTLS certificate verification in authentication middleware - ✔ should skip certificate verification when mTLS is not configured - ✔ should skip certificate verification when not authorized by TLS -[main/0] [info] [auth-event] [authentication]: AuthAuditLog { - username: 'test-client', - status: 'success', - type: 'authentication', - originating_ip: '192.168.1.100', - request_method: 'GET', - path: '/test', - auth_strategy: 'mTLS' -} - ✔ should verify certificate when mTLS is configured and authorized - ✔ should reject request when certificate is revoked - ✔ should reject request when certificate verification fails -[main/0] [info] [auth-event] [authentication]: AuthAuditLog { - username: 'custom-username', - status: 'success', - type: 'authentication', - originating_ip: '192.168.1.100', - request_method: 'GET', - path: '/test', - auth_strategy: 'mTLS' -} - ✔ should handle mTLS with custom user field - ✔ should handle mTLS with null user (no user mapping) -[main/0] [info] [auth-event] [authentication]: AuthAuditLog { - username: 'common-name-client', - status: 'success', - type: 'authentication', - originating_ip: '192.168.1.100', - request_method: 'GET', - path: '/test', - auth_strategy: 'mTLS' -} - ✔ should use Common Name when user is set to CN -[main/0] [info] [auth-event] [authentication]: AuthAuditLog { - username: 'test-client', - status: 'success', - type: 'authentication', - originating_ip: '192.168.1.100', - request_method: 'GET', - path: '/test', - auth_strategy: 'mTLS' -} - ✔ should handle certificate verification with different statuses -[main/0] [info] [auth-event] [authentication]: AuthAuditLog { - username: 'test-client', - status: 'success', - type: 'authentication', - originating_ip: '192.168.1.100', - request_method: 'GET', - path: '/test', - auth_strategy: 'mTLS' -} - ✔ should pass mtlsConfig to verifyCertificate for configuration - authentication error logging - - should log certificate verification failures - certificateVerification/certificateVerificationSource.ts - class exports - ✔ should export CertificateVerificationSource class - ✔ should extend Resource class - get() method - CRL verification - ✔ should handle CRL cache key and return result structure - ✔ should calculate expiresAt based on cacheTtl - get() method - OCSP verification - ✔ should detect OCSP method from cache key prefix - get() method - error handling - ✔ should return null when no requestContext available - ✔ should return null when certPem is missing - ✔ should return null when issuerPem is missing - ✔ should throw for unsupported verification method - ✔ should throw for cache key with no prefix - get() method - result consistency - ✔ should include checked_at timestamp - ✔ should preserve certificate_id in result - ✔ should include all required fields in result - method detection - ✔ should detect CRL method from cache key prefix - ✔ should identify OCSP vs CRL by prefix - ✔ should detect unknown method for invalid prefix - certificateVerification/crlVerification.ts - module exports - ✔ should export verifyCRL function - ✔ should export performCRLCheck function - verifyCRL() main API - ✔ should handle disabled CRL verification - ✔ should return result structure with valid field - ✔ should handle no CRL distribution points gracefully - ✔ should use provided CRL URLs instead of extracting - ✔ should convert Buffer to PEM format for processing - ✔ should handle config with all optional fields - ✔ should handle minimal config with defaults - ✔ should return cached field in result - CRL signature verification - ✔ should reject invalid CRL signatures in fail-closed mode - ✔ should reject invalid CRL signatures in fail-open mode - performCRLCheck() core logic - no CRL distribution points - ✔ should return good status when no distribution points extracted - ✔ should use provided CRL URLs instead of extracting from cert (76ms) - utility function extraction - ✔ should extract serial number and issuer key for composite ID (66ms) - ✔ should throw when extraction functions fail - certificateVerification/index.ts - module exports - ✔ should export verifyCertificate function - verifyCertificate() orchestration - disabled configuration - ✔ should return disabled status when config is false - ✔ should return disabled status when mtlsConfig is null - insufficient certificate chain - ✔ should return no-issuer-cert when chain length < 2 - ✔ should return no-issuer-cert when first cert has no issuer - CRL verification path - ✔ should attempt CRL verification when CRL URLs present and enabled - ✔ should return immediately on CRL revoked result - ✔ should fall back to OCSP when CRL returns unknown - ✔ should skip CRL when disabled in config - ✔ should skip CRL when no distribution points - ✔ should handle CRL verification errors gracefully - OCSP verification path - ✔ should attempt OCSP verification when OCSP URLs present and enabled - ✔ should skip OCSP when disabled in config - ✔ should skip OCSP when no responder URLs - ✔ should handle OCSP verification errors gracefully - failure mode handling - ✔ should reject when no verification available with fail-closed - ✔ should allow when no verification available with fail-open - ✔ should reject when all methods fail with fail-closed - ✔ should allow when all methods fail with fail-open - certificateVerification/ocspVerification.ts - module exports - ✔ should export verifyOCSP function - ✔ should export performOCSPCheck function - verifyOCSP() main API - ✔ should handle disabled OCSP verification - ✔ should return result structure with valid field - ✔ should convert Buffer to PEM format for processing - ✔ should handle fail-closed mode correctly - ✔ should handle fail-open mode correctly - ✔ should handle config with all optional fields - ✔ should handle minimal config with defaults - ✔ should return cached field in result - ✔ should handle provided OCSP URLs - ✔ should handle empty OCSP URLs array - ✔ should handle null certificate input gracefully - ✔ should handle empty buffer input - ✔ should handle very short timeout - performOCSPCheck() error handling - ✔ should handle generic OCSP errors - ✔ should return result with status field - certificateVerification/pkijs-ed25519-patch.ts - patch module exports - ✔ should export applyEd25519Patch function - ✔ should apply patch without errors - Ed25519 OID constants validation - ✔ should recognize standard Ed25519 and Ed448 OIDs - ✔ should validate algorithm names - EdDSA algorithm properties - ✔ should understand EdDSA built-in hashing - ✔ should handle algorithm parameter structures - bit string handling logic - ✔ should handle bit strings with unused bits - ✔ should handle bit strings without unused bits - error handling patterns - ✔ should handle verification errors gracefully - ✔ should handle missing crypto API gracefully - integration patterns - ✔ should understand proper import order requirements - ✔ should validate patch application pattern - CryptoEngine.getHashAlgorithm patch - ✔ should return placeholder for Ed25519 algorithm - ✔ should return placeholder for Ed448 algorithm - ✔ should delegate to original for non-EdDSA algorithms - CryptoEngine.getAlgorithmByOID patch - ✔ should return Ed25519 algorithm for Ed25519 OID - ✔ should return Ed448 algorithm for Ed448 OID - ✔ should delegate to original for non-EdDSA OIDs - ✔ should return result for unknown OIDs without throwing - CryptoEngine.getAlgorithmParameters patch - ✔ should return Ed25519 parameters for sign operation - ✔ should return Ed25519 parameters for verify operation - ✔ should return Ed448 parameters for sign operation - ✔ should return Ed448 parameters for verify operation - ✔ should delegate to original for non-EdDSA algorithms - Certificate.getPublicKey patch - ✔ should handle Ed25519 public key extraction - ✔ should handle Ed448 public key extraction - Certificate.verify patch - ✔ should return false for invalid Ed25519 certificate verification - ✔ should return false for invalid Ed448 certificate verification - CryptoEngine.verifyWithPublicKey patch - ✔ should return false when crypto.subtle is unavailable for Ed25519 - ✔ should return false when crypto.subtle is unavailable for Ed448 - ✔ should handle BIT STRING signature with unused bits - ✔ should not trim signature when no unused bits - patch preservation of original behavior - ✔ should not affect RSA certificate operations - ✔ should not affect ECDSA algorithm parameters - certificateVerification/verificationConfig.ts - configuration constants - ✔ should export required constants - ✔ should export OCSP defaults from validation module - ✔ should export CRL defaults from validation module - ✔ should generate User-Agent string with version - cached configuration function - ✔ should export getCachedCertificateVerificationConfig function - ✔ should handle falsy mtls configurations - ✔ should return false for mtls: true (cert verification disabled by default) - ✔ should handle complex configuration objects - ✔ should handle CRL configuration - ✔ should handle edge cases - caching behavior - ✔ should cache results for repeated calls - ✔ should handle object configurations - ✔ should handle complex nested configuration objects - ✔ should handle invalid config gracefully with fail-safe behavior - ✔ should handle invalid timeout values gracefully - ✔ should handle invalid cacheTtl values gracefully - ✔ should handle invalid errorCacheTtl values gracefully - ✔ should handle zero cacheTtl values gracefully - ✔ should handle negative cacheTtl values gracefully - ✔ should accept very large cacheTtl values - ✔ should handle invalid gracePeriod values gracefully - ✔ should accept zero gracePeriod - boolean shorthand config (crl: true, ocsp: true) - ✔ should handle crl: true shorthand with defaults - ✔ should handle ocsp: true shorthand with defaults - ✔ should handle both crl: true and ocsp: true together - ✔ should handle crl: true with additional overrides - ✔ should handle ocsp: true with additional overrides - certificateVerification/verificationUtils.ts - bufferToPem function - ✔ should export bufferToPem function - ✔ should convert buffer to PEM format correctly - ✔ should handle empty buffer - ✔ should split long base64 into appropriate lines - pemToBuffer function - ✔ should export pemToBuffer function - ✔ should convert PEM to ArrayBuffer correctly - ✔ should handle PEM with whitespace - cache key generation - ✔ should export createCacheKey function - ✔ should create consistent cache keys - ✔ should create different keys for different methods - ✔ should export createCRLCacheKey function - ✔ should create CRL cache keys - ✔ should export createRevokedCertificateId function - ✔ should create composite revoked certificate IDs - certificate chain extraction - ✔ should export extractCertificateChain function - ✔ should extract single certificate - ✔ should extract certificate chain with issuer - ✔ should handle self-signed certificate - ✔ should handle missing raw data - ✔ should handle long certificate chains - ✔ should handle null issuer certificate - error handling for certificate parsing - ✔ should handle invalid certificates gracefully - ✔ should handle various PEM formats - ✔ should handle different certificate types in bufferToPem - ✔ should properly handle line wrapping in bufferToPem - ✔ should handle additional data in cache keys - cache key edge cases - ✔ should handle createCacheKey without additional data - ✔ should create different keys for same cert with different methods - ✔ should create different keys for different certificates - ✔ should create different keys for different issuers - ✔ should handle createCRLCacheKey with various URL formats - ✔ should handle createRevokedCertificateId with special characters - ✔ should handle createRevokedCertificateId with long values - table getter functions - ✔ should export getCertificateCacheTable function - ✔ should return certificate cache table with correct structure - ✔ should return same table instance on multiple calls - PEM format edge cases - ✔ should handle pemToBuffer with minimal valid PEM - ✔ should handle bufferToPem with empty buffer - ✔ should handle bufferToPem with exactly 64 chars of base64 - ✔ should handle pemToBuffer with Windows line endings - ✔ should handle pemToBuffer with mixed line endings - extractCertificateChain edge cases - ✔ should handle certificate with undefined issuerCertificate property - ✔ should handle very long certificate chains - ✔ should handle certificate chain with identical adjacent certificates - Test PermissionResponseObject class - Test handleInvalidItem method - - ✔ should return response object w/ err message in invalid_schema_items - ✔ should return empty unauthorized_access array even if populated before - Test addInvalidItem method - - ✔ should add item if schema_table key is not include unauthorized_access - ✔ should NOT add item if schema_table key is include unauthorized_access - security/impersonation.ts - applyImpersonation - gate check - ✔ should reject non-super-user with 403 - ✔ should reject user with no role - ✔ should reject null authenticatedUser - ✔ should reject undefined authenticatedUser - ✔ should reject user with role but no permission property - applyImpersonation - payload validation - ✔ should reject null payload - ✔ should reject payload with neither username, role_name, nor role - ✔ should reject payload with empty username and no role - ✔ should reject payload with non-object role - ✔ should reject payload with role missing permission - ✔ should reject array payload - ✔ should reject role with null permission - ✔ should reject operations field that is not an array - ✔ should reject non-string entries in operations array - ✔ should reject invalid operations entries - ✔ should accept valid operations including group names - applyImpersonation - Mode A (inline permissions) - ✔ should return synthetic user with inline permissions - ✔ should use provided username for audit context - ✔ should force super_user: false even if payload says true - ✔ should force cluster_user: false even if payload says true - ✔ should use Mode A (inline) when both role and username are provided - applyImpersonation - Mode B (existing user lookup) - ✔ should return cloned user from cache - ✔ should throw 404 for non-existent user - ✔ should force super_user: false on looked-up super user - ✔ should force cluster_user: false on looked-up cluster user - ✔ should NOT mutate the original cache entry after enforceDowngrade - ✔ should reject impersonation of inactive user with 403 - ✔ should handle looked-up user with no role gracefully - applyImpersonation - Mode C (role name lookup) - ✔ should return synthetic user with the looked-up role permissions - ✔ should use provided username for audit context - ✔ should throw 404 for non-existent role name - ✔ should force super_user: false on looked-up role - ✔ should force cluster_user: false on looked-up role - ✔ should NOT mutate the original role record - ✔ should prefer Mode A when both role and role_name are provided - applyImpersonation - audit trail - ✔ should set _impersonated and _impersonatedBy on the result - ✔ should set _impersonated role id consistently across all modes - scopedImport - ✔ should import a module - ✔ should throw an error importing an invalid CommonJS module - ✔ should throw an error importing a CommonJS module with invalid dependency - ✔ should throw an error importing an invalid ESM module - ✔ should resolve require("harperdb") to harper exports - ✔ should throw an error importing an ESM module with invalid dependency - ✔ should handle dynamic import() from a CJS module - import.meta compatibility - ✔ should populate import.meta.url, filename, dirname, and resolve for ESM modules - symlinked module resolution - ✔ should resolve relative CJS require through a symlinked module - ✔ should resolve relative ESM import through a symlinked module - Test keys module - ✔ Test loadCertificates loads certs from config file - ✔ Test getReplicationCert returns the correct cert - ✔ Test getReplicationCertAuth returns the correct CA - ✔ Test generateCertificates happy path - ✔ Test getCertAuthority happy path -[main/0] [notify] [tls]: A suitable replication certificate was not found, creating new self singed cert named: localhost - ✔ Test reviewSelfSignedCert create a new cert (184ms) - ✔ Test updateConfigCert builds new cert config correctly - ✔ hostnamesFromCert returns the correct hostnames - ✔ getPrimaryHostName with subject - ✔ can extract the hostnames from a certificate - ✔ Test setCertTable with malformed certificate - illegal ASN.1 padding - ✔ Test setCertTable with valid certificate should work - ✔ Test setCertTable error handling suggestion for cloneNode issue - ✔ Test generateCertAuthority includes subjectKeyIdentifier extension for OCSP support (378ms) - generateSerialNumber - ✔ should generate valid hex serial numbers - ✔ should generate positive ASN.1 integers (high bit cleared) - ✔ should generate unique serial numbers - updateConfigCert - HARPER_SET_CONFIG interaction - ✔ still writes tls_privateKey when HARPER_SET_CONFIG does not manage it - ✔ does not overwrite tls.privateKey managed by HARPER_SET_CONFIG - Test permissionsTranslator module - test structure_user scenarios - ✔ test structure_user = true - ✔ test structure_user = ["dev"] - Test getRolePermissions method - translation cases - ✔ All true table perms passed with one attribute_permissions object mixed values - ✔ All true table perms passed with one attribute_permissions object all true - ✔ All true table perms passed with one attribute_permissions object all values false - ✔ Mixed table perms passed with one attribute_permissions object all values false - ✔ Mixed table perms passed with one attribute_permissions object all values true - ✔ Mixed table perms passed with one attribute_permissions object with mixed values - ✔ Multiple tables perms passed with multiple attribute_permissions object with mixed values - ✔ All table perms passed are false with one attribute_permissions object all values false - schema.read perm should be false - Test getRolePermissions method - edge cases - ✔ All true table perms passed with no attribute_permissions - expect same perms returned - ✔ translateRolePermissions step should only use non-system schema values - ✔ Pass SU role - expect same permissions to be returned - ✔ Pass same role twice and expect cached permission returned the 2nd time - ✔ Pass roles w/ diff '__updatedtime__' and expect new, non-cached permissions returned both times - ✔ Pass same role w/ diff schema and expect different, non-cached permissions returned both times - Test getTableAttrPerms function - ✔ NOMINAL - should return table perms with correct system time and other perms values - ✔ Should ignore non-READ perms for system time when setting describe perm value - security/role.js - getRoleByName() - ✔ should pass correct search parameters - ✔ should return null when search returns no results - ✔ should return the first matching role - test getJWTRSAKeys function - ✔ test rsa_keys is undefined, happy path - ✔ test rsa_keys is undefined, passphrase file does not exist - ✔ test rsa_keys is undefined, private key file does not exist - ✔ test rsa_keys is undefined, public key file does not exist - ✔ test rsa_keys is defined - test createTokens - ✔ test validation - ✔ test happy path - ✔ test update failed - ✔ test update skipped the record - test validateOperationToken function - ✔ test hdb_admin token - ✔ test old_user token - ✔ test non-existent user - ✔ test bad token - ✔ test expired token - test validateRefreshToken function - ✔ test hdb_admin token - ✔ test old_user token - ✔ test non-existent user - ✔ test bad token - ✔ test expired token - test refreshOperationToken function - ✔ test no body - ✔ test no token - ✔ test hdb_admin token - ✔ test old_user token - ✔ test non-existent user - user.ts Unit Tests - Test addUser - ✔ should add four new users each with the correct hash function (99ms) - ✔ should throw an error if role is not found - Test alterUser - ✔ should alter a user password successfully - ✔ should throw an error if validation fails - Test dropUser - ✔ should drop a user successfully - ✔ should throw an error if user does not exist - Test findAndValidateUser - ✔ should find and validate a user successfully - ✔ should throw an error if user is inactive - ✔ should validate a user with no hash_function value - Test userInfo, listUsersExternal, getSuperUser and getClusterUser - ✔ should return user info - ✔ should return a list of users - ✔ should return the super user - Test custom functions operations - ✔ Test initial cf status values - Test custom function project operations - ✔ Test addComponent creates the project folder with the correct name - ✔ Test getCustomFunctions returns object with proper length and content - ✔ Test packageCustomFunctionProject properly tars up a project directory - ✔ Test setCustomFunction creates a function file as expected - ✔ Test setCustomFunction updates a function file as expected -[main/0] [info]: Empty parameter sent to getConfigValue - ✔ Test dropCustomFunctionProject drops project as expected - Test component operations - ✔ Test getComponents happy path (5001ms) - ✔ Test getComponents includes status information when component status exists - ✔ Test getComponents shows unknown status when component not in status map (5004ms) - ✔ Test getComponents handles getAggregatedFromAllThreads error gracefully - ✔ Test getComponents passes consolidatedStatuses to getAggregatedStatusFor - ✔ Test getComponents handles getAggregatedStatusFor errors gracefully - ✔ Test getComponents shows different statuses for different components - ✔ Test getComponentFile happy path - ✔ Test setComponentFile happy path - Test deployComponent force flag - ✔ Test deployComponent allows overwriting existing user component without force flag - ✔ Test deployComponent allows deploying new component without force flag - ✔ Test deployComponent prevents overwriting core component without force flag - ✔ Test deployComponent allows overwriting core component with force flag - ✔ Test deployComponent prevents overwriting multiple core component names - Test operationsValidation module - Test checkProjectExists function - ✔ Test message returned if project does not exist - ✔ Test project is returned if project exists - ✔ Test message is returned if fs exists throws error - Test checkFileExists function - ✔ Test message is returned if file does not exist - ✔ Test file is returned if it does exist - ✔ Test message is returned if fs exists throws error - Test getDropCustomFunctionValidator function - ✔ Test validation messages are returned - ✔ Test alphanumeric validation messages are returned - Test setCustomFunctionValidator function - ✔ Test validation messages are returned - ✔ Test alphanumeric validation messages are returned - Test addCustomFunctionProjectValidator function - ✔ Test validation messages are returned - ✔ Test alphanumeric validation messages are returned - Test dropCustomFunctionProjectValidator function - ✔ Test validation messages are returned - ✔ Test alphanumeric validation messages are returned - Test ipcUtils module - Test validateEvent function - ✔ Test non object error returned - ✔ Test missing type error returned - ✔ Test missing message error returned - ✔ Test invalid event type error returned - ✔ Test missing originator error returned - Test constructor functions - ✔ Test SchemaEventMsg - ✔ Test UserEventMsg - Test hdbChildIpcHandler module - Test user event handler function - ✔ Test User Handler log error upon setUsersWithRolesCache failure - ✔ Test User Handler calls setUsersWithRolesCache on valid event - ✔ Test User Handler logs error on invalid event (missing type) - ✔ Test User Handler logs error on invalid event (missing message) - ✔ Test User Handler addListener functionality - Test schema event handler function - ✔ Test Schema Handler logs error on invalid event (missing type) - ✔ Test Schema Handler logs error on invalid event (missing message) - Test componentStatusRequestHandler function - ✔ Test componentStatusRequestHandler logs error on invalid event (missing type) - ✔ Test componentStatusRequestHandler logs error on invalid event (missing message) - ✔ Test componentStatusRequestHandler logs error on invalid event (missing originator) - ✔ Test componentStatusRequestHandler processes valid event without error - Test ITCEventObject class - ✔ Test new ITCEventObject is correct shape - Test itcUtils module - Test validateEvent function - ✔ Test non object error returned - ✔ Test missing type error returned - ✔ Test missing message error returned - ✔ Test invalid event type error returned - ✔ Test missing originator error returned - Test constructor functions - ✔ Test SchemaEventMsg - ✔ Test UserEventMsg - Test parseMessage - ✔ Nominal case, parse with no errors - ✔ Invalid message json - ✔ Invalid operation specified - ✔ Invalid job id - ✔ Invalid job - ✔ Invalid json - ✔ Invalid runner message - ✔ Test the operation switch statement - Test runJob - ✔ Nominal case, run stubbed dataload - ✔ Throw exception during update to test error handling - ✔ Invalid message json - ✔ Invalid job id - ✔ Invalid job - ✔ Invalid json - ✔ Invalid runner message - ✔ Throw exception during csv data load - Test jobs.js - Test getJob & getJobsByStartDate handlers - ✔ nominal case, call handleGetJobsByStartDate. - ✔ nominal case, call handleGetJobsByStartDate if end_datetime - ✔ call getJobsInDateRange, throw an error to test catch. - ✔ nominal case, call handleGetJob - ✔ nominal case, call handleGetJob if end_datetime - ✔ call handleGetJob, throw an error to test catch. - Test addJob - ✔ nominal case, add a job to the schema. -[main/0] [info]: invalid job type specified: bad type. - ✔ test calling addJob, invalid job type, expect false. - ✔ test calling addJob with first search id collision, expect true -[main/0] [info]: job parameter is invalid - ✔ test calling addJob with null job. - ✔ test validation msg from CSV URL load is handled as expected - ✔ test validation msg from CSV data load is handled as expected - ✔ test validation msg from import S3 file is handled as expected - ✔ test error result is returned - ✔ test error result is returned when error with duplicate id search - ✔ test error result is returned when error with insert - ✔ test error result is returned when inserted hashes length is zero - Test getJobsInDateRange - ✔ nominal case, search in date ranges. - ✔ Search with invalid from date, expect error. - ✔ Search with invalid to date, expect error. - ✔ Search valid input, no results expected. - ✔ test custom error message is thrown - Test getJobById - ✔ nominal case, find 1 job by ID. - ✔ Search with null id, expect error - ✔ test custom error message is thrown - Test updateJob - ✔ Nominal case of updateJob - ✔ Nominal case of updateJob, check end time updated - ✔ Test bad object check - ✔ Test missing id check - topoSort - ✔ returns empty array unchanged - ✔ returns single element unchanged - ✔ preserves registration order when no constraints - ✔ enforces `before` constraint - ✔ enforces `after` constraint - ✔ preserves config order as tiebreaker: auth before rest when both unconstrained - ✔ config: rest, authentication, static → auth pulled before rest - ✔ `before` applies to the FIRST registered entry with that name - ✔ `after` applies to the LAST registered entry with that name - ✔ reference to unknown name is a no-op - ✔ calls onCycle and returns original order when cycle detected - buildLinearChain - ✔ returns fallback when entry list is empty - ✔ calls the single listener with (request, next) - ✔ calls listeners in sorted order and threads next correctly - ✔ short-circuits when a listener returns without calling next - resolveDeps - ✔ returns same entries when no after deps - ✔ pulls in a dep that is in the registry but not the entry list - ✔ resolves transitive deps: A after B, B after C - ✔ does NOT pull in entries referenced only by `before` - ✔ ignores unknown dep names - matchesRoute - ✔ matches everything when no constraints - ✔ matches exact urlPath - ✔ matches urlPath with sub-path - ✔ does NOT match a path that is merely a string-prefix (segment boundary required) - ✔ does NOT match a completely different path - ✔ matches virtual host (ignoring port in Host header) - ✔ does NOT match wrong host - ✔ requires both host and urlPath to match - makeCallbackChain - ✔ flat chain: no sub-routes, calls middleware in registration order - ✔ flat chain: before/after constraints override registration order - ✔ filters by port: only includes matching port entries - ✔ port "all" entries appear in every port chain - ✔ routes to sub-chain by urlPath - ✔ routes to sub-chain by host - ✔ sub-route auto-pulls auth via `after` dependency - ✔ sub-route with `after` dep: dep runs once, not twice - ✔ specificity: host+path wins over path-only for same urlPath prefix - ✔ longer urlPath wins over shorter prefix - stripPrefix - ✔ strips the prefix from pathname - ✔ strips the prefix from url - ✔ returns "/" when pathname equals prefix exactly - ✔ does not mutate the original request - ✔ sub-route chain receives stripped pathname - ✔ sub-route chain receives "/" for exact prefix match - ✔ default chain receives unmodified pathname - ✔ treats trailing slash on prefix as equivalent (no malformed paths) - ✔ reflects downstream pathname mutations (lazy evaluation) - normalizeUrlPath - ✔ returns undefined for undefined/empty - ✔ preserves root "/" - ✔ strips a single trailing slash - ✔ leaves paths without trailing slash unchanged - matchesRoute with trailing slash - ✔ matches sub-paths when route.urlPath ends with "/" - variadic dispatch with requestArgIndex - ✔ forwards all positional args to the inner chain (default chain) - ✔ routes by urlPath using arg at requestArgIndex, preserves other args (sub-route) - ✔ upgrade-style signature: forwards (request, socket, head) when routing - onCycle callback - ✔ invokes onCycle and falls back to registration order when cycles exist - ✔ is wired through makeCallbackChain - Test operationsServer module - Test calculateRestHttpURL - ✔ Chooses https when httpSecurePort provided - ✔ Chooses can use non-standard ports - ✔ Chooses http when httpSecurePort not provided - ✔ Uses configured port instead of the one from the request - ✔ Uses configured port instead of the one from the request - ✔ Uses port from the request if not otherwise configured - ✔ Uses the hostname from the request - ✔ Assume port forwarding and SSL termination with non-localhost, non-ips - REST - parseHeaderValue - ✔ should not be vulnerable to denial of service - Test Headers - Create and modify headers - ✔ should handle headers - ✔ should handle append with commas - ✔ should handle append with commas on a Map - ✔ construct headers from object - ✔ construct headers from Map and merge - ✔ should handle multiple Set-Cookie headers correctly - ✔ should keep non-Set-Cookie headers with arrays merged (not split) - ✔ should handle set() with array values and ensure array elements are strings - ✔ should handle appendHeader with headers.set path (no append method) - ✔ should handle appendHeader with plain object (no set or append) - ✔ should handle mergeHeaders with Set-Cookie on target without append method - ✔ should handle mergeHeaders with Set-Cookie on target with append method - ✔ should handle mergeHeaders with plain object target - ✔ should handle mergeHeaders with single Set-Cookie value (not array) - ✔ should handle mergeHeaders with Map target and single existing Set-Cookie - ✔ should handle mergeHeaders with Map target and array existing Set-Cookie - ✔ should verify mergeHeaders returns the same target (modifies in place) - Test JSONStream module - Streaming - ✔ Streams object - ✔ Streams array - ✔ Streams generator - ✔ Streams async generator - Request class - peerCertificate getter - ✔ should call getPeerCertificate with true to get full certificate chain - ✔ should return null when socket has no certificate - ✔ should handle empty certificate object - ✔ should ensure certificate chain is available for OCSP verification - other getters - ✔ should return correct protocol based on socket encryption - ✔ should return correct IP address - ✔ should return authorized status - ✔ should return mtlsConfig from server - ✔ should return correct pathname - ✔ should return correct host - ✔ should return correct absoluteURL - ✔ should handle pathname setter - ✔ should return httpVersion - ✔ should return isAborted status - body getter - ✔ should create RequestBody instance lazily - ✔ should proxy event handling to node request - ✔ should proxy pipe to node request - sendEarlyHints method - ✔ should send early hints with link header - ✔ should merge link with additional headers - withNodeAdapter - nodeRequest argument - ✔ reflects current method and url - ✔ reflects middleware-mutated headers - ✔ has lowercase header keys - ✔ delegates socket to the underlying IncomingMessage socket - nodeResponse — writeHead - ✔ resolves response with correct status and headers - ✔ is idempotent — second writeHead call is a no-op - ✔ accepts array-of-pairs header format - ✔ accepts flat alternating-array header format - ✔ sets headersSent after writeHead - nodeResponse — setHeader / end path - ✔ resolves response with headers set before end() - ✔ captures statusCode set directly - ✔ getHeader / hasHeader / removeHeader work - nodeResponse — body streaming - ✔ end() with a chunk delivers the body - ✔ multiple write() calls are streamed in order - ✔ end() with no body yields an empty body - ✔ sets writableEnded after end() - ✔ emits finish event after body is fully written - ✔ write() invokes callback-as-second-arg after chunk is written - ✔ end() invokes callback-as-second-arg after body is flushed - nodeResponse — setHeader multi-value - ✔ preserves Set-Cookie as separate values - ✔ setHeader with a single string value works normally - nodeResponse — destroy - ✔ rejects the response promise with the provided error - ✔ rejects the response promise when destroyed with no error - ✔ does not reject the response promise when destroy called after headers flushed - ✔ propagates destroy error to body consumer after headers are flushed - async handler - ✔ rejects the response promise when async handler throws before writing headers - ✔ does not double-reject after headers are flushed when async handler throws - Headers class - ✔ should get headers case-insensitively - ✔ should set headers case-insensitively - ✔ should check header existence case-insensitively - ✔ should delete headers case-insensitively - ✔ should iterate over headers - ✔ should return header keys - ✔ should return header values - ✔ should iterate with forEach - test requestTimePlugin - ✔ test Server-Timing header - Test serverHandlers.js module - handleServerUncaughtException() - ✔ Should send error to console and log before exiting process - serverErrorHandler() - ✔ Should send a response with error message and 500 code when an plain Error is passed - ✔ Should send a response with custom error message and 400 code when included in error passed - ✔ Should send a response with custom error message object and 400 code when included in error passed - ✔ Should send a response with custom error message object when included in standard error type passed - ✔ Should send a response with custom message object when included when an object is passed - ✔ Should handle error passed as a string - reqBodyValidationHandler() - ✔ Should not reject if request is valid - ✔ Should throw error if request has no body - ✔ Should throw error if request includes an empty body object - ✔ Should throw error if request body is a string/not valid JSON - ✔ Should throw error if request body does not include an `operation` property - ✔ Should throw error if request body does not include an value in its `operation` property - authHandler() - ✔ Should pass auth for valid nominal request - ✔ Should pass auth for valid request for create auth tokens operation - ✔ Should throw error if thrown from auth - authAndEnsureUserOnRequest() - ✔ Should pass auth for valid nominal request - ✔ Should pass auth for valid request for create auth tokens operation - ✔ Should throw error if thrown from auth - handlePostRequest() - ✔ Should return the result from the operation function - ✔ Should call processLocalTransaction with result of chooseOperation - ✔ Should handle error thrown from chooseOperation - ✔ Should handle error thrown from processLocalTransaction - Test serverUtilities.js module - Test chooseOperation - ✔ Nominal path with insert operation. - ✔ Invalid operation specified in json. - test getOperationFunction - ✔ test insert - ✔ test update - ✔ test upsert - ✔ test SEARCH_BY_HASH - ✔ test SEARCH_BY_VALUE - ✔ test SEARCH - ✔ test SQL - ✔ test CSV_DATA_LOAD - ✔ test CSV_FILE_LOAD - ✔ test CSV_URL_LOAD - ✔ test CREATE_SCHEMA - ✔ test CREATE_TABLE - ✔ test CREATE_ATTRIBUTE - ✔ test DROP_SCHEMA - ✔ test DROP_TABLE - ✔ test DROP_ATTRIBUTE - ✔ test DESCRIBE_SCHEMA - ✔ test DESCRIBE_TABLE - ✔ test DESCRIBE_ALL - ✔ test DELETE - ✔ test ADD_USER - ✔ test ALTER_USER - ✔ test DROP_USER - ✔ test LIST_USERS - ✔ test LIST_ROLES - ✔ test ADD_ROLE - ✔ test ALTER_ROLE - ✔ test DROP_ROLE - ✔ test USER_INFO - ✔ test READ_LOG - ✔ test SET_CONFIGURATION - ✔ test EXPORT_TO_S3 - ✔ test DELETE_FILES_BEFORE - ✔ test EXPORT_LOCAL - ✔ test SEARCH_JOBS_BY_START_DATE - ✔ test GET_JOB - ✔ test RESTART - ✔ test CATCHUP - ✔ test SYSTEM_INFORMATION - ✔ test DELETE_AUDIT_LOGS_BEFORE - ✔ test READ_AUDIT_LOG - Test processLocalTransaction - ✔ Should return results from callOperationFunctionAsAwait() method - ✔ Should handle error thrown from callOperationFunctionAsAwait() method - ✔ Should handle error returned from operation function caller - ✔ Should wrap non-object results in message object - ✔ Should not log request body for read_log operation - ✔ Should strip sensitive fields from logged request body - server.status.definitions - constants - ✔ should export STATUS_DEFINITIONS with correct structure - ✔ should export STATUS_IDS with all status types - ✔ should export DEFAULT_STATUS_ID as primary - exported constants structure - ✔ should ensure STATUS_IDS contains all keys from STATUS_DEFINITIONS - ✔ should validate the structure of exported constants - server.status - ✔ should set status - ✔ should get specific status - ✔ should get complete status with just primary set - ✔ should get complete status - ✔ should fail validation on test status - ✔ should validate availability status values - getAllStatus functionality - ✔ should return system status, component status, and restart flag when calling get without id - ✔ should handle empty component status gracefully - ✔ should continue working if component status functions are unavailable - storageReclamation module - onStorageReclamation - ✔ should register handler when skipThreadCheck is true - ✔ should register handler on last worker thread - ✔ should not register handler on non-last worker thread - ✔ should register multiple handlers for the same path - ✔ should register handlers for different paths - ✔ should set reclamation timer after first handler registration - ✔ should not create duplicate timers on subsequent registrations - ✔ should initialize handler entry with priority 0 - setAvailableSpaceRatioGetter - ✔ should allow setting custom space ratio getter - ✔ should reset to default getter when passed null - runReclamationHandlers - ✔ should not call handler when space is above threshold -[main/0] [info]: Running storage reclamation handler for /test/path with priority 2 - ✔ should call handler when space is below threshold -[main/0] [info]: Running storage reclamation handler for /test/path with priority 2 -[main/0] [info]: Running storage reclamation handler for /test/path with priority 0.5 - ✔ should call handler with priority 0 after space is reclaimed -[main/0] [info]: Running storage reclamation handler for /path/low with priority 2 - ✔ should handle multiple paths independently - ✔ should handle errors in space ratio getter gracefully -[main/0] [info]: Running storage reclamation handler for /test/path with priority 2 - ✔ should handle errors in handler gracefully -[main/0] [info]: Running storage reclamation handler for /test/path with priority 2 -[main/0] [info]: Running storage reclamation handler for /test/path with priority 2 - ✔ should call multiple handlers for the same path - ✔ should not log when handler returns undefined - ✔ should not call handler when space is exactly at threshold - ✔ should reschedule timer after running handlers -[main/0] [info]: Running storage reclamation handler for /test/path with priority 2 - ✔ should update entry priority after each run -[main/0] [info]: Running storage reclamation handler for /test/path with priority 2 -[main/0] [info]: Running storage reclamation handler for /test/path with priority 0.5 - ✔ should not call handler on third run when space stays normal -[main/0] [info]: Running storage reclamation handler for /path/ok with priority 2 - ✔ should continue processing other paths after one path errors - throttle test - ✔ will throttle calls to a function - ✔ will limit the queue length of throttled functions (100ms) - ✔ throttled calls propagate errors - UDS mirror (writeUdsMetadata, cleanup helpers) - writeUdsMetadata - ✔ writes pid, tid, and port to the YAML file - ✔ writes certificate name and hostnames - ✔ writes certificate PEM as a YAML block scalar - ✔ includes privateKeyFile path when key_file is present - ✔ writes certificate authorities when present - ✔ writes empty certificates list when secureContexts is empty - ✔ de-duplicates contexts that are shared across multiple hostnames - ✔ logs an error if the file cannot be written - registerUdsCleanupPaths + cleanupUdsFiles - ✔ cleanupUdsFiles removes registered socket and yaml files - ✔ cleanupUdsFiles does not throw when files are already gone - cleanupSocketsDirectory - ✔ removes all files in the sockets directory when enabled - ✔ does nothing when tls.unixDomainSockets is not enabled - ✔ does not throw when the sockets directory does not exist - Test functions from alasqlFunctionImporter w/ alasql - ✔ should return CURRENT_DATE() value in YYYY-MM-DD format - ✔ should return CURRENT_TIME() value in HH:mm:ss.SSS format - ✔ should EXTRACT the correct date parts - ✔ should return DATE() value in YYYY-MM-DDTHH:mm:ss.SSSZZ format - ✔ should return DATE_FORMAT() value in provided format - ✔ should return correct new date after time is added in DATE_ADD() - ✔ should return correct new date after time is subtracted in DATE_SUB() - ✔ should return correct difference between the two dates provided to DATE_DIFF() - ✔ should return correct difference between the two dates based on interval provided to DATE_DIFF() - ✔ should return NOW() value in unix epoch format - ✔ should return GETDATE() value in unix epoch format - ✔ should return CURRENT_TIMESTAMP value in unix epoch format - ✔ should return GET_SERVER_TIME value as local timestamp in YYYY-MM-DDTHH:mm:ss.SSSZZ format - ✔ should return OFFSET_UTC value in YYYY-MM-DDTHH:mm:ss.SSSZZ format - Test sql_statement_bucket Class - Test getDeleteAttributes - ✔ Nominal, pull attributes in delete statement - ✔ Pull attributes from delete statement with no where clause - ✔ Pull attributes from delete statement with no table clause - Test getInsertAttributes - ✔ Nominal, pull attributes in Insert statement - ✔ Pull attributes from insert statement with no table clause - Test getUpdateAttributes - ✔ Nominal, pull attributes in update statement - ✔ Pull attributes from update statement with no table clause - Test getSelectAttributes - ✔ Nominal, pull attributes in Select statement - ✔ Nominal, pull attributes in Select statement with cross schema join - ✔ Pull attributes from insert statement with no table clause - Test getRecordAttributesAST - ✔ Nominal case, valid, reasonably complex AST with attributes. - ✔ Nominal case, valid AST with CROSS SCHEMA JOIN -[main/0] [info]: table specified as steffen not found. - ✔ Nominal case, INVALID table in WHERE, reasonably complex AST with attributes. - Test getAttributesBySchemaTableName - ✔ Nominal, get attributes expected from select parsing - Test getAllTables - ✔ Nominal, get all tables expected from select parsing - Test getAllTables - ✔ Nominal, get all tables expected from select parsing - Test AWSConnector module - Test getS3AuthObj function - ✔ should return value from call to new S3 object returned from getS3AuthObj - Test common_utils module - ✔ Test ms_to_time - Test errorizeMessage - ✔ Nominal, pass message - ✔ Pass in null - ✔ Pass in undefined - Test isEmpty - ✔ Pass in null value, expect true - ✔ Pass in undefined value, expect true - ✔ Pass in value, expect false - ✔ Pass in empty value, expect false - Test isEmptyOrZeroLength - ✔ Pass in null value, expect true - ✔ Pass in undefined value, expect true - ✔ Pass in value, expect false - ✔ Pass in empty value, expect true - ✔ Pass in 0, expect true - ✔ Pass in string with all spaces, expect false - Test listHasEmptyValues - ✔ Pass in null value, expect true - ✔ Pass in null value, expect true - ✔ Pass in undefined value, expect true - ✔ Pass in value, expect false - ✔ Pass in empty value, expect false - Test listHasEmptyOrZeroLengthValues - ✔ Pass in null value, expect true - ✔ Pass in null value, expect true - ✔ Pass in undefined value, expect true - ✔ Pass in value, expect false - ✔ Pass in empty value, expect true - Test buildFolderPath - ✔ Pass in null, expect empty string - ✔ Pass in empty string, expect empty string - ✔ Pass in values with mixed null and empty string, expect double slashes where empty values would be - ✔ Pass in values mixed with numbers and strings, expect a path - Test isBoolean - ✔ Pass in null, expect false - ✔ Pass in undefined, expect false - ✔ Pass in empty string, expect false - ✔ Pass in spaces, expect false - ✔ Pass in string, expect false - ✔ Pass in 1, expect false - ✔ Pass in 0, expect false - ✔ Pass in number, expect false - ✔ Pass in array, expect false - ✔ Pass in object, expect false - ✔ Pass in true, expect true - ✔ Pass in false, expect true - ✔ Pass in evaluation, expect true - Test autoCast - ✔ Pass in null, expect null - ✔ Pass in 0.10056344792246819, expect 0.10056344792246819 as number - ✔ Pass in "0.059_111.519", expect "0.059_111.519" as string - ✔ Pass in "0.059,111.519", expect "0.059,111.519" as string - ✔ Pass in "0.059.111.519", expect "0.059.111.519" as string - ✔ Pass in undefined, expect undefined - ✔ Pass in empty string, expect empty string - ✔ Pass in spaces, expect spaces - ✔ Pass in string of null, expect null - ✔ Pass in string of undefined, expect undefined - ✔ Pass in string of true, expect boolean true - ✔ Pass in uppercase string of true, expect boolean true - ✔ Pass in uppercase string of false, expect boolean false - ✔ Pass in uppercase string of null, expect value of null - ✔ Pass in string of 42, expect number 42 - ✔ Pass in string of 0, expect number 0 - ✔ Pass in string of 42.42, expect number 42.42 - ✔ Pass in string of '0102', expect string '0102' - ✔ Pass in string surrounded by brackets, expect string surrounded by brackets - ✔ Pass in false, expect false - ✔ Pass in true, expect true - ✔ Pass in 1, expect 1 - ✔ Pass in 0, expect 0 - ✔ Pass in date , expect date back - ✔ Pass in array , expect array back - ✔ Pass in array of various values , expect array back - ✔ Pass in object , expect object back - ✔ Pass in number with e in it , string back - ✔ Pass in number with e in it , string back 2 - ✔ Pass in number with e in it , string back 3 - ✔ Pass in number with a in it , string back 3 - ✔ Pass in number with E in it , string back - ✔ Pass in number with E in it , string back 2 - ✔ Pass in number with E in it , string back 3 - ✔ Pass in number with A in it , string back 3 - autoCastBooleanStrict - ✔ should cast "true" to true - ✔ should cast "false" to false - ✔ should cast "TRUE" to true - ✔ should cast "FALSE" to false - ✔ should cast "True" to true - ✔ should cast "False" to false - ✔ should cast "TrUe" to true - ✔ should cast "FaLsE" to false - ✔ should leave "foo" intact - ✔ should leave 42 intact - ✔ should leave an object intact - Test escapeRawValue - ✔ Pass in null, expect null - ✔ Pass in undefined, expect undefined - ✔ Pass in "", expect "" - ✔ Pass in ".", expect "U+002E" - ✔ Pass in "..", expect "U+002EU+002E" - ✔ Pass in "...", expect "..." - ✔ Pass in "words..", expect "words.." - ✔ Pass in "word.s.", expect "word.s." - ✔ Pass in "hello/this/is/some/text", expect "helloU+002FthisU+002FisU+002FsomeU+002Ftext" - Test unescapeValue - ✔ Pass in null, expect null - ✔ Pass in undefined, expect undefined - ✔ Pass in "", expect "" - ✔ Pass in "U+002E", expect "." - ✔ Pass in "U+002EU+002E", expect ".." - ✔ Pass in "words..", expect "words.." - ✔ Pass in "word.s.", expect "word.s." - ✔ Pass in "wordsU+002EU+002E", expect "wordsU+002EU+002E" - ✔ Pass in "wordU+002EsU+002E", expect "wordU+002EsU+002E" - ✔ Pass in "hello/this/is/some/text", expect "hello/this/is/some/text" - ✔ Pass in "helloU+002FthisU+002FisU+002FsomeU+002Ftext" , expect "hello/this/is/some/text" - Test checkGlobalSchemaTable - ✔ should throw schema does not exist message - ✔ should throw table does not exist message - Test removeBOM function - ✔ Test that the BOM is removed - ✔ Test if parameter not string error thrown - Test checkSchemaTableExist - - Test no schema - - Test no table - Test isObject - ✔ Should return true with simple object - ✔ Should return true with array - ✔ Should return false with string - ✔ Should return false with null - Test environmentManager module - Test getHdbBasePath - ✔ Test that getHdbBasePath and setHdbBasePath - Test get function - ✔ Test expected value is returned - ✔ Test if value is undefined it returns undefined - Test setProperty function - ✔ Test expected values are passed - ✔ Test with invalid property, expect exception - Test doesPropFileExist function - ✔ Test it returns true - ✔ Test it catches error, logs trace message, and returns false - Test initSync function - ✔ Tests config env initialized - Test initTestEnvironment function - - Test properties are set with no test config obj - - Test properties are set with test config obj - test systemInformation module - ✔ test getSystemInformation function (102ms) - ✔ call getSystemInformation 2nd time to test cache - ✔ test getTimeInfo function - ✔ test getCPUInfo function (73ms) - ✔ test getMemoryInfo function - ✔ test getDiskInfo function (67ms) - ✔ test getNetworkInfo function (727ms) - ✔ test getHDBProcessInfo function (1583ms) - ✔ test systemInformation function fetch all attributes (91ms) - ✔ test systemInformation function fetch some attributes - ✔ test systemInformation function fetch all of the attributes (75ms) - ✔ test getTableSize function - Test geoArea - ✔ Pass in no argument geoJSON, expect error - ✔ Pass in null value, expect error - ✔ Pass in number value, expect error - ✔ Pass in polygon geojson, expect 4559449.809365065 - ✔ Pass in point geojson, expect 0 - Test geoLength - ✔ Pass in no argument geoJSON, expect error - ✔ Pass in null value, expect error - ✔ Pass in number value, expect error - ✔ Pass in polygon geojson and invalid units, expect error - ✔ Pass in polygon geojson, expect 10.037307809946478 - ✔ Pass in polygon geojson and miles, expect 6.236893920719556 - ✔ Pass in point geojson and radians, expect 0 - ✔ Pass in line geojson, expect 1.359089002130181 - Test geoCircle - ✔ Pass in no argument geoJSON, expect error - ✔ Pass in null value, expect error - ✔ Pass in number value, expect error - ✔ Pass in point value but no radius, expect error - ✔ Pass in point, radius and invalid units, expect error - ✔ Pass in point, radius of 1, expect matching polygons - ✔ Pass in point, radius of 1 in miles, expect matching polygons - Test geoDifference - ✔ Pass in no argument geoJSON, expect error - ✔ Pass in null value, expect error - ✔ Pass in first poly and null, expect error - ✔ Pass in null, second poly, expect error - ✔ Pass in number value, expect error - ✔ Pass mile poly and kilometer poly to diff, expect matching polygons - ✔ Pass kilometer poly and mile poly to diff, expect null - Test geoDistance - ✔ Pass in no argument geoJSON, expect error - ✔ Pass in null value, expect error - ✔ Pass in first poly and null, expect error - ✔ Pass in null, second poly, expect error - ✔ Pass in number value, expect error - ✔ Pass in 2 points, no units, expect 1.359089002130181 - ✔ Pass in 2 points, second as array, expect 1.359089002130181 - ✔ Pass in 2 points, second as array as string, expect 1.359089002130181 - ✔ Pass in 2 points, miles, expect 0.8444987536102792 - Test geoNear - ✔ Pass in no argument geoJSON, expect error - ✔ Pass in null value, expect error - ✔ Pass in first poly and null, expect error - ✔ Pass in null, second poly, expect error - ✔ Pass in number value, expect error - ✔ Pass in 2 points and a non-numeric value for distance, expect error - ✔ Pass in 2 points, distance of 1, no units expect false - ✔ Pass in 2 points, distance of 1, no units, second as string expect false - ✔ Pass in 2 points,distance of 1, units of miles, expect true - Test geoContains - ✔ Pass in no argument geoJSON, expect error - ✔ Pass in null value, expect error - ✔ Pass in first poly and null, expect error - ✔ Pass in null, second poly, expect error - ✔ Pass in number value, expect error - ✔ Pass in 1 mile radius and enterprise coworking point, expect true - ✔ Pass in 2 polys, expect false - Test geoEqual - ✔ Pass in no argument geoJSON, expect error - ✔ Pass in null value, expect error - ✔ Pass in first poly and null, expect error - ✔ Pass in null, second poly, expect error - ✔ Pass in number value, expect error - ✔ Pass in 1 mile radius and enterprise coworking point, expect false - ✔ Pass in 2 unmatching points, expect false - ✔ Pass in 2 matching points, expect true - ✔ Pass in 2 matching points, second as string, expect true - Test geoCrosses - ✔ Pass in no argument geoJSON, expect error - ✔ Pass in null value, expect error - ✔ Pass in first poly and null, expect error - ✔ Pass in null, second poly, expect error - ✔ Pass in number value, expect error - ✔ Pass in 1 mile radius and enterprise coworking point, expect true - ✔ Pass in 2 unmatching points, expect false - ✔ Pass in 2 matching points, expect true - ✔ Pass in 2 polys where one exists in the other, expect true - Test geoConvert - ✔ Pass in no argument geoJSON, expect error - ✔ Pass in null value, expect error - ✔ Pass in coordinates and null, expect error - ✔ Pass in null, geo type, expect error - ✔ Pass in number value, expect error - ✔ Pass in coordinates & invalid type, expect error - ✔ Pass in point coodinates, matches geo json point - ✔ Pass in line coodinates, matches geo json line - ✔ Pass in polygon coodinates, matches geo json polygon - test alaSQLExtension module - test searchJSON function - ✔ pass no args - ✔ pass null to first arg - ✔ pass empty string to first arg - ✔ pass number to first arg - ✔ pass no value to 2nd arg - ✔ pass null value to 2nd arg - ✔ pass number to 2nd arg - ✔ basic test - Test getTableSchema function - - Can get dog table from dev schema - - Can get table from dog schema - - Can get table from bird schema - - Can get table hdb_attribute from system schema - - Can get table hdb_schema from system schema - - Can get table hdb_user from system schema - - Can get table hdb_role from system schema - - Can get table hdb_job from system schema - - Can get table hdb_license from system schema - - Can get table hdb_nodes from system schema - - Error should be shown when trying to get the table that doesn't have in system and dev schema - - Error should be shown when trying to get the table that doesn't have in system and dev - Test if no table object - - Should show error when get not have table on dev schema - Test if have dog table object - - global.hdb_schema["dev"]["dog"] Should equal TABLE_INFO_DEV_DOG - - if global.hdb_schema is empty - - if dev schema is empty - Test if have cat table object - - global.hdb_schema["dev"]["cat"] Should equal TABLE_INFO_DEV_CAT - - if global.hdb_schema is empty - - if dev schema is empty - Test if have bird table object - - global.hdb_schema["dev"]["bird"] Should equal TABLE_INFO_DEV_BIRD - - if global.hdb_schema is empty - - if dev schema is empty - Test getSystemSchema function - - Should equal system_schema json - test checkJWTTokenExist function - ✔ test happy path (237ms) - ✔ test keys exist - Test isHdbInstalled function - ✔ Test two calls to fs stat with the correct arguments happy path - ✔ Test ENOENT err code returns false - ✔ Test non ENOENT error is handled as expected - Test harper_logger module - ✔ Test suppressLogging function - Test initLogSettings function - ✔ Test that all log settings values are initialized if settings file exists - ✔ Test that if error code is not ENOENT error is handled correctly - Test createLogRecord function - ✔ Test record is correctly returned if message is a string - ✔ Test record is correctly returned if message array has multiple args with object - ✔ Test record is correctly returned if called by an instance of an error - ✔ Test record is correctly returned if message is an object - ✔ Test record is correctly returned if message is an error with a cause - Test notify, fatal, error, warn, info, debug, and trace functions - - Test info log logs to file and stream for non-processManagement process - - Test info log writes to stdout for processManagement process - - Test trace log logs to file and stream for non-processManagement process - - Test trace log writes to stdout for processManagement process - - Test error log logs to file and stream for non-processManagement process - - Test error log writes to stdout for processManagement process - - Test debug log logs to file and stream for non-processManagement process - - Test debug log writes to stdout for processManagement process - - Test notify log logs to file and stream for non-processManagement process - - Test notify log writes to stdout for processManagement process - - Test fatal log logs to file and stream for non-processManagement process - - Test fatal log writes to stdout for processManagement process - - Test warn log logs to file and stream for non-processManagement process - - Test warn log writes to stdout for processManagement process - Test getPropsFilePath function - ✔ Test home dir returned if os.homedir throws error - ✔ Test root dir used if home dir undefined - Test setLogLevel function - ✔ Test the correct hierarchical logs are logged when level set to trace (100ms) - ✔ Test the correct hierarchical logs are logged when level set to debug (101ms) - ✔ Test the correct hierarchical logs are logged when level set to info (101ms) - ✔ Test the correct hierarchical logs are logged when level set to warn (101ms) - ✔ Test the correct hierarchical logs are logged when level set to error (100ms) - ✔ Test the correct hierarchical logs are logged when level set to fatal (100ms) - ✔ Test the correct hierarchical logs are logged when level set to notify (101ms) - Test setLogLevel function on conditional logger - ✔ Test the correct hierarchical logs are available when level set to debug - ✔ Test the correct hierarchical logs are available when level set to warn - ✔ Test the correct hierarchical logs are available when level set to fatal - Test HTTP logger -[main/0] [info] [http]: GET /test HTTPS/1.1 content-type: application/json 200 3.71ms id: 1 - ✔ Test the correct output from HTTP logger on GET (101ms) -[main/0] [info] [http]: POST /post-test HTTP/1.1 content-type: application/json 201 5.13ms id: 2 - ✔ Test the correct output from HTTP logger on POST (101ms) - Test global logger - ✔ Test using the global logger (100ms) - ✔ Test using an application scoped logger (102ms) - Test logRotator module -[main/0] [notify]: hdb.log rotated, old log moved to /home/kzyp/dev/ts-fixes/unitTests/utility/logging/testLogger/HDB-2026-05-12T22-27-29.115Z.log - ✔ Test that log file is rotated if log has exceeded max size (350ms) -[main/0] [notify]: hdb.log rotated, old log moved to /home/kzyp/dev/ts-fixes/unitTests/utility/logging/testLogger/HDB-2026-05-12T22-27-29.466Z.log - ✔ Test that log file is rotated if interval has exceeded its set value (351ms) -[main/0] [notify]: hdb.log rotated, old log moved to /home/kzyp/dev/ts-fixes/unitTests/utility/logging/testLogger/HDB-2026-05-12T22-27-29.817Z.log -rotated log contents 2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 1 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 2 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 3 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 4 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 5 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 6 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 7 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 8 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 9 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 10 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 11 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 12 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 13 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 14 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 15 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 16 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 17 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 18 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 19 -2026-05-12T22:27:29.666Z [main/0] [error]: This log is coming from the logRotator unit test. Log number: 20 - ✔ Test log is compressed when rotated (351ms) - ✔ Test error logged if max size and interval not defined (51ms) - ✔ Test error logged if rotation path is undefined (51ms) - Test readLog module - Test readLog function - ✔ Test bad request throws validation error - ✔ Test no filter with correct number of logs returned - ✔ Test if level, from, and until are defined, correct results are returned - ✔ Test if level, from, and until are defined, PLUS start, correct results are returned - ✔ Test if level and from are defined, correct results are returned - ✔ Test if level and from are defined, PLUS start, correct results are returned - ✔ Test if level and until are defined, correct results are returned - ✔ Test if level and until are defined, PLUS count and start, correct results are returned - ✔ Test if from and until are defined, correct results are returned - ✔ Test if from and until are defined, PLUS limit, correct results are returned - ✔ Test if level is defined, correct results are returned - ✔ Test if level is defined, PLUS desc order, correct results are returned - ✔ Test if level is defined, PLUS asc order, correct results are returned - ✔ Test if there are no logs for the given parameters, empty array returned - ✔ Test if until is defined, correct results are returned - Test pushLineToResult function - ✔ Test if order is desc, line handled correctly - ✔ Test if order is asc, line handled correctly - ✔ Test line added to array if order not specified - Test insertDescending and insertAscending functions - ✔ Test insertDescending adds value to array in correct position - ✔ Test insertAscending adds value to array in correct position - test mount_hdb module -[main/0] [info]: Directory mount/test/hdb created -[main/0] [info]: Directory mount/test/hdb/backup created -[main/0] [info]: Directory mount/test/hdb/keys created -[main/0] [info]: Directory mount/test/hdb/log created -[main/0] [info]: Directory mount/test/hdb/database created -[main/0] [info]: Directory mount/test/hdb/components created - ✔ Test mountHdb calls makeDirectory happy path - Test operation_authorization - ✔ required_permissions should include settings for all API operations - Test verifyPermsAst - ✔ NOMINAL, test verify with proper syntax, expect true -[main/0] [info]: Required insert permission not found for insertData operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 - ✔ Test verify AST with table insert perm false, expect false - ✔ Test verify AST with table perm true but all attr perms false, expect false -[main/0] [info]: operation fart not found. - ✔ Test with bad operations, expect false - ✔ Test select wildcard with proper perms, expect true - ✔ Test select wildcard with read attribute restriction false, expect false - ✔ Test select wildcard with one attribute permission true, expect true - ✔ Test cannot delete from system table error returned - Test verifyPerms -[main/0] [info]: null required parameter in verifyPerms - ✔ Pass in bad values, expect false - ✔ Check return if user has su. Expect true -[main/0] [info]: No role permissions set (this is OK). - ✔ Pass function instead of function name. Expect empty array (no errors) -[main/0] [info]: No role permissions set (this is OK). - ✔ Pass function name instead of function. Expect empty array (no errors) - ✔ Pass in JSON with no schemas restrictions defined, expect invalid schema error - ✔ Pass in JSON with schemas but no table perms defined, expect perms errors - ✔ Pass in JSON with schemas and table dog defined but describe false for all, expect invalid schema result - ✔ (NOMINAL) - Pass in JSON with schemas and table dog defined, insert allowed, expect true - ✔ Pass in JSON with schemas and table dog defined, insert allowed, attr insert restriction false. expect false - ✔ Pass in get_job request as non-super user. expect true - ✔ Pass in search_jobs_by_start_date request as super user. expect true -[main/0] [info]: operation handleGetJobsByStartDate requires SU permissions. - ✔ Pass in search_jobs_by_start_date request as non-super user. expect false - ✔ Pass in get_job request as super user. expect true -[main/0] [info]: Required read permission not found for test method operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 - ✔ Test operation with read & insert required, but user only has insert. False expected - ✔ Pass in JSON with operation = update and with fully restricted timestamp attr, expect false - ✔ Pass in JSON with operation = update and with non-restricted timestamp value, expect error - ✔ (NOMINAL) - Pass in JSON with action = insert, insert allowed, expect true - ✔ Pass in JSON with action = update, TABLE fully restricted, expect error -[main/0] [info]: Required update permission not found for csvDataLoad update operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 - ✔ Pass in JSON with action = update, TABLE update restricted, expect error -[main/0] [info]: operation bad method not found. - ✔ Test bad method. False expected - ✔ NOMINAL - Pass in JSON with su, function that requires su. Expect true. -[main/0] [info]: operation addUser requires SU permissions. - ✔ Pass in JSON with no su, function that requires su. Expect false. - ✔ Test error is thrown from trying to drop system schema - ✔ Test error is thrown from trying to drop system table - ✔ Test error is thrown from trying to drop system attribute - ✔ Test create_schema with structure_user = true -[main/0] [info]: operation createSchema requires SU permissions. - ✔ Test create_schema with structure_user = ["dev"] - ✔ Test create_table with structure_user = true - ✔ Test create_table with structure_user = ["dev"] - ✔ Test create_table with structure_user = ["dev"], no access to schema "nope" - ✔ Test create_attribute with structure_user = true - ✔ Test create_attribute with structure_user = ["dev"] - ✔ Test create_attribute with structure_user = ["dev"], no access to schema "nope" - ✔ Test drop_attribute with structure_user = true - ✔ Test drop_attribute with structure_user = ["dev"] - ✔ Test drop_attribute with structure_user = ["dev"], no access to schema "nope" - ✔ Test drop_schema with structure_user = true -[main/0] [info]: operation dropSchema requires SU permissions. - ✔ Test drop_schema with structure_user = ["dev"] - ✔ Test drop_table with structure_user = true - ✔ Test drop_table with structure_user = ["dev"] - ✔ Test drop_table with structure_user = ["dev"], no access to schema "nope" - Test checkAttributePerms - ✔ Nominal path - Pass in JSON with insert attribute required. Expect true. - ✔ Pass in JSON with insert attribute required, but role does not have insert perm. Expect false. - ✔ Pass in JSON with action = update, attrs on table have update restricted, expect error - ✔ NOMINAL - Pass in JSON with op = upsert, attrs on table have insert/update perms - ✔ Pass in JSON with op = upsert, attrs on table have update restricted, expect error - ✔ Pass in JSON with op = upsert, new attrs for table w/ attr restricted, expect error - ✔ Pass invalid operation. Expect false. -[main/0] [info]: no attributes specified in checkAttributePerms. - ✔ Pass invalid json. Expect false. - Test getRecordAttributes - ✔ Nominal case, valid JSON with attributes. Expect set with size of 4 -[main/0] [info]: TypeError: Cannot read properties of null (reading 'action') - at getRecordAttributes (/home/kzyp/dev/ts-fixes/utility/operation_authorization.js:744:12) - at Context. (/home/kzyp/dev/ts-fixes/unitTests/utility/operation_authorization.test.js:1189:17) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) - ✔ pass invalid JSON with attributes. Expect empty set. - ✔ Nominal case pass JSON with no records. Expect empty set. - ✔ Nominal case, valid JSON for search_by_conditions - ✔ Nominal case, valid JSON for search_by_conditions w/ deprecated property names - ✔ Nominal case, valid JSON for search_by_value - ✔ Nominal case, valid JSON for search_by_value w/ deprecated property names - Test getAttributePermissions - ✔ Nominal case, valid JSON with attributes in the role. -[main/0] [info]: no hdb_user specified in getAttributePermissions - ✔ invalid JSON, Expect zero length Map returned - ✔ JSON with no restrictions in the role. Expect false - ✔ JSON with super user. Expect zero length back - Test hasPermissions -[main/0] [info]: hasPermissions has an invalid parameter - ✔ Test invalid parameter - ✔ Test nominal path, insert required. Expect true -[main/0] [info]: Required insert permission not found for insertData operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 - ✔ Test insert required but missing from table perms. Expect false. - ✔ NOMINAL - Test upsert op with insert/update perms TRUE -[main/0] [info]: Required insert permission not found for upsertData operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 - ✔ Test upsert op with insert perms false - expect error -[main/0] [info]: Required update permission not found for upsertData operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 - ✔ Test upsert op with update perms false - expect error -[main/0] [info]: Required insert permission not found for upsertData operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 -[main/0] [info]: Required update permission not found for upsertData operation in role 9c9aae33-4d1d-40b5-a52e-bbbc1b2e2ba6 - ✔ Test upsert op with insert/update perms false - expect error - Test operations permissions - verifyPerms() — operations allowlist -[main/0] [info]: TypeError: Cannot read properties of undefined (reading 'forEach') - at getRecordAttributes (/home/kzyp/dev/ts-fixes/utility/operation_authorization.js:748:20) - at Object.verifyPerms (/home/kzyp/dev/ts-fixes/utility/operation_authorization.js:532:22) - at Context. (/home/kzyp/dev/ts-fixes/unitTests/utility/operation_authorization.test.js:1555:27) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) -[main/0] [info]: No role permissions set (this is OK). - ✔ (NOMINAL) op in read_only group with table READ perm — search allowed - ✔ op NOT in operations list — insert blocked even with table perms - ✔ SU-only op in operations — restart granted without super_user - ✔ SU-only op NOT in operations — restart denied - ✔ get_configuration granted via operations (SU-only bypass) - ✔ dual gate — op in operations but table READ perm false — search denied at CRUD level -[main/0] [info]: operation restart requires SU permissions. - ✔ no operations set — SU-only op still denied for non-SU user (no regression) -[main/0] [info]: No role permissions set (this is OK). - ✔ no operations set — normal data op works as before (no regression) - Test callOperationFunctionAsAwait - ✔ Nominal with no followup function, expect pass - ✔ Nominal with followup function, expect pass - ✔ Error in test function, expect exception & followup not run - ✔ Error in followup function, expect exception & was_run to be true - ✔ Pass invalid function, expect exception - ✔ Pass variable instead of function, expect exception - operationPermissions - OPERATION_PERMISSION_GROUPS - ✔ read_only contains expected read operations - ✔ read_only does not contain write operations - ✔ standard_user contains everything in read_only - ✔ standard_user contains data manipulation operations - ✔ standard_user does not contain token management operations - ✔ standard_user does not contain schema DDL operations - ✔ admin_read contains elevated read operations - ✔ admin_read does not contain data write operations - expandOperationsPerms() - ✔ expands a group name to its member operations - ✔ group does not include write operations - ✔ passes through an individual operation name directly - ✔ combines a group and individual operations into a union set - ✔ returns an empty set for an empty array - validateOperations() - ✔ returns null for valid individual operations - ✔ returns null for valid group names - ✔ returns null for a mix of operations and group names - ✔ returns null for an empty array - ✔ returns the invalid entry for an unknown operation - ✔ returns the first invalid entry when multiple are invalid - ✔ returns a stringified value for non-string entries - packageUtils - ✔ should export the HarperDB package.json as packageJson - ✔ should export the HarperDB package root as PACKAGE_ROOT - Test restartHdb scripts - - Test reload and then delete are called as expected - Test signalling module - ✔ Test signalSchemaChange happy path - ✔ Test signalSchemaChange sad path - ✔ Test signalUserChange happy path - ✔ Test signalUserChange sad path - Test bulkDeleteValidator module - ✔ Test table required returned - ✔ Test date required returned - ✔ Test invalid date returned - ✔ Test timestamp required returned - ✔ Test invalid timestamp returned - Test configValidator module - ✔ Test routesValidator validation bad values - ✔ Test routesValidator validation more bad values - ✔ Test validateRotationInterval invalid unit - ✔ Test validateRotationInterval invalid value - Test config schema in configValidator function - ✔ Test itc and localStudio in config_schema with bad values - ✔ Test logging in config_schema with bad values - ✔ Test operationsApi in config_schema with bad values - Test doesPathExist function - ✔ Test happy path, returns null - ✔ Test path doesnt exist, returns corresponding message - Test validateRotationMaxSize function - ✔ Test it returns a helper message if value isnt a number - Test setDefaultThreads function - ✔ Test happy path, correct info message is logged and correct number of processes returned - Test setDefaultRoot function - ✔ Test throws error if hdb_root is undefined - ✔ Test error throws if config param isnt real - ✔ Test that if customFunctions.root is undefined, one is created - ✔ Test that if logging.root is undefined, one is created - Test deleteValidator module - ✔ Test table required returned - ✔ Test hash_values required returned - ✔ Test hash_values invalid returned - Test fileLoadValidator module - Test validate module - ✔ should return table cant be blank error from dataObject - ✔ should return must be alpha numeric error on table - ✔ should return must be alpha numeric error on schema - ✔ should return cannot exceed 250 characters error on schema - ✔ should return cannot exceed 250 characters error on table - ✔ should return action is required to be be either insert, update or upsert - ✔ should return s3 cant be blank error from s3FileObject - ✔ should return s3.aws_access_key_id must be a string error from s3FileObject - ✔ should return s3.key cant be blank error from s3FileObject - ✔ should return s3.key must have valid ext error from s3FileObject - ✔ should return null w/ valid s3FileObject - ✔ should return validate `presence` error but NOT `type` error if both issues are caught - Test postValidateChecks function - ✔ should return an error from common_utils.checkGlobalSchemaTable - ✔ should return an error from accessSync - Test dataObject, urlObject and fileObject functions - ✔ should call validateObject and postValidateChecks with dataObject - ✔ should call validateObject and postValidateChecks with urlObject - ✔ should call validateObject and postValidateChecks with fileObject - Test insertValidator - ✔ Test validator happy path result is undefined - ✔ Test validator happy path result is undefined with number schema/table - ✔ Test validator returns missing table message - ✔ Test validator returns missing records message - ✔ Test validator returns no slashes or backticks message - ✔ Test validator returns not allowed to be empty message - ✔ Test validator returns too long message - ✔ Test validator returns invalid attribute name message with empty attribute - ✔ Test validator returns invalid attribute name message multiple - Test installValidator module - ✔ Test validation error returned all values bad - ✔ Test validation error returned some values bad - Test readLogValidator module - ✔ Test happy path validation returns undefined - ✔ Test from datetime invalid returned - ✔ Test until datetime invalid returned - ✔ Test level invalid returned - ✔ Test order invalid returned - ✔ Test limit invalid returned - ✔ Test start invalid returned - ✔ Test happy path validation with log name without extension returns undefined - ✔ Test log_name path traversal invalid returned - ✔ Test log_name with Windows backslash traversal invalid returned - ✔ Test log_name with non-.log extension invalid returned - ✔ Test log_name doesn't exist returned - Test role_validation module - test exposed module functions - ✔ addRoleValidation() - nominal case - call and return results from customValidate - ✔ alterRoleValidation() - nominal case - call and return results from customValidate - ✔ dropRoleValidation() - nominal case - call and return results from validateObject - customValidate() - ✔ NOMINAL - should return null for valid ADD_ROLE object - ✔ NOMINAL - should return null for valid SU ADD_ROLE object - ✔ NOMINAL - should return null for valid structure_user = true ADD_ROLE object - ✔ NOMINAL - should return error for invalid structure_user = ["dev", "blah"] ADD_ROLE object - ✔ NOMINAL - should return error for invalid structure_user = "wut" ADD_ROLE object - ✔ NOMINAL - should return null for valid structure_user = ["dev"] ADD_ROLE object - ✔ NOMINAL - should return null for valid ALTER_ROLE object - ✔ NOMINAL - should return null for valid SU ALTER_ROLE object - ✔ Invalid key in role_obj - expect error returned - ✔ Invalid keys in role_obj - expect error returned - ✔ Role key missing from role_obj - expect error returned - ✔ Permission key missing from role_obj - expect error returned - ✔ Role and permissions key missing from role_obj - expect error returned - ✔ Role id missing from alter_role_obj - expect error returned - ✔ Permission key missing from alter_role_obj - expect error returned - ✔ Id and permissions key missing from alter_role_obj - expect error returned - ✔ SU permission true w/ permissions - expect error thrown - ✔ Role_obj passed with no schema values - expect NO validation results - ✔ Role_obj passed with missing table READ perm - expect error returned - ✔ Role_obj passed with missing table INSERT perm - expect error returned - ✔ Role_obj passed with missing table UPDATE perm - expect error returned - ✔ Role_obj passed with missing table DELETE perm - expect error returned - ✔ Role_obj passed with missing table CRUD perms - expect error returned - ✔ Role_obj passed with missing table READ & INSERT perms - expect error returned - ✔ Role_obj passed with missing table READ & INSERT perms - expect error returned - ✔ Role_obj passed with missing table attribute READ perm - expect error returned - ✔ Role_obj passed with missing table attribute INSERT perm - expect error returned - ✔ Role_obj passed with missing table attribute UPDATE perm - expect error returned - ✔ Role_obj passed with missing table attribute name key/value - expect error returned - ✔ Role_obj passed with invalid table READ perm - expect error returned - ✔ Role_obj passed with invalid table INSERT perm - expect error returned - ✔ Role_obj passed with invalid table UPDATE perm - expect error returned - ✔ Role_obj passed with invalid table DELETE perm - expect error returned - ✔ Role_obj passed with invalid table CRUD perms - expect error returned - ✔ Role_obj passed with invalid table READ & INSERT perms - expect error returned - ✔ Role_obj passed with invalid READ & INSERT perm values across two tables - expect error returned - ✔ Role_obj passed with invalid table attribute READ perm - expect error returned - ✔ Role_obj passed with invalid table attribute INSERT perm - expect error returned - ✔ Role_obj passed with invalid table attribute UPDATE perm - expect error returned - ✔ Role_obj passed with invalid table attribute name key/value - expect error returned - ✔ Role_obj passed with mismatched table/table attribute CRUD perms - expect error returned - ✔ Role_obj passed with mutliple mismatched table/table attribute CRUD perms - expect error returned - ✔ Role_obj passed with random key value in table permission - expect error returned - ✔ Role_obj passed with random key value in table attr permission - expect error returned - operations permission validation - ✔ NOMINAL - operations with group name [read_only] returns null - ✔ NOMINAL - operations with individual valid op names returns null - ✔ NOMINAL - operations mixing group and individual ops returns null - ✔ NOMINAL - operations without schema perms (ops-only role) returns null - ✔ ERROR - operations as string (not array) returns validation error - ✔ ERROR - operations as boolean true (not array) returns validation error - ✔ ERROR - operations with invalid op name returns validation error - ✔ ERROR - operations with mix of valid and invalid ops — error for invalid only - ✔ ERROR - super_user role with operations rejected by SU constraint - test checkSchemaExists function - - test describeSchema throws an error - - test describeSchema fetches the schema - test checkSchemaTableExists - - test describeSchema returns message - - test describeTable errors - - test describeTable returns nothing - - test describeTable returns the table - statusValidator - ✔ should export status constants - ✔ should validate status schemas structure - ✔ should accept valid status values - ✔ should reject invalid status values - Test transactionLogValidator - ✔ Test readTransactionLogValidator - ✔ Test deleteTransactionLogsBeforeValidator - Test validateWrapper module - Test validateObject function - ✔ should return error when validate object is undefined - ✔ should return error when constraints object is undefined - ✔ should return null if nothing returned from validate method - ✔ should return validation message as error from validate method - Test validateObjectAsync function - ✔ should return error when validate object is undefined - ✔ should return error when constraints object is undefined - ✔ should return null if nothing returned from validate method - ✔ should return validation message as error from validate method - 1837 passing (27s) - 197 pending -Starting inspector on 127.0.0.1:9229 failed: address already in use -(node:8877) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit -(Use `node --trace-warnings ...` to show where the warning was created) -(node:8877) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unhandledRejection listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit -[main/0] [error]: I am a log -[main/0] [error]: Error: Could not load component 'dataLoader' for application 'error-component' due to: DataLoader failed to initialize - at Context. (/home/kzyp/dev/ts-fixes/unitTests/components/componentLoader.test.js:223:61) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate. (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) -[main/0] [warn] [harper]: Configuration file /tmp/harper-test-components-rrfWNS/error-component/harperdb-config.yaml was deleted. Reverting to default configuration. Recreate it to restore the options watcher. -[main/0] [warn] [harper]: Configuration file /tmp/harper-test-components-rrfWNS/test-component/harperdb-config.yaml was deleted. Reverting to default configuration. Recreate it to restore the options watcher. -[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js -(node:742459) ExperimentalWarning: VM Modules is an experimental feature and might change at any time -[main/0] [warn]: Logging from testJSWithDeps/resources.js -[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js -[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js -[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js -[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js -[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js -[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js -[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js -[main/0] [warn] [test]: Logging from testJSWithDeps/resources.js -[main/0] [warn] [test-component]: Configuration file /tmp/harper.unit-test.options-watcher-O30wyP/config.yaml was deleted. Reverting to default configuration. Recreate it to restore the options watcher. -[main/0] [warn] [jsResource]: Configuration file /tmp/harper.unit-test.options-watcher-yttI3W/config.yaml was deleted. Reverting to default configuration. Recreate it to restore the options watcher. -[main/0] [error] [componentStatus.crossThread]: ITC failure during component status collection: Inter-thread communication failed during sendItcEvent: ITC failure -[main/0] [warn] [env-config]: Failed to load config state file, starting fresh: /tmp/hdb-edge-test-1778624829440/backup/.harper-config-state.json: Expected property name or '}' in JSON at position 1 (line 1 column 2) -[main/0] [warn] [env-config]: Failed to parse HARPER_SET_CONFIG for arg filtering SyntaxError: Unexpected token 'o', "not valid json" is not valid JSON - at JSON.parse () - at filterArgsAgainstRuntimeConfig (/home/kzyp/dev/ts-fixes/config/harperConfigEnvVars.ts:133:20) - at Context. (/home/kzyp/dev/ts-fixes/unitTests/config/harperConfigEnvVars-filter.test.js:170:19) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) -[main/0] [error]: database 'imnotaschema' does not exist -[main/0] [error]: database 'imnotaschema' does not exist -[main/0] [error]: path is missing. -[main/0] [error]: format invalid. must be one of the following values: json, csv -[main/0] [error]: path './zaphodbeeblebrox' does not exist -[main/0] [error]: path './harperdb.js' does not exist -[main/0] [error]: access to path './' is denied -[main/0] [error]: Oh no an error -[main/0] [error]: Error: Error getting records - at Context. (/home/kzyp/dev/ts-fixes/unitTests/dataLayer/export.test.js:618:28) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) -[main/0] [error]: Operation range_search is not support by export. -[main/0] [error]: AST statement for SQL select process cannot be empty -[main/0] [error]: TypeError: Cannot use 'in' operator to search for 'value' in undefined - at (/home/kzyp/dev/ts-fixes/dataLayer/update.js:65:15) - at Array.forEach () - at createUpdateRecord (/home/kzyp/dev/ts-fixes/dataLayer/update.js:64:11) - at Object.assertErrorSync (/home/kzyp/dev/ts-fixes/unitTests/testUtils.js:462:22) - at Context. (/home/kzyp/dev/ts-fixes/unitTests/dataLayer/update.test.js:361:14) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) -[main/0] [warn]: ClientError: Cannot complete request: User is inactive - at findAndValidateUser (/home/kzyp/dev/ts-fixes/security/user.ts:402:9) - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:214:46) { - statusCode: 401 -} -[main/0] [warn]: JsonWebTokenError: jwt malformed - at module.exports [as verify] (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:70:17) - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) -[main/0] [warn]: TokenExpiredError: jwt expired - at /home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:190:21 - at getSecret (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:97:14) - at module.exports [as verify] (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:101:10) - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) { - expiredAt: 2026-05-12T22:27:12.000Z -} -[main/0] [warn]: ClientError: Cannot complete request: User is inactive - at findAndValidateUser (/home/kzyp/dev/ts-fixes/security/user.ts:402:9) - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:214:46) { - statusCode: 401 -} -[main/0] [warn]: Error: Invalid token - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:216:10) -[main/0] [warn]: JsonWebTokenError: jwt malformed - at module.exports [as verify] (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:70:17) - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) -[main/0] [warn]: TokenExpiredError: jwt expired - at /home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:190:21 - at getSecret (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:97:14) - at module.exports [as verify] (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:101:10) - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) { - expiredAt: 2026-05-12T22:27:12.000Z -} -[main/0] [error] [auth-event] [authentication]: Certificate verification failed: revoked for revoked-client -[main/0] [error] [auth-event] [authentication]: Certificate verification failed: unknown for unknown-client -[main/0] [warn] [crl-verification]: CRL data is stale or missing, treating as unknown -[main/0] [warn] [crl-verification]: CRL data is stale or missing, treating as unknown -[main/0] [warn] [cert-verification]: CRL verification failed: Error: CRL download failed -[main/0] [warn] [cert-verification]: OCSP verification failed: Error: OCSP request failed -[main/0] [warn] [cert-verification]: CRL verification failed: Error: CRL failed -[main/0] [warn] [cert-verification]: OCSP verification failed: Error: OCSP failed -[main/0] [warn] [cert-verification]: CRL verification failed: Error: CRL failed -[main/0] [warn] [cert-verification]: OCSP verification failed: Error: OCSP failed -[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:7f1577f881c46b14de7409500ff6edd2f6a815fbfa7fb7be234ef9137f956786 for hdb_certificate_cache - at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) -[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) -[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:a9680c51e2d4f3f69810aa5536788b71d8458b297d4f33333b80b17e790fbb0c for hdb_certificate_cache - at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) -[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:a9680c51e2d4f3f69810aa5536788b71d8458b297d4f33333b80b17e790fbb0c for hdb_certificate_cache - at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) -[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) -[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:c21cff9273dd4eaa2401904dec940504b6c0cdbad0d6f99422801a97f6148344 for hdb_certificate_cache - at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) -[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:c21cff9273dd4eaa2401904dec940504b6c0cdbad0d6f99422801a97f6148344 for hdb_certificate_cache - at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) -[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) -[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:c21cff9273dd4eaa2401904dec940504b6c0cdbad0d6f99422801a97f6148344 for hdb_certificate_cache - at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) -[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) -[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:c21cff9273dd4eaa2401904dec940504b6c0cdbad0d6f99422801a97f6148344 for hdb_certificate_cache - at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) -[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) -[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:c21cff9273dd4eaa2401904dec940504b6c0cdbad0d6f99422801a97f6148344 for hdb_certificate_cache - at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) -[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) -[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of null (reading 'toString') - at bufferToPem (/home/kzyp/dev/ts-fixes/security/certificateVerification/verificationUtils.ts:21:24) - at Object.verifyOCSP (/home/kzyp/dev/ts-fixes/security/certificateVerification/ocspVerification.ts:60:33) - at Context. (/home/kzyp/dev/ts-fixes/unitTests/security/certificateVerification/ocspVerification.test.js:189:37) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) -[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) -[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:a694dd2793a628e1eb2bf1658a1683498244b2b62188cff657442d634d276ac2 for hdb_certificate_cache - at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) -[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) -[main/0] [error] [ocsp-verification]: OCSP verification error: TypeError: Cannot read properties of undefined (reading 'status') while resolving record ocsp:c21cff9273dd4eaa2401904dec940504b6c0cdbad0d6f99422801a97f6148344 for hdb_certificate_cache - at CertificateVerificationSource.get (/home/kzyp/dev/ts-fixes/security/certificateVerification/certificateVerificationSource.ts:77:19) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:3605:27) - at async (/home/kzyp/dev/ts-fixes/resources/Table.ts:4142:23) -[main/0] [warn] [ocsp-verification]: OCSP check failed, allowing connection (fail-open mode) -(node:742459) ExperimentalWarning: The Ed448 Web Crypto API algorithm is an experimental feature and might change at any time -[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: "failureMode" must be one of [fail-open, fail-closed] -[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: "failureMode" must be one of [fail-open, fail-closed] -[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: OCSP timeout must be at least 1000ms (1 second) -[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: CRL cacheTtl must be at least 1000ms (1 second) -[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: OCSP errorCacheTtl must be at least 1000ms (1 second) -[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: CRL cacheTtl must be at least 1000ms (1 second) -[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: OCSP cacheTtl must be at least 1000ms (1 second) -[main/0] [error] [cert-verification-config]: Certificate verification config validation failed - defaulting to disabled: Invalid certificate verification configuration: CRL gracePeriod must be at least 0ms -[main/0] [warn] [cert-verification-utils]: Failed to extract revocation URLs: InvalidCharacterError: Invalid character -[main/0] [warn] [cert-verification-utils]: Failed to extract CRL distribution points: InvalidCharacterError: Invalid character -[main/0] [error] [cert-verification-utils]: Failed to extract OCSP URLs: InvalidCharacterError: Invalid character -[main/0] [error] [cert-verification-utils]: Failed to extract serial number: InvalidCharacterError: Invalid character -[main/0] [error] [cert-verification-utils]: Failed to extract issuer key ID: InvalidCharacterError: Invalid character -[main/0] [error] [tls]: Error applying TLS for Unit Test Error: error:05800074:x509 certificate routines::key values mismatch - at Object.tls.createSecureContext (/home/kzyp/dev/ts-fixes/security/keys.js:692:14) - at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:789:32) - at (/home/kzyp/dev/ts-fixes/security/keys.js:854:4) - at new Promise () - at SNICallback.SNICallback.initialize (/home/kzyp/dev/ts-fixes/security/keys.js:732:31) - at Object.getReplicationCert (/home/kzyp/dev/ts-fixes/security/keys.js:133:20) - at Context. (/home/kzyp/dev/ts-fixes/unitTests/security/keys.test.js:116:31) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) { - library: 'x509 certificate routines', - reason: 'key values mismatch', - code: 'ERR_OSSL_X509_KEY_VALUES_MISMATCH' -} -[main/0] [error] [tls]: Error applying TLS for valid-test-cert Error: ENOENT: no such file or directory, open '/home/kzyp/harper/keys/test.pem' - at Object.readFileSync (node:fs:440:20) - at getPrivateKeyByName (/home/kzyp/dev/ts-fixes/security/keys.js:890:13) - at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:763:28) - at (/home/kzyp/dev/ts-fixes/security/keys.js:854:4) - at new Promise () - at SNICallback.SNICallback.initialize (/home/kzyp/dev/ts-fixes/security/keys.js:732:31) - at Object.getReplicationCert (/home/kzyp/dev/ts-fixes/security/keys.js:133:20) - at Context. (/home/kzyp/dev/ts-fixes/unitTests/security/keys.test.js:116:31) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) { - errno: -2, - code: 'ENOENT', - syscall: 'open', - path: '/home/kzyp/harper/keys/test.pem' -} -[main/0] [error] [tls]: Error applying TLS for Unit Test Error: error:05800074:x509 certificate routines::key values mismatch - at Object.tls.createSecureContext (/home/kzyp/dev/ts-fixes/security/keys.js:692:14) - at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:789:32) - at (/home/kzyp/dev/ts-fixes/security/keys.js:854:4) - at new Promise () - at SNICallback.SNICallback.initialize (/home/kzyp/dev/ts-fixes/security/keys.js:732:31) - at getReplicationCert (/home/kzyp/dev/ts-fixes/security/keys.js:133:20) - at Object.getReplicationCertAuth (/home/kzyp/dev/ts-fixes/security/keys.js:145:25) - at Context. (/home/kzyp/dev/ts-fixes/unitTests/security/keys.test.js:123:25) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) { - library: 'x509 certificate routines', - reason: 'key values mismatch', - code: 'ERR_OSSL_X509_KEY_VALUES_MISMATCH' -} -[main/0] [error] [tls]: Error applying TLS for valid-test-cert Error: ENOENT: no such file or directory, open '/home/kzyp/harper/keys/test.pem' - at Object.readFileSync (node:fs:440:20) - at getPrivateKeyByName (/home/kzyp/dev/ts-fixes/security/keys.js:890:13) - at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:763:28) - at (/home/kzyp/dev/ts-fixes/security/keys.js:854:4) - at new Promise () - at SNICallback.SNICallback.initialize (/home/kzyp/dev/ts-fixes/security/keys.js:732:31) - at getReplicationCert (/home/kzyp/dev/ts-fixes/security/keys.js:133:20) - at Object.getReplicationCertAuth (/home/kzyp/dev/ts-fixes/security/keys.js:145:25) - at Context. (/home/kzyp/dev/ts-fixes/unitTests/security/keys.test.js:123:25) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) { - errno: -2, - code: 'ENOENT', - syscall: 'open', - path: '/home/kzyp/harper/keys/test.pem' -} -[main/0] [error] [tls]: Failed to parse certificate for corrupted-base64-padding: error:0680009B:asn1 encoding routines::too long -[main/0] [error] [tls]: Failed to parse certificate for truncated-cert: error:04800066:PEM routines::bad end line -[main/0] [error] [tls]: Failed to parse certificate for invalid-chars: error:04800064:PEM routines::bad base64 decode -[main/0] [error] [tls]: Failed to parse certificate for missing-end-marker: error:04800066:PEM routines::bad end line -[main/0] [error] [tls]: Failed to parse certificate for empty-cert: error:068000A8:asn1 encoding routines::wrong tag -[main/0] [error] [tls]: Failed to parse certificate for extra-padding: error:04800064:PEM routines::bad base64 decode -[main/0] [error] [tls]: Failed to parse certificate for illegal-padding: error:0680009B:asn1 encoding routines::too long -[main/0] [error] [tls]: Failed to parse certificate for malformed-asn1: error:0680009B:asn1 encoding routines::too long -[main/0] [error] [tls]: Failed to parse certificate for broken-der: error:068000A8:asn1 encoding routines::wrong tag -[main/0] [error] [tls]: Failed to parse certificate for cert-corrupted-during-transfer: error:04800066:PEM routines::bad end line -[main/0] [error] [tls]: Failed to parse certificate for cert-with-wrong-line-endings: error:0480006C:PEM routines::no start line -[main/0] [error] [tls]: Failed to parse certificate for cert-with-encoding-issues: error:0480006C:PEM routines::no start line -[main/0] [error]: [Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPass'] { - errno: -2, - code: 'ENOENT', - syscall: 'open', - path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPass' -} -[main/0] [error]: [Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPrivate.key'] { - errno: -2, - code: 'ENOENT', - syscall: 'open', - path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPrivate.key' -} -[main/0] [error]: [Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPublic.key'] { - errno: -2, - code: 'ENOENT', - syscall: 'open', - path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPublic.key' -} -[main/0] [error]: TypeError: Cannot read properties of undefined (reading 'bypass_auth') - at Object.createTokens (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:101:43) - at Context. (/home/kzyp/dev/ts-fixes/unitTests/security/tokenAuthentication.test.js:279:30) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at cbHookRun (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:592:7) - at done (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:310:5) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:389:7) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:551:10) - at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) -[main/0] [error]: Error: bad credentials - at /home/kzyp/dev/ts-fixes/unitTests/security/tokenAuthentication.test.js:315:10 - at Object.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/behavior.js:177:32) - at functionStub (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/stub.js:44:43) - at findAndValidateUser.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) - at findAndValidateUser (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:275:26) - at Object.createTokens (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:108:35) - at Context. (/home/kzyp/dev/ts-fixes/unitTests/security/tokenAuthentication.test.js:319:30) -[main/0] [error]: [Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPass'] { - errno: -2, - code: 'ENOENT', - syscall: 'open', - path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/.jwtPass' -} -[main/0] [warn]: ClientError: Cannot complete request: User is inactive - at findAndValidateUser (/home/kzyp/dev/ts-fixes/security/user.ts:402:9) - at findAndValidateUser.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) - at findAndValidateUser (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:275:26) - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:214:46) { - statusCode: 401 -} -[main/0] [warn]: JsonWebTokenError: jwt malformed - at module.exports (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:70:17) - at Function.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) - at Object.verify (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:285:26) - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) -[main/0] [warn]: TokenExpiredError: jwt expired - at /home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:190:21 - at getSecret (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:97:14) - at module.exports (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:101:10) - at Function.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) - at Object.verify (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:285:26) - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) { - expiredAt: 2026-05-12T22:27:13.000Z -} -[main/0] [warn]: ClientError: Cannot complete request: User is inactive - at findAndValidateUser (/home/kzyp/dev/ts-fixes/security/user.ts:402:9) - at findAndValidateUser.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) - at findAndValidateUser (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:275:26) - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:214:46) { - statusCode: 401 -} -[main/0] [warn]: Error: Invalid token - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:216:10) - at async Context. (/home/kzyp/dev/ts-fixes/unitTests/security/tokenAuthentication.test.js:661:11) -[main/0] [warn]: JsonWebTokenError: jwt malformed - at module.exports (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:70:17) - at Function.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) - at Object.verify (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:285:26) - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) -[main/0] [warn]: TokenExpiredError: jwt expired - at /home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:190:21 - at getSecret (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:97:14) - at module.exports (/home/kzyp/dev/ts-fixes/node_modules/jsonwebtoken/verify.js:101:10) - at Function.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) - at Object.verify (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:285:26) - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:203:29) { - expiredAt: 2026-05-12T22:27:13.000Z -} -[main/0] [warn]: ClientError: Cannot complete request: User is inactive - at findAndValidateUser (/home/kzyp/dev/ts-fixes/security/user.ts:402:9) - at findAndValidateUser.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) - at findAndValidateUser (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:275:26) - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:214:46) { - statusCode: 401 -} -[main/0] [warn]: Error: Invalid token - at validateToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:216:10) - at async Object.refreshOperationToken (/home/kzyp/dev/ts-fixes/security/tokenAuthentication.ts:175:2) - at async Context. (/home/kzyp/dev/ts-fixes/unitTests/security/tokenAuthentication.test.js:862:12) -[main/0] [error] [tls]: Error applying TLS for Unit Test Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/dev/ts-fixes/unitTests/envDir/keys-test/test-private-key.pem' - at Object.readFileSync (node:fs:440:20) - at getPrivateKeyByName (/home/kzyp/dev/ts-fixes/security/keys.js:890:13) - at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:763:28) - at Timeout._onTimeout (/home/kzyp/dev/ts-fixes/security/keys.js:851:38) - at listOnTimeout (node:internal/timers:608:17) - at process.processTimers (node:internal/timers:543:7) { - errno: -2, - code: 'ENOENT', - syscall: 'open', - path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/dev/ts-fixes/unitTests/envDir/keys-test/test-private-key.pem' -} -[main/0] [error] [tls]: Error applying TLS for valid-test-cert Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/test.pem' - at Object.readFileSync (node:fs:440:20) - at getPrivateKeyByName (/home/kzyp/dev/ts-fixes/security/keys.js:890:13) - at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:763:28) - at Timeout._onTimeout (/home/kzyp/dev/ts-fixes/security/keys.js:851:38) - at listOnTimeout (node:internal/timers:608:17) - at process.processTimers (node:internal/timers:543:7) { - errno: -2, - code: 'ENOENT', - syscall: 'open', - path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/test.pem' -} -[main/0] [error] [tls]: Error applying TLS for Unit Test Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/dev/ts-fixes/unitTests/envDir/keys-test/test-private-key.pem' - at Object.readFileSync (node:fs:440:20) - at getPrivateKeyByName (/home/kzyp/dev/ts-fixes/security/keys.js:890:13) - at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:763:28) - at Timeout._onTimeout (/home/kzyp/dev/ts-fixes/security/keys.js:851:38) - at listOnTimeout (node:internal/timers:608:17) - at process.processTimers (node:internal/timers:543:7) { - errno: -2, - code: 'ENOENT', - syscall: 'open', - path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/dev/ts-fixes/unitTests/envDir/keys-test/test-private-key.pem' -} -[main/0] [error] [tls]: Error applying TLS for valid-test-cert Error: ENOENT: no such file or directory, open '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/test.pem' - at Object.readFileSync (node:fs:440:20) - at getPrivateKeyByName (/home/kzyp/dev/ts-fixes/security/keys.js:890:13) - at updateTLS (/home/kzyp/dev/ts-fixes/security/keys.js:763:28) - at Timeout._onTimeout (/home/kzyp/dev/ts-fixes/security/keys.js:851:38) - at listOnTimeout (node:internal/timers:608:17) - at process.processTimers (node:internal/timers:543:7) { - errno: -2, - code: 'ENOENT', - syscall: 'open', - path: '/home/kzyp/dev/ts-fixes/unitTests/envDir/742459/keys/test.pem' -} -[main/0] [error]: There is an error: Sinon-provided There is an error - at fake.exceptionCreator (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/default-behaviors.js:18:34) - at Object.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/behavior.js:165:35) - at Object.functionStub (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/stub.js:44:43) - at existsSync.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) - at Object.existsSync (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:270:26) - at checkProjectExists (/home/kzyp/dev/ts-fixes/components/operationsValidation.js:40:11) - at Context. (/home/kzyp/dev/ts-fixes/unitTests/server/fastifyRoutes/operationsValidation.test.js:53:19) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) -[main/0] [error]: There is an error: Sinon-provided There is an error - at fake.exceptionCreator (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/default-behaviors.js:18:34) - at Object.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/behavior.js:165:35) - at Object.functionStub (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/stub.js:44:43) - at existsSync.invoke (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy-invoke.js:53:47) - at Object.existsSync (/home/kzyp/dev/ts-fixes/node_modules/sinon/lib/sinon/proxy.js:270:26) - at checkFileExists (/home/kzyp/dev/ts-fixes/components/operationsValidation.js:76:11) - at Context. (/home/kzyp/dev/ts-fixes/unitTests/server/fastifyRoutes/operationsValidation.test.js:85:19) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate._onImmediate (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) -[main/0] [error]: There was an error running csvDataLoad job with id 23446155-1788-43ad-95a5-9fbc55d1bd51 - BAD UPDATE -[main/0] [error]: There was an error running csvDataLoad job with id null - invalid ID passed to updateJob -[main/0] [error]: Unable to update job with id null -[main/0] [error]: There was an error searching jobs by date: Error: Oh Noes! -[main/0] [error]: There was an error inserting a new job: Error: error with search by value -[main/0] [error]: There was an error inserting a new job: Error: error with search by value -[main/0] [error]: There was an error inserting a job for job type: csv_file_load -- Error: error inserting -[main/0] [error]: there was a problem searching for jobs from date 2017-02-01 to date 2018-07-07 Error: error with sql search -[main/0] [error]: There was an error searching for a job by id: [object Object] Error: error searching -[main/0] [error] [operation]: Error when selecting operation function - Error: Operation 'blah' not found -[main/0] [error]: Error running storage reclamation handlers Error: Disk error - at Context. (/home/kzyp/dev/ts-fixes/unitTests/server/storageReclamation.test.js:249:48) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate. (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) -[main/0] [error]: Error running storage reclamation handlers Error: Handler error - at Context. (/home/kzyp/dev/ts-fixes/unitTests/server/storageReclamation.test.js:266:65) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate. (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) -[main/0] [error]: Error running storage reclamation handlers Error: Disk error - at Context. (/home/kzyp/dev/ts-fixes/unitTests/server/storageReclamation.test.js:379:49) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate. (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) -[main/0] [warn]: Unable to locate 'hdb.pid' file, try stopping and starting Harper. This could be because Harper is not running. -[main/0] [warn]: Unable to locate 'hdb.pid' file, try stopping and starting Harper. This could be because Harper is not running. -[main/0] [warn]: Unable to locate 'hdb.pid' file, try stopping and starting Harper. This could be because Harper is not running. -[main/0] [warn]: Test of the global logger -[main/0] [warn] [test-logging-component]: Test of an application logger going to the external log -[main/0] [error]: Error calling operation: test_func_exception -[main/0] [error]: Error: This is bad! - at test_func_exception (/home/kzyp/dev/ts-fixes/unitTests/utility/OperationFunctionCaller.test.js:47:10) - at Object.callOperationFunctionAsAwait (/home/kzyp/dev/ts-fixes/utility/OperationFunctionCaller.js:20:18) - at Context. (/home/kzyp/dev/ts-fixes/unitTests/utility/OperationFunctionCaller.test.js:52:31) - at callFn (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:366:21) - at Runnable.run (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runnable.js:354:5) - at Runner.runTest (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:719:10) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:842:12 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:634:14) - at /home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:644:7 - at next (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:527:14) - at Immediate. (/home/kzyp/dev/ts-fixes/node_modules/mocha/lib/runner.js:612:5) - at process.processImmediate (node:internal/timers:505:21) -[main/0] [error]: Error calling operation: test_function_as_callback -[main/0] [error]: Error: This is bad! - at followup_func_exception (/home/kzyp/dev/ts-fixes/unitTests/utility/OperationFunctionCaller.test.js:63:10) - at Object.callOperationFunctionAsAwait (/home/kzyp/dev/ts-fixes/utility/OperationFunctionCaller.js:24:10) - at async Context. (/home/kzyp/dev/ts-fixes/unitTests/utility/OperationFunctionCaller.test.js:68:10) -[main/0] [error]: ITC event message missing 'originator' property -[main/0] [error]: ITC event message missing 'originator' property -[main/0] [error]: ITC event message missing 'originator' property -[main/0] [error]: ITC event message missing 'originator' property