Fix tests

This commit is contained in:
Matej Bačo
2024-08-14 16:35:24 +00:00
parent f45f2f127b
commit d6676c2e4d
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -250,7 +250,7 @@ class Builds extends Action
}
$tarParamDirectory = \escapeshellarg('/tmp/builds/' . $buildId . '-template' . (empty($templateRootDirectory) ? '' : '/' . $templateRootDirectory));
Console::execute('tar --exclude code.tar.gz -czf ' . \escapeshellarg($tmpPathFile) . ' -C ' . \escapeshellarg($tarParamDirectory) . ' .', '', $stdout, $stderr);
Console::execute('tar --exclude code.tar.gz -czf ' . \escapeshellarg($tmpPathFile) . ' -C ' . \escapeshellcmd($tarParamDirectory) . ' .', '', $stdout, $stderr); // TODO: Replace escapeshellcmd with escapeshellarg if we find a way that doesnt break syntax
$source = $deviceForFunctions->getPath($deployment->getId() . '.' . \pathinfo('code.tar.gz', PATHINFO_EXTENSION));
$result = $localDevice->transfer($tmpPathFile, $source, $deviceForFunctions);
@@ -291,7 +291,7 @@ class Builds extends Action
$gitCloneCommand = $github->generateCloneCommand($cloneOwner, $cloneRepository, $cloneVersion, $cloneType, $tmpDirectory, $rootDirectory);
$stdout = '';
$stderr = '';
Console::execute('mkdir -p ' . \escapeshellarg('/tmp/builds/' . $buildId), '', $stdout, $stderr);
if ($dbForProject->getDocument('builds', $buildId)->getAttribute('status') === 'canceled') {
@@ -403,7 +403,7 @@ class Builds extends Action
}
$tarParamDirectory = '/tmp/builds/' . $buildId . '/code' . (empty($rootDirectory) ? '' : '/' . $rootDirectory);
Console::execute('tar --exclude code.tar.gz -czf ' . \escapeshellarg($tmpPathFile) . ' -C ' . \escapeshellarg($tarParamDirectory) . ' .', '', $stdout, $stderr);
Console::execute('tar --exclude code.tar.gz -czf ' . \escapeshellarg($tmpPathFile) . ' -C ' . \escapeshellcmd($tarParamDirectory) . ' .', '', $stdout, $stderr); // TODO: Replace escapeshellcmd with escapeshellarg if we find a way that doesnt break syntax
$source = $deviceForFunctions->getPath($deployment->getId() . '.' . \pathinfo('code.tar.gz', PATHINFO_EXTENSION));
$result = $localDevice->transfer($tmpPathFile, $source, $deviceForFunctions);
@@ -1439,7 +1439,7 @@ class FunctionsCustomServerTest extends Scope
// +10 seconds, maximum update interval time
// +60 seconds, possible overlap between update and schedule tick
// +10 seconds, maximum execution time including cold-start
// Result: We allow maximum
// Result: We allow maximum
if (\microtime(true) - $start > 140) {
$this->fail('Execution did not create within 140 seconds of schedule: ' . \json_encode($executions));
}