Commit 463b63db authored by David Monllaó's avatar David Monllaó
Browse files

MDL-66004 analytics: mlbackend_python tested just once

Either running locally from the web server or using a server if
TEST_MLBACKEND_* vars are set. The tests will still be skipped if
the python backend is not available in the web server.
parent fea66a08
......@@ -900,15 +900,12 @@ class core_analytics_prediction_testcase extends advanced_testcase {
// We need to test all prediction processors in the system.
$predictionprocessors = \core_analytics\manager::get_all_prediction_processors();
foreach ($predictionprocessors as $classfullname => $predictionsprocessor) {
foreach ($cases as $key => $case) {
$return[$key . '-' . $classfullname] = $case + ['predictionsprocessor' => $classfullname, 'forcedconfig' => null];
}
if ($predictionsprocessor instanceof \mlbackend_python\processor && !empty($testpythonserver)) {
// We also want to test the python processor using the server.
foreach ($cases as $key => $case) {
if (!$predictionsprocessor instanceof \mlbackend_python\processor || empty($testpythonserver)) {
$extraparams = ['predictionsprocessor' => $classfullname, 'forcedconfig' => null];
$return[$key . '-' . $classfullname] = $case + $extraparams;
} else {
// We want the configuration to be forced during the test as things like importing models create new
// instances of ML backend processors during the process.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment