From 2175302e9b593cc2351a6fe48090916bb0dc195d Mon Sep 17 00:00:00 2001 From: kodumbeats Date: Thu, 25 Mar 2021 15:08:02 -0400 Subject: [PATCH 1/4] ClamAV was reverted to v1.2.0 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3de8f3aad5..28937b160e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -414,7 +414,7 @@ services: - appwrite-redis:/data:rw clamav: - image: appwrite/clamav:1.3.0 + image: appwrite/clamav:1.2.0 container_name: appwrite-clamav networks: - appwrite From f2a54d8f0057012f99810dd74cce49cdb56274cb Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Fri, 16 Apr 2021 18:13:03 +0300 Subject: [PATCH 2/4] Fixed functions tests --- .../Functions/FunctionsCustomServerTest.php | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 01b93d1ab9..a6cc1e5bd5 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -462,12 +462,12 @@ class FunctionsCustomServerTest extends Scope * Command for rebuilding code packages: * bash tests/resources/functions/package-*.sh */ - $envs = [ + $functions = [ [ 'language' => 'PHP', 'version' => '7.4', 'name' => 'php-7.4', - 'code' => $functions.'/php.tar.gz', + 'code' => $functionsDir.'/php.tar.gz', 'command' => 'php index.php', 'timeout' => 15, ], @@ -475,7 +475,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'PHP', 'version' => '8.0', 'name' => 'php-8.0', - 'code' => $functions.'/php.tar.gz', + 'code' => $functionsDir.'/php.tar.gz', 'command' => 'php index.php', 'timeout' => 15, ], @@ -483,7 +483,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Python', 'version' => '3.8', 'name' => 'python-3.8', - 'code' => $functions.'/python.tar.gz', + 'code' => $functionsDir.'/python.tar.gz', 'command' => 'python main.py', 'timeout' => 15, ], @@ -491,7 +491,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Python', 'version' => '3.9', 'name' => 'python-3.9', - 'code' => $functions.'/python.tar.gz', + 'code' => $functionsDir.'/python.tar.gz', 'command' => 'python main.py', 'timeout' => 15, ], @@ -499,7 +499,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Node.js', 'version' => '14.5', 'name' => 'node-14.5', - 'code' => $functions.'/node.tar.gz', + 'code' => $functionsDir.'/node.tar.gz', 'command' => 'node index.js', 'timeout' => 15, ], @@ -507,7 +507,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Node.js', 'version' => '15.5', 'name' => 'node-15.5', - 'code' => $functions.'/node.tar.gz', + 'code' => $functionsDir.'/node.tar.gz', 'command' => 'node index.js', 'timeout' => 15, ], @@ -515,7 +515,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Ruby', 'version' => '2.7', 'name' => 'ruby-2.7', - 'code' => $functions.'/ruby.tar.gz', + 'code' => $functionsDir.'/ruby.tar.gz', 'command' => 'ruby app.rb', 'timeout' => 15, ], @@ -523,7 +523,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Ruby', 'version' => '3.0', 'name' => 'ruby-3.0', - 'code' => $functions.'/ruby.tar.gz', + 'code' => $functionsDir.'/ruby.tar.gz', 'command' => 'ruby app.rb', 'timeout' => 15, ], @@ -531,7 +531,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Deno', 'version' => '1.5', 'name' => 'deno-1.5', - 'code' => $functions.'/deno.tar.gz', + 'code' => $functionsDir.'/deno.tar.gz', 'command' => 'deno run --allow-env index.ts', 'timeout' => 15, ], @@ -539,7 +539,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Deno', 'version' => '1.6', 'name' => 'deno-1.6', - 'code' => $functions.'/deno.tar.gz', + 'code' => $functionsDir.'/deno.tar.gz', 'command' => 'deno run --allow-env index.ts', 'timeout' => 15, ], @@ -547,7 +547,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Deno', 'version' => '1.8', 'name' => 'deno-1.8', - 'code' => $functions.'/deno.tar.gz', + 'code' => $functionsDir.'/deno.tar.gz', 'command' => 'deno run --allow-env index.ts', 'timeout' => 15, ], @@ -555,7 +555,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Dart', 'version' => '2.10', 'name' => 'dart-2.10', - 'code' => $functions.'/dart.tar.gz', + 'code' => $functionsDir.'/dart.tar.gz', 'command' => 'dart main.dart', 'timeout' => 15, ], @@ -563,7 +563,7 @@ class FunctionsCustomServerTest extends Scope 'language' => 'Dart', 'version' => '2.12', 'name' => 'dart-2.12', - 'code' => $functions.'/dart.tar.gz', + 'code' => $functionsDir.'/dart.tar.gz', 'command' => 'dart main.dart', 'timeout' => 15, ], @@ -571,7 +571,7 @@ class FunctionsCustomServerTest extends Scope 'language' => '.NET', 'version' => '3.1', 'name' => 'dotnet-3.1', - 'code' => $functions.'/dotnet-3.1.tar.gz', + 'code' => $functionsDir.'/dotnet-3.1.tar.gz', 'command' => 'dotnet dotnet.dll', 'timeout' => 15, ], @@ -579,17 +579,20 @@ class FunctionsCustomServerTest extends Scope 'language' => '.NET', 'version' => '5.0', 'name' => 'dotnet-5.0', - 'code' => $functions.'/dotnet-5.0.tar.gz', + 'code' => $functionsDir.'/dotnet-5.0.tar.gz', 'command' => 'dotnet dotnet.dll', 'timeout' => 15, ], ]; - foreach ($envs as $key => $env) { - $envs[$key] = array_merge($env, $functions[$key]); + foreach ($functions as $key => $env) { + $name = $env['name'] ?? ''; + if(!isset($envs[$name])) { + unset($functions[$key]); + } } - sleep(count($envs) * 20); + sleep(count($functions) * 20); fwrite(STDERR, "."); /** From 5c6d17bd873b82604412622ab5985b032c2c97a7 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 17 Apr 2021 00:25:25 +0300 Subject: [PATCH 3/4] Fixed tests --- tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index a6cc1e5bd5..15e35a8cfb 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -457,7 +457,6 @@ class FunctionsCustomServerTest extends Scope $functionsDir = realpath(__DIR__ . '/../../../resources/functions'); $envs = require('app/config/environments.php'); - /** * Command for rebuilding code packages: * bash tests/resources/functions/package-*.sh @@ -613,7 +612,7 @@ class FunctionsCustomServerTest extends Scope $fileId = $file['body']['$id'] ?? ''; - foreach ($envs as $key => $env) { + foreach ($functions as $key => $env) { $name = $key ?? ''; $language = $env['name'] ?? ''; $version = $env['version'] ?? ''; From 181fb05fd46bbd17dc98174f0aa4a17c8347c4b5 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 17 Apr 2021 01:10:27 +0300 Subject: [PATCH 4/4] Fixed tests --- tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 15e35a8cfb..4bd5d1ee5a 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -613,8 +613,8 @@ class FunctionsCustomServerTest extends Scope $fileId = $file['body']['$id'] ?? ''; foreach ($functions as $key => $env) { - $name = $key ?? ''; - $language = $env['name'] ?? ''; + $name = $env['name'] ?? ''; + $language = $env['language'] ?? ''; $version = $env['version'] ?? ''; $code = $env['code'] ?? ''; $command = $env['command'] ?? '';