Failing test fixes

This commit is contained in:
Matej Bačo
2025-03-07 21:04:24 +01:00
parent 6a584c83c1
commit c1ee2f2b41
11 changed files with 65 additions and 59 deletions
@@ -83,8 +83,8 @@ class Delete extends Action
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove deployment from DB');
}
if (!empty($deployment->getAttribute('path', ''))) {
if (!($deviceForFunctions->delete($deployment->getAttribute('path', '')))) {
if (!empty($deployment->getAttribute('sourcePath', ''))) {
if (!($deviceForFunctions->delete($deployment->getAttribute('sourcePath', '')))) {
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove deployment from storage');
}
}
@@ -85,7 +85,7 @@ class Get extends Action
$device = $deviceForBuilds;
break;
case 'source':
$path = $deployment->getAttribute('path', '');
$path = $deployment->getAttribute('sourcePath', '');
$device = $deviceForFunctions;
break;
}
@@ -77,7 +77,7 @@ class Create extends Action
throw new Exception(Exception::DEPLOYMENT_NOT_FOUND);
}
$path = $deployment->getAttribute('path');
$path = $deployment->getAttribute('sourcePath');
if (empty($path) || !$deviceForFunctions->exists($path)) {
throw new Exception(Exception::DEPLOYMENT_NOT_FOUND);
}
@@ -224,7 +224,7 @@ class Create extends Action
'resourceInternalId' => $site->getInternalId(),
'resourceId' => $site->getId(),
'resourceType' => 'sites',
'buildCommands' => $commands,
'buildCommands' => \implode(' && ', $commands),
'buildOutput' => $outputDirectory,
'sourcePath' => $path,
'sourceSize' => $fileSize,
@@ -271,7 +271,7 @@ class Create extends Action
'resourceInternalId' => $site->getInternalId(),
'resourceId' => $site->getId(),
'resourceType' => 'sites',
'buildCommands' => $commands,
'buildCommands' => \implode(' && ', $commands),
'buildOutput' => $outputDirectory,
'sourcePath' => $path,
'sourceSize' => $fileSize,
@@ -83,8 +83,8 @@ class Delete extends Action
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove deployment from DB');
}
if (!empty($deployment->getAttribute('path', ''))) {
if (!($deviceForSites->delete($deployment->getAttribute('path', '')))) {
if (!empty($deployment->getAttribute('sourcePath', ''))) {
if (!($deviceForSites->delete($deployment->getAttribute('sourcePath', '')))) {
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove deployment from storage');
}
}
@@ -84,7 +84,7 @@ class Get extends Action
$device = $deviceForBuilds;
break;
case 'source':
$path = $deployment->getAttribute('path', '');
$path = $deployment->getAttribute('sourcePath', '');
$device = $deviceForSites;
break;
}
@@ -78,7 +78,7 @@ class Create extends Action
throw new Exception(Exception::DEPLOYMENT_NOT_FOUND);
}
$path = $deployment->getAttribute('path');
$path = $deployment->getAttribute('sourcePath');
if (empty($path) || !$deviceForSites->exists($path)) {
throw new Exception(Exception::DEPLOYMENT_NOT_FOUND);
}
+1 -1
View File
@@ -976,7 +976,7 @@ class Deletes extends Action
private function deleteDeploymentFiles(Device $device, Document $deployment): void
{
$deploymentId = $deployment->getId();
$deploymentPath = $deployment->getAttribute('path', '');
$deploymentPath = $deployment->getAttribute('sourcePath', '');
if (empty($deploymentPath)) {
Console::info("No deployment files for deployment " . $deploymentId);