Fix edge agent CI setup
This commit is contained in:
@@ -19,6 +19,7 @@ it('serves whole-department expected relay states and records successful physica
|
||||
]);
|
||||
$departmentId = (int)$scenario['department']['id'];
|
||||
$laneId = (int)$scenario['lane']['id'];
|
||||
api_fixtures()->setDepartmentShellyTransportMode($departmentId, 'gateway');
|
||||
$session = api_fixtures()->createEdgeOperatorSession($departmentId, [
|
||||
'modules_selfserve_lane_relay_machine_status_set',
|
||||
'modules_selfserve_lane_relay_machine_cleaner_status_set',
|
||||
|
||||
@@ -175,6 +175,41 @@ final class ApiFixtures
|
||||
$this->cleanup->add(fn() => $this->deleteById('department_variables', $variableId));
|
||||
}
|
||||
|
||||
public function setDepartmentShellyTransportMode(int $departmentId, string $mode): void
|
||||
{
|
||||
if ($departmentId <= 0) {
|
||||
throw new RuntimeException('Department Shelly transport fixtures require a positive department id.');
|
||||
}
|
||||
|
||||
$mode = strtolower(trim($mode));
|
||||
if (!in_array($mode, ['cloud', 'gateway'], true)) {
|
||||
throw new RuntimeException('Invalid Shelly transport fixture mode.');
|
||||
}
|
||||
|
||||
$this->cleanupDeleteWhere('department_variables', [
|
||||
'department_id' => $departmentId,
|
||||
'variable' => 'shelly_transport_mode',
|
||||
]);
|
||||
|
||||
$existingIds = $this->fetchIntColumnWhere('department_variables', 'id', [
|
||||
'department_id' => $departmentId,
|
||||
'variable' => 'shelly_transport_mode',
|
||||
]);
|
||||
if ($existingIds !== []) {
|
||||
$this->updateById('department_variables', (int)$existingIds[0], [
|
||||
'value' => $mode,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$variableId = $this->insertRowWithExistingColumns('department_variables', [
|
||||
'department_id' => $departmentId,
|
||||
'variable' => 'shelly_transport_mode',
|
||||
'value' => $mode,
|
||||
]);
|
||||
$this->cleanup->add(fn() => $this->deleteById('department_variables', $variableId));
|
||||
}
|
||||
|
||||
public function setLaneSelfServeEnabled(int $laneId, bool $enabled): void
|
||||
{
|
||||
if ($laneId <= 0) {
|
||||
|
||||
Reference in New Issue
Block a user