@memberjunction/testing-engine 3.4.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +147 -376
- package/dist/__tests__/variable-resolver.test.js +14 -16
- package/dist/__tests__/variable-resolver.test.js.map +1 -1
- package/dist/drivers/AgentEvalDriver.d.ts +2 -2
- package/dist/drivers/AgentEvalDriver.js +17 -19
- package/dist/drivers/AgentEvalDriver.js.map +1 -1
- package/dist/drivers/BaseTestDriver.d.ts +1 -1
- package/dist/drivers/BaseTestDriver.js +8 -12
- package/dist/drivers/BaseTestDriver.js.map +1 -1
- package/dist/drivers/index.d.ts +2 -2
- package/dist/drivers/index.js +2 -18
- package/dist/drivers/index.js.map +1 -1
- package/dist/engine/TestEngine.d.ts +3 -3
- package/dist/engine/TestEngine.js +32 -36
- package/dist/engine/TestEngine.js.map +1 -1
- package/dist/index.d.ts +15 -15
- package/dist/index.js +15 -31
- package/dist/index.js.map +1 -1
- package/dist/oracles/ExactMatchOracle.d.ts +2 -2
- package/dist/oracles/ExactMatchOracle.js +1 -5
- package/dist/oracles/ExactMatchOracle.js.map +1 -1
- package/dist/oracles/IOracle.d.ts +1 -1
- package/dist/oracles/IOracle.js +1 -2
- package/dist/oracles/IOracle.js.map +1 -1
- package/dist/oracles/LLMJudgeOracle.d.ts +2 -2
- package/dist/oracles/LLMJudgeOracle.js +8 -12
- package/dist/oracles/LLMJudgeOracle.js.map +1 -1
- package/dist/oracles/SQLValidatorOracle.d.ts +2 -2
- package/dist/oracles/SQLValidatorOracle.js +3 -7
- package/dist/oracles/SQLValidatorOracle.js.map +1 -1
- package/dist/oracles/SchemaValidatorOracle.d.ts +2 -2
- package/dist/oracles/SchemaValidatorOracle.js +1 -5
- package/dist/oracles/SchemaValidatorOracle.js.map +1 -1
- package/dist/oracles/TraceValidatorOracle.d.ts +2 -2
- package/dist/oracles/TraceValidatorOracle.js +3 -7
- package/dist/oracles/TraceValidatorOracle.js.map +1 -1
- package/dist/oracles/index.d.ts +6 -6
- package/dist/oracles/index.js +6 -22
- package/dist/oracles/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -2
- package/dist/types.js.map +1 -1
- package/dist/utils/cost-calculator.js +8 -19
- package/dist/utils/cost-calculator.js.map +1 -1
- package/dist/utils/execution-context.js +4 -33
- package/dist/utils/execution-context.js.map +1 -1
- package/dist/utils/result-formatter.d.ts +1 -1
- package/dist/utils/result-formatter.js +16 -30
- package/dist/utils/result-formatter.js.map +1 -1
- package/dist/utils/scoring.d.ts +1 -1
- package/dist/utils/scoring.js +7 -17
- package/dist/utils/scoring.js.map +1 -1
- package/dist/utils/variable-resolver.d.ts +3 -3
- package/dist/utils/variable-resolver.d.ts.map +1 -1
- package/dist/utils/variable-resolver.js +6 -11
- package/dist/utils/variable-resolver.js.map +1 -1
- package/package.json +19 -18
package/dist/oracles/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Oracle implementations for test evaluation
|
|
3
3
|
*/
|
|
4
|
-
export * from './IOracle';
|
|
5
|
-
export * from './SchemaValidatorOracle';
|
|
6
|
-
export * from './TraceValidatorOracle';
|
|
7
|
-
export * from './LLMJudgeOracle';
|
|
8
|
-
export * from './ExactMatchOracle';
|
|
9
|
-
export * from './SQLValidatorOracle';
|
|
4
|
+
export * from './IOracle.js';
|
|
5
|
+
export * from './SchemaValidatorOracle.js';
|
|
6
|
+
export * from './TraceValidatorOracle.js';
|
|
7
|
+
export * from './LLMJudgeOracle.js';
|
|
8
|
+
export * from './ExactMatchOracle.js';
|
|
9
|
+
export * from './SQLValidatorOracle.js';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/oracles/index.js
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Oracle implementations for test evaluation
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
__exportStar(require("./IOracle"), exports);
|
|
21
|
-
__exportStar(require("./SchemaValidatorOracle"), exports);
|
|
22
|
-
__exportStar(require("./TraceValidatorOracle"), exports);
|
|
23
|
-
__exportStar(require("./LLMJudgeOracle"), exports);
|
|
24
|
-
__exportStar(require("./ExactMatchOracle"), exports);
|
|
25
|
-
__exportStar(require("./SQLValidatorOracle"), exports);
|
|
4
|
+
export * from './IOracle.js';
|
|
5
|
+
export * from './SchemaValidatorOracle.js';
|
|
6
|
+
export * from './TraceValidatorOracle.js';
|
|
7
|
+
export * from './LLMJudgeOracle.js';
|
|
8
|
+
export * from './ExactMatchOracle.js';
|
|
9
|
+
export * from './SQLValidatorOracle.js';
|
|
26
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/oracles/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/oracles/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { UserInfo } from '@memberjunction/core';
|
|
8
8
|
import { TestEntity, TestRunEntity, AIAgentRunEntity } from '@memberjunction/core-entities';
|
|
9
|
-
import { IOracle } from './oracles/IOracle';
|
|
9
|
+
import { IOracle } from './oracles/IOracle.js';
|
|
10
10
|
export { TestLogMessage, TestProgress, TestRunOptions, SuiteRunOptions, OracleResult, TestRunResult, TestSuiteRunResult, ScoringWeights, ValidationResult, ValidationError, ValidationWarning, RunContextDetails, OracleConfig, TestVariableDataType, TestVariableValueSource, TestVariablePossibleValue, TestVariableDefinition, TestTypeVariablesSchema, TestVariableOverride, TestVariablesConfig, TestSuiteVariablesConfig, ResolvedTestVariables, TestVariableValue } from '@memberjunction/testing-engine-base';
|
|
11
11
|
import { TestRunOptions, OracleResult, ResolvedTestVariables } from '@memberjunction/testing-engine-base';
|
|
12
12
|
/**
|
package/dist/types.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Core type definitions for the Testing Engine
|
|
4
3
|
*
|
|
5
4
|
* Note: UI-safe types are defined in @memberjunction/testing-engine-base
|
|
6
5
|
* This file contains execution-specific types that depend on engine internals
|
|
7
6
|
*/
|
|
8
|
-
|
|
7
|
+
export {};
|
|
9
8
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @fileoverview Cost calculation utilities for test execution
|
|
4
3
|
* @module @memberjunction/testing-engine
|
|
5
4
|
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.calculateCostEfficiency = exports.estimateSuiteCost = exports.calculateCostBreakdown = exports.calculateOracleCosts = exports.formatCost = exports.calculateAverageCost = exports.aggregateTestRunCosts = exports.calculateAgentRunCost = void 0;
|
|
8
5
|
/**
|
|
9
6
|
* Calculate total cost from AI Agent Run.
|
|
10
7
|
*
|
|
@@ -14,21 +11,19 @@ exports.calculateCostEfficiency = exports.estimateSuiteCost = exports.calculateC
|
|
|
14
11
|
* @param contextUser - User context
|
|
15
12
|
* @returns Total cost in dollars
|
|
16
13
|
*/
|
|
17
|
-
async function calculateAgentRunCost(agentRun, contextUser) {
|
|
14
|
+
export async function calculateAgentRunCost(agentRun, contextUser) {
|
|
18
15
|
// Agent run already has TotalCost calculated
|
|
19
16
|
return agentRun.TotalCost || 0;
|
|
20
17
|
}
|
|
21
|
-
exports.calculateAgentRunCost = calculateAgentRunCost;
|
|
22
18
|
/**
|
|
23
19
|
* Calculate cost from multiple test runs.
|
|
24
20
|
*
|
|
25
21
|
* @param testRunCosts - Array of individual test run costs
|
|
26
22
|
* @returns Total cost
|
|
27
23
|
*/
|
|
28
|
-
function aggregateTestRunCosts(testRunCosts) {
|
|
24
|
+
export function aggregateTestRunCosts(testRunCosts) {
|
|
29
25
|
return testRunCosts.reduce((sum, cost) => sum + cost, 0);
|
|
30
26
|
}
|
|
31
|
-
exports.aggregateTestRunCosts = aggregateTestRunCosts;
|
|
32
27
|
/**
|
|
33
28
|
* Calculate average cost per test.
|
|
34
29
|
*
|
|
@@ -36,10 +31,9 @@ exports.aggregateTestRunCosts = aggregateTestRunCosts;
|
|
|
36
31
|
* @param testCount - Number of tests
|
|
37
32
|
* @returns Average cost per test
|
|
38
33
|
*/
|
|
39
|
-
function calculateAverageCost(totalCost, testCount) {
|
|
34
|
+
export function calculateAverageCost(totalCost, testCount) {
|
|
40
35
|
return testCount > 0 ? totalCost / testCount : 0;
|
|
41
36
|
}
|
|
42
|
-
exports.calculateAverageCost = calculateAverageCost;
|
|
43
37
|
/**
|
|
44
38
|
* Format cost for display.
|
|
45
39
|
*
|
|
@@ -47,7 +41,7 @@ exports.calculateAverageCost = calculateAverageCost;
|
|
|
47
41
|
* @param precision - Decimal places (default: 4)
|
|
48
42
|
* @returns Formatted cost string
|
|
49
43
|
*/
|
|
50
|
-
function formatCost(cost, precision = 4) {
|
|
44
|
+
export function formatCost(cost, precision = 4) {
|
|
51
45
|
if (cost === 0) {
|
|
52
46
|
return '$0.00';
|
|
53
47
|
}
|
|
@@ -56,7 +50,6 @@ function formatCost(cost, precision = 4) {
|
|
|
56
50
|
}
|
|
57
51
|
return `$${cost.toFixed(precision)}`;
|
|
58
52
|
}
|
|
59
|
-
exports.formatCost = formatCost;
|
|
60
53
|
/**
|
|
61
54
|
* Calculate cost per oracle evaluation.
|
|
62
55
|
*
|
|
@@ -65,7 +58,7 @@ exports.formatCost = formatCost;
|
|
|
65
58
|
* @param oracleResults - Oracle results with cost details
|
|
66
59
|
* @returns Map of oracle type to cost
|
|
67
60
|
*/
|
|
68
|
-
function calculateOracleCosts(oracleResults) {
|
|
61
|
+
export function calculateOracleCosts(oracleResults) {
|
|
69
62
|
const costs = new Map();
|
|
70
63
|
for (const result of oracleResults) {
|
|
71
64
|
const cost = result.details?.llmCost || 0;
|
|
@@ -73,7 +66,6 @@ function calculateOracleCosts(oracleResults) {
|
|
|
73
66
|
}
|
|
74
67
|
return costs;
|
|
75
68
|
}
|
|
76
|
-
exports.calculateOracleCosts = calculateOracleCosts;
|
|
77
69
|
/**
|
|
78
70
|
* Calculate cost breakdown by component.
|
|
79
71
|
*
|
|
@@ -81,7 +73,7 @@ exports.calculateOracleCosts = calculateOracleCosts;
|
|
|
81
73
|
* @param oracleCosts - Costs by oracle type
|
|
82
74
|
* @returns Cost breakdown
|
|
83
75
|
*/
|
|
84
|
-
function calculateCostBreakdown(testRunCost, oracleCosts) {
|
|
76
|
+
export function calculateCostBreakdown(testRunCost, oracleCosts) {
|
|
85
77
|
const oracleTotal = Array.from(oracleCosts.values()).reduce((sum, c) => sum + c, 0);
|
|
86
78
|
const agentExecution = Math.max(0, testRunCost - oracleTotal);
|
|
87
79
|
const breakdown = [
|
|
@@ -103,7 +95,6 @@ function calculateCostBreakdown(testRunCost, oracleCosts) {
|
|
|
103
95
|
breakdown
|
|
104
96
|
};
|
|
105
97
|
}
|
|
106
|
-
exports.calculateCostBreakdown = calculateCostBreakdown;
|
|
107
98
|
/**
|
|
108
99
|
* Estimate cost for test suite.
|
|
109
100
|
*
|
|
@@ -111,10 +102,9 @@ exports.calculateCostBreakdown = calculateCostBreakdown;
|
|
|
111
102
|
* @param avgCostPerTest - Average cost per test
|
|
112
103
|
* @returns Estimated total cost
|
|
113
104
|
*/
|
|
114
|
-
function estimateSuiteCost(testCount, avgCostPerTest) {
|
|
105
|
+
export function estimateSuiteCost(testCount, avgCostPerTest) {
|
|
115
106
|
return testCount * avgCostPerTest;
|
|
116
107
|
}
|
|
117
|
-
exports.estimateSuiteCost = estimateSuiteCost;
|
|
118
108
|
/**
|
|
119
109
|
* Calculate cost efficiency metrics.
|
|
120
110
|
*
|
|
@@ -123,7 +113,7 @@ exports.estimateSuiteCost = estimateSuiteCost;
|
|
|
123
113
|
* @param totalTests - Total number of tests
|
|
124
114
|
* @returns Cost efficiency metrics
|
|
125
115
|
*/
|
|
126
|
-
function calculateCostEfficiency(totalCost, passedTests, totalTests) {
|
|
116
|
+
export function calculateCostEfficiency(totalCost, passedTests, totalTests) {
|
|
127
117
|
const costPerTest = totalTests > 0 ? totalCost / totalTests : 0;
|
|
128
118
|
const costPerPassedTest = passedTests > 0 ? totalCost / passedTests : 0;
|
|
129
119
|
const costEfficiencyRatio = totalCost > 0 ? passedTests / totalCost : 0;
|
|
@@ -133,5 +123,4 @@ function calculateCostEfficiency(totalCost, passedTests, totalTests) {
|
|
|
133
123
|
costEfficiencyRatio
|
|
134
124
|
};
|
|
135
125
|
}
|
|
136
|
-
exports.calculateCostEfficiency = calculateCostEfficiency;
|
|
137
126
|
//# sourceMappingURL=cost-calculator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cost-calculator.js","sourceRoot":"","sources":["../../src/utils/cost-calculator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cost-calculator.js","sourceRoot":"","sources":["../../src/utils/cost-calculator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACvC,QAA0B,EAC1B,WAAqB;IAErB,6CAA6C;IAC7C,OAAO,QAAQ,CAAC,SAAS,IAAI,CAAC,CAAC;AACnC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAsB;IACxD,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB,EAAE,SAAiB;IACrE,OAAO,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,YAAoB,CAAC;IAC1D,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACb,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,IAAI,IAAI,GAAG,MAAM,EAAE,CAAC;QAChB,OAAO,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IACvC,CAAC;IAED,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;AACzC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAChC,aAGE;IAEF,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IAExC,KAAK,MAAM,MAAM,IAAI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MAAM,UAAU,iBAAiB,CAAC,SAAiB,EAAE,cAAsB;IACvE,OAAO,SAAS,GAAG,cAAc,CAAC;AACtC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CACnC,SAAiB,EACjB,WAAmB,EACnB,UAAkB;IAMlB,MAAM,WAAW,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAChE,MAAM,iBAAiB,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,MAAM,mBAAmB,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAExE,OAAO;QACH,WAAW;QACX,iBAAiB;QACjB,mBAAmB;KACtB,CAAC;AACN,CAAC"}
|
|
@@ -1,34 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @fileoverview Utility functions for gathering execution context
|
|
4
3
|
* @module @memberjunction/testing-engine
|
|
5
4
|
*/
|
|
6
|
-
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
-
if (mod && mod.__esModule) return mod;
|
|
24
|
-
var result = {};
|
|
25
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
-
__setModuleDefault(result, mod);
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.getMachineIdentifier = exports.getMachineName = exports.gatherExecutionContext = void 0;
|
|
31
|
-
const os = __importStar(require("os"));
|
|
5
|
+
import * as os from 'os';
|
|
32
6
|
/**
|
|
33
7
|
* Get the primary MAC address for use as a machine identifier.
|
|
34
8
|
* Returns the first non-internal, non-loopback MAC address found.
|
|
@@ -145,7 +119,7 @@ function detectCIProvider() {
|
|
|
145
119
|
*
|
|
146
120
|
* @returns RunContextDetails object with all available context
|
|
147
121
|
*/
|
|
148
|
-
function gatherExecutionContext() {
|
|
122
|
+
export function gatherExecutionContext() {
|
|
149
123
|
const ciInfo = detectCIProvider();
|
|
150
124
|
return {
|
|
151
125
|
osType: os.platform(),
|
|
@@ -157,21 +131,18 @@ function gatherExecutionContext() {
|
|
|
157
131
|
...ciInfo
|
|
158
132
|
};
|
|
159
133
|
}
|
|
160
|
-
exports.gatherExecutionContext = gatherExecutionContext;
|
|
161
134
|
/**
|
|
162
135
|
* Get the hostname of the current machine.
|
|
163
136
|
* @returns Machine hostname
|
|
164
137
|
*/
|
|
165
|
-
function getMachineName() {
|
|
138
|
+
export function getMachineName() {
|
|
166
139
|
return os.hostname();
|
|
167
140
|
}
|
|
168
|
-
exports.getMachineName = getMachineName;
|
|
169
141
|
/**
|
|
170
142
|
* Get the machine identifier (MAC address).
|
|
171
143
|
* @returns MAC address or undefined if not available
|
|
172
144
|
*/
|
|
173
|
-
function getMachineIdentifier() {
|
|
145
|
+
export function getMachineIdentifier() {
|
|
174
146
|
return getMachineId();
|
|
175
147
|
}
|
|
176
|
-
exports.getMachineIdentifier = getMachineIdentifier;
|
|
177
148
|
//# sourceMappingURL=execution-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-context.js","sourceRoot":"","sources":["../../src/utils/execution-context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execution-context.js","sourceRoot":"","sources":["../../src/utils/execution-context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAGzB;;;;GAIG;AACH,SAAS,YAAY;IACjB,MAAM,UAAU,GAAG,EAAE,CAAC,iBAAiB,EAAE,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACzC,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,SAAS;YAAE,SAAS;QAEzB,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC;YAC5B,sDAAsD;YACtD,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,KAAK,mBAAmB,EAAE,CAAC;gBACpE,SAAS;YACb,CAAC;YACD,OAAO,KAAK,CAAC,GAAG,CAAC;QACrB,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;;;GAIG;AACH,SAAS,YAAY;IACjB,MAAM,UAAU,GAAG,EAAE,CAAC,iBAAiB,EAAE,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACzC,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,SAAS;YAAE,SAAS;QAEzB,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC;YAC5B,wCAAwC;YACxC,IAAI,KAAK,CAAC,Q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,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAElC,OAAO;QACH,MAAM,EAAE,EAAE,CAAC,QAAQ,EAAE;QACrB,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE;QACvB,WAAW,EAAE,OAAO,CAAC,OAAO;QAC5B,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ;QAC1D,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,MAAM;QACtD,SAAS,EAAE,YAAY,EAAE;QACzB,GAAG,MAAM;KACZ,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC1B,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;AACzB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAChC,OAAO,YAAY,EAAE,CAAC;AAC1B,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview Result formatting utilities for test output
|
|
3
3
|
* @module @memberjunction/testing-engine
|
|
4
4
|
*/
|
|
5
|
-
import { TestRunResult, TestSuiteRunResult, OracleResult } from '../types';
|
|
5
|
+
import { TestRunResult, TestSuiteRunResult, OracleResult } from '../types.js';
|
|
6
6
|
/**
|
|
7
7
|
* Format test run result as human-readable text.
|
|
8
8
|
*
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @fileoverview Result formatting utilities for test output
|
|
4
3
|
* @module @memberjunction/testing-engine
|
|
5
4
|
*/
|
|
6
|
-
|
|
7
|
-
exports.generateSummaryStatistics = exports.formatDuration = exports.formatTestRunResultsAsCSV = exports.formatSuiteRunResultAsMarkdown = exports.formatTestRunResultAsMarkdown = exports.formatSuiteRunResultAsJSON = exports.formatTestRunResultAsJSON = exports.formatTestSummary = exports.formatOracleResult = exports.formatSuiteRunResult = exports.formatTestRunResult = void 0;
|
|
8
|
-
const cost_calculator_1 = require("./cost-calculator");
|
|
5
|
+
import { formatCost } from './cost-calculator.js';
|
|
9
6
|
/**
|
|
10
7
|
* Format test run result as human-readable text.
|
|
11
8
|
*
|
|
12
9
|
* @param result - Test run result
|
|
13
10
|
* @returns Formatted text output
|
|
14
11
|
*/
|
|
15
|
-
function formatTestRunResult(result) {
|
|
12
|
+
export function formatTestRunResult(result) {
|
|
16
13
|
const lines = [];
|
|
17
14
|
lines.push('='.repeat(80));
|
|
18
15
|
lines.push(`Test: ${result.testName}`);
|
|
@@ -20,7 +17,7 @@ function formatTestRunResult(result) {
|
|
|
20
17
|
lines.push(`Score: ${(result.score * 100).toFixed(1)}%`);
|
|
21
18
|
lines.push(`Checks: ${result.passedChecks}/${result.totalChecks} passed`);
|
|
22
19
|
lines.push(`Duration: ${formatDuration(result.durationMs)}`);
|
|
23
|
-
lines.push(`Cost: ${
|
|
20
|
+
lines.push(`Cost: ${formatCost(result.totalCost)}`);
|
|
24
21
|
lines.push('='.repeat(80));
|
|
25
22
|
if (result.oracleResults.length > 0) {
|
|
26
23
|
lines.push('\nOracle Results:');
|
|
@@ -30,14 +27,13 @@ function formatTestRunResult(result) {
|
|
|
30
27
|
}
|
|
31
28
|
return lines.join('\n');
|
|
32
29
|
}
|
|
33
|
-
exports.formatTestRunResult = formatTestRunResult;
|
|
34
30
|
/**
|
|
35
31
|
* Format test suite run result as human-readable text.
|
|
36
32
|
*
|
|
37
33
|
* @param result - Test suite run result
|
|
38
34
|
* @returns Formatted text output
|
|
39
35
|
*/
|
|
40
|
-
function formatSuiteRunResult(result) {
|
|
36
|
+
export function formatSuiteRunResult(result) {
|
|
41
37
|
const lines = [];
|
|
42
38
|
lines.push('='.repeat(80));
|
|
43
39
|
lines.push(`Test Suite: ${result.suiteName}`);
|
|
@@ -45,7 +41,7 @@ function formatSuiteRunResult(result) {
|
|
|
45
41
|
lines.push(`Tests: ${result.passedTests}/${result.totalTests} passed`);
|
|
46
42
|
lines.push(`Average Score: ${(result.averageScore * 100).toFixed(1)}%`);
|
|
47
43
|
lines.push(`Duration: ${formatDuration(result.durationMs)}`);
|
|
48
|
-
lines.push(`Cost: ${
|
|
44
|
+
lines.push(`Cost: ${formatCost(result.totalCost)}`);
|
|
49
45
|
lines.push('='.repeat(80));
|
|
50
46
|
if (result.testResults.length > 0) {
|
|
51
47
|
lines.push('\nTest Results:');
|
|
@@ -55,7 +51,6 @@ function formatSuiteRunResult(result) {
|
|
|
55
51
|
}
|
|
56
52
|
return lines.join('\n');
|
|
57
53
|
}
|
|
58
|
-
exports.formatSuiteRunResult = formatSuiteRunResult;
|
|
59
54
|
/**
|
|
60
55
|
* Format oracle result as human-readable text.
|
|
61
56
|
*
|
|
@@ -63,7 +58,7 @@ exports.formatSuiteRunResult = formatSuiteRunResult;
|
|
|
63
58
|
* @param indent - Indentation prefix
|
|
64
59
|
* @returns Formatted text output
|
|
65
60
|
*/
|
|
66
|
-
function formatOracleResult(result, indent = '') {
|
|
61
|
+
export function formatOracleResult(result, indent = '') {
|
|
67
62
|
const status = result.passed ? '✓' : '✗';
|
|
68
63
|
const lines = [];
|
|
69
64
|
lines.push(`${indent}${status} ${result.oracleType}: ${result.message}`);
|
|
@@ -73,7 +68,6 @@ function formatOracleResult(result, indent = '') {
|
|
|
73
68
|
}
|
|
74
69
|
return lines.join('\n');
|
|
75
70
|
}
|
|
76
|
-
exports.formatOracleResult = formatOracleResult;
|
|
77
71
|
/**
|
|
78
72
|
* Format test summary (for suite results).
|
|
79
73
|
*
|
|
@@ -81,11 +75,10 @@ exports.formatOracleResult = formatOracleResult;
|
|
|
81
75
|
* @param indent - Indentation prefix
|
|
82
76
|
* @returns Formatted text output
|
|
83
77
|
*/
|
|
84
|
-
function formatTestSummary(result, indent = '') {
|
|
78
|
+
export function formatTestSummary(result, indent = '') {
|
|
85
79
|
const status = result.status === 'Passed' ? '✓' : '✗';
|
|
86
80
|
return `${indent}${status} ${result.testName}: ${(result.score * 100).toFixed(1)}% (${result.passedChecks}/${result.totalChecks})`;
|
|
87
81
|
}
|
|
88
|
-
exports.formatTestSummary = formatTestSummary;
|
|
89
82
|
/**
|
|
90
83
|
* Format test run result as JSON.
|
|
91
84
|
*
|
|
@@ -93,10 +86,9 @@ exports.formatTestSummary = formatTestSummary;
|
|
|
93
86
|
* @param pretty - Whether to pretty-print (default: true)
|
|
94
87
|
* @returns JSON string
|
|
95
88
|
*/
|
|
96
|
-
function formatTestRunResultAsJSON(result, pretty = true) {
|
|
89
|
+
export function formatTestRunResultAsJSON(result, pretty = true) {
|
|
97
90
|
return JSON.stringify(result, null, pretty ? 2 : 0);
|
|
98
91
|
}
|
|
99
|
-
exports.formatTestRunResultAsJSON = formatTestRunResultAsJSON;
|
|
100
92
|
/**
|
|
101
93
|
* Format test suite run result as JSON.
|
|
102
94
|
*
|
|
@@ -104,24 +96,23 @@ exports.formatTestRunResultAsJSON = formatTestRunResultAsJSON;
|
|
|
104
96
|
* @param pretty - Whether to pretty-print (default: true)
|
|
105
97
|
* @returns JSON string
|
|
106
98
|
*/
|
|
107
|
-
function formatSuiteRunResultAsJSON(result, pretty = true) {
|
|
99
|
+
export function formatSuiteRunResultAsJSON(result, pretty = true) {
|
|
108
100
|
return JSON.stringify(result, null, pretty ? 2 : 0);
|
|
109
101
|
}
|
|
110
|
-
exports.formatSuiteRunResultAsJSON = formatSuiteRunResultAsJSON;
|
|
111
102
|
/**
|
|
112
103
|
* Format test run result as markdown.
|
|
113
104
|
*
|
|
114
105
|
* @param result - Test run result
|
|
115
106
|
* @returns Markdown output
|
|
116
107
|
*/
|
|
117
|
-
function formatTestRunResultAsMarkdown(result) {
|
|
108
|
+
export function formatTestRunResultAsMarkdown(result) {
|
|
118
109
|
const lines = [];
|
|
119
110
|
lines.push(`# Test: ${result.testName}\n`);
|
|
120
111
|
lines.push(`**Status:** ${result.status === 'Passed' ? '✅ Passed' : '❌ Failed'}`);
|
|
121
112
|
lines.push(`**Score:** ${(result.score * 100).toFixed(1)}%`);
|
|
122
113
|
lines.push(`**Checks:** ${result.passedChecks}/${result.totalChecks} passed`);
|
|
123
114
|
lines.push(`**Duration:** ${formatDuration(result.durationMs)}`);
|
|
124
|
-
lines.push(`**Cost:** ${
|
|
115
|
+
lines.push(`**Cost:** ${formatCost(result.totalCost)}\n`);
|
|
125
116
|
if (result.oracleResults.length > 0) {
|
|
126
117
|
lines.push('## Oracle Results\n');
|
|
127
118
|
lines.push('| Oracle | Status | Score | Message |');
|
|
@@ -134,21 +125,20 @@ function formatTestRunResultAsMarkdown(result) {
|
|
|
134
125
|
}
|
|
135
126
|
return lines.join('\n');
|
|
136
127
|
}
|
|
137
|
-
exports.formatTestRunResultAsMarkdown = formatTestRunResultAsMarkdown;
|
|
138
128
|
/**
|
|
139
129
|
* Format test suite run result as markdown.
|
|
140
130
|
*
|
|
141
131
|
* @param result - Test suite run result
|
|
142
132
|
* @returns Markdown output
|
|
143
133
|
*/
|
|
144
|
-
function formatSuiteRunResultAsMarkdown(result) {
|
|
134
|
+
export function formatSuiteRunResultAsMarkdown(result) {
|
|
145
135
|
const lines = [];
|
|
146
136
|
lines.push(`# Test Suite: ${result.suiteName}\n`);
|
|
147
137
|
lines.push(`**Status:** ${result.status === 'Completed' ? '✅ Completed' : `❌ ${result.status}`}`);
|
|
148
138
|
lines.push(`**Tests:** ${result.passedTests}/${result.totalTests} passed`);
|
|
149
139
|
lines.push(`**Average Score:** ${(result.averageScore * 100).toFixed(1)}%`);
|
|
150
140
|
lines.push(`**Duration:** ${formatDuration(result.durationMs)}`);
|
|
151
|
-
lines.push(`**Cost:** ${
|
|
141
|
+
lines.push(`**Cost:** ${formatCost(result.totalCost)}\n`);
|
|
152
142
|
if (result.testResults.length > 0) {
|
|
153
143
|
lines.push('## Test Results\n');
|
|
154
144
|
lines.push('| Test | Status | Score | Checks |');
|
|
@@ -162,7 +152,6 @@ function formatSuiteRunResultAsMarkdown(result) {
|
|
|
162
152
|
}
|
|
163
153
|
return lines.join('\n');
|
|
164
154
|
}
|
|
165
|
-
exports.formatSuiteRunResultAsMarkdown = formatSuiteRunResultAsMarkdown;
|
|
166
155
|
/**
|
|
167
156
|
* Format test run result as CSV.
|
|
168
157
|
*
|
|
@@ -170,7 +159,7 @@ exports.formatSuiteRunResultAsMarkdown = formatSuiteRunResultAsMarkdown;
|
|
|
170
159
|
* @param includeHeaders - Whether to include CSV headers (default: true)
|
|
171
160
|
* @returns CSV output
|
|
172
161
|
*/
|
|
173
|
-
function formatTestRunResultsAsCSV(results, includeHeaders = true) {
|
|
162
|
+
export function formatTestRunResultsAsCSV(results, includeHeaders = true) {
|
|
174
163
|
const lines = [];
|
|
175
164
|
if (includeHeaders) {
|
|
176
165
|
lines.push('TestName,Status,Score,PassedChecks,TotalChecks,DurationMs,TotalCost');
|
|
@@ -188,14 +177,13 @@ function formatTestRunResultsAsCSV(results, includeHeaders = true) {
|
|
|
188
177
|
}
|
|
189
178
|
return lines.join('\n');
|
|
190
179
|
}
|
|
191
|
-
exports.formatTestRunResultsAsCSV = formatTestRunResultsAsCSV;
|
|
192
180
|
/**
|
|
193
181
|
* Format duration in milliseconds as human-readable string.
|
|
194
182
|
*
|
|
195
183
|
* @param ms - Duration in milliseconds
|
|
196
184
|
* @returns Formatted duration string
|
|
197
185
|
*/
|
|
198
|
-
function formatDuration(ms) {
|
|
186
|
+
export function formatDuration(ms) {
|
|
199
187
|
if (ms < 1000) {
|
|
200
188
|
return `${ms}ms`;
|
|
201
189
|
}
|
|
@@ -206,7 +194,6 @@ function formatDuration(ms) {
|
|
|
206
194
|
const seconds = ((ms % 60000) / 1000).toFixed(0);
|
|
207
195
|
return `${minutes}m ${seconds}s`;
|
|
208
196
|
}
|
|
209
|
-
exports.formatDuration = formatDuration;
|
|
210
197
|
/**
|
|
211
198
|
* Escape CSV field value.
|
|
212
199
|
*
|
|
@@ -225,7 +212,7 @@ function escapeCSV(value) {
|
|
|
225
212
|
* @param results - Array of test run results
|
|
226
213
|
* @returns Summary statistics
|
|
227
214
|
*/
|
|
228
|
-
function generateSummaryStatistics(results) {
|
|
215
|
+
export function generateSummaryStatistics(results) {
|
|
229
216
|
const totalTests = results.length;
|
|
230
217
|
const passedTests = results.filter(r => r.status === 'Passed').length;
|
|
231
218
|
const failedTests = totalTests - passedTests;
|
|
@@ -248,5 +235,4 @@ function generateSummaryStatistics(results) {
|
|
|
248
235
|
avgCost
|
|
249
236
|
};
|
|
250
237
|
}
|
|
251
|
-
exports.generateSummaryStatistics = generateSummaryStatistics;
|
|
252
238
|
//# sourceMappingURL=result-formatter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-formatter.js","sourceRoot":"","sources":["../../src/utils/result-formatter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"result-formatter.js","sourceRoot":"","sources":["../../src/utils/result-formatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAqB;IACrD,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IACvC,KAAK,CAAC,IAAI,CAAC,WAAW,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IACvC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACzD,KAAK,CAAC,IAAI,CAAC,WAAW,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,WAAW,SAAS,CAAC,CAAC;IAC1E,KAAK,CAAC,IAAI,CAAC,aAAa,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC7D,KAAK,CAAC,IAAI,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AAC,CAAC,aAAa,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACpE,MAAM,OAAO,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAE5D,OAAO;QACH,UAAU;QACV,WAAW;QACX,WAAW;QACX,QAAQ;QACR,YAAY;QACZ,aAAa;QACb,SAAS;QACT,WAAW;QACX,OAAO;KACV,CAAC;AACN,CAAC"}
|
package/dist/utils/scoring.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview Scoring utilities for test evaluation
|
|
3
3
|
* @module @memberjunction/testing-engine
|
|
4
4
|
*/
|
|
5
|
-
import { OracleResult, ScoringWeights } from '../types';
|
|
5
|
+
import { OracleResult, ScoringWeights } from '../types.js';
|
|
6
6
|
/**
|
|
7
7
|
* Calculate weighted score from oracle results.
|
|
8
8
|
*
|