Class Assertions
assertEval(dev.dokimos.core.EvalTestCase, java.util.List<dev.dokimos.core.Evaluator>) checks a single test case against its evaluators and throws AssertionError when a score falls below its threshold. assertNoRegression(dev.dokimos.core.ExperimentResult) compares an
experiment result against a committed baseline and throws on a regression on every runner (CI and
local alike), so a failing test is the gate without CI-specific wiring.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertEval(EvalTestCase testCase, Evaluator... evaluators) Asserts that the test case passes all evaluators.static voidassertEval(EvalTestCase testCase, List<Evaluator> evaluators) Asserts that the test case passes all evaluators.static voidassertNoRegression(ExperimentResult candidate) Asserts that the candidate has not regressed against its committed baseline, resolving the baseline from the experiment name.static voidassertNoRegression(ExperimentResult candidate, String baselineName) Asserts that the candidate has not regressed against the baseline namedbaselineName.static voidassertNoRegression(ExperimentResult candidate, String baselineName, GateConfig config) Asserts that the candidate has not regressed against the baseline namedbaselineName, using the supplied configuration.static voidassertNoRegression(ExperimentResult candidate, Path baseline) Asserts that the candidate has not regressed against the baseline at the given path.static voidassertNoRegression(ExperimentResult candidate, Path baseline, GateConfig config) Asserts that the candidate has not regressed against the baseline at the given path, using the supplied configuration.
-
Method Details
-
assertEval
Asserts that the test case passes all evaluators.- Parameters:
testCase- the test case to evaluateevaluators- the evaluators to run- Throws:
AssertionError- if any evaluator score falls below its threshold
-
assertEval
Asserts that the test case passes all evaluators.- Parameters:
testCase- the test case to evaluateevaluators- the evaluators to run- Throws:
AssertionError- if any evaluator score falls below its threshold
-
assertNoRegression
Asserts that the candidate has not regressed against its committed baseline, resolving the baseline from the experiment name.The baseline lives at
src/test/resources/dokimos/baselines/<name>.json, resolved relative to the module directory. With no baseline yet, the first local run writes one and passes, so the new file can be reviewed and committed; setGateConfig.Builder.bootstrapPasses(boolean)tofalseto fail that first run instead, until the baseline is committed. A CI run never writes a baseline (the checkout is ephemeral) and reportsNO_BASELINE. To accept an intended change, re-run withDOKIMOS_UPDATE_BASELINE=true(or-Ddokimos.updateBaseline) to overwrite the baseline.- Parameters:
candidate- the candidate experiment result- Throws:
IllegalArgumentException- if the experiment name is blank or the default"unnamed"(two unnamed experiments would collide on one baseline); name the experiment or pass a PathAssertionError- on a regression, or on the first local baseline write whenbootstrapPassesis false
-
assertNoRegression
Asserts that the candidate has not regressed against the baseline namedbaselineName.- Parameters:
candidate- the candidate experiment resultbaselineName- the logical baseline name (resolved tosrc/test/resources/dokimos/baselines/<name>.json)- Throws:
IllegalArgumentException- ifbaselineNameis blank or"unnamed"AssertionError- on a regression, or on the first local baseline write whenbootstrapPassesis false
-
assertNoRegression
public static void assertNoRegression(ExperimentResult candidate, String baselineName, GateConfig config) Asserts that the candidate has not regressed against the baseline namedbaselineName, using the supplied configuration.- Parameters:
candidate- the candidate experiment resultbaselineName- the logical baseline name (resolved tosrc/test/resources/dokimos/baselines/<name>.json)config- the gate configuration- Throws:
IllegalArgumentException- ifbaselineNameis blank or"unnamed"AssertionError- on a regression, or on the first local baseline write whenbootstrapPassesis false
-
assertNoRegression
Asserts that the candidate has not regressed against the baseline at the given path.- Parameters:
candidate- the candidate experiment resultbaseline- the baseline file path- Throws:
AssertionError- on a regression, or on the first local baseline write whenbootstrapPassesis false
-
assertNoRegression
Asserts that the candidate has not regressed against the baseline at the given path, using the supplied configuration.- Parameters:
candidate- the candidate experiment resultbaseline- the baseline file pathconfig- the gate configuration- Throws:
AssertionError- on a regression, or on the first local baseline write whenbootstrapPassesis false
-