diff --git a/app/config/environments.php b/app/config/environments.php index 179c1e0cd5..574156d76c 100644 --- a/app/config/environments.php +++ b/app/config/environments.php @@ -113,7 +113,7 @@ $environments = [ 'image' => 'appwrite/env-dotnet-3.1:1.0.0', 'build' => '/usr/src/code/docker/environments/dotnet-3.1', 'logo' => 'dotnet.png', - 'supports' => [System::X86, System::ARM], + 'supports' => [System::X86], ], 'dotnet-5.0' => [ 'name' => '.NET', diff --git a/docker/environments/build.sh b/docker/environments/build.sh index 1543c5814d..db25475537 100644 --- a/docker/environments/build.sh +++ b/docker/environments/build.sh @@ -34,7 +34,7 @@ echo 'Dart 2.10...' docker buildx build --platform linux/amd64 -t appwrite/env-dart-2.10:1.0.0 ./docker/environments/dart-2.10/ --push echo '.NET 3.1...' -docker buildx build --platform linux/amd64,linux/arm64 -t appwrite/env-dotnet-3.1:1.0.0 ./docker/environments/dotnet-3.1/ --push +docker buildx build --platform linux/amd64 -t appwrite/env-dotnet-3.1:1.0.0 ./docker/environments/dotnet-3.1/ --push echo '.NET 5.0...' docker buildx build --platform linux/amd64,linux/arm64 -t appwrite/env-dotnet-5.0:1.0.0 ./docker/environments/dotnet-5.0/ --push diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index b41fa12f1c..bb5dd65f52 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -454,110 +454,85 @@ class FunctionsCustomServerTest extends Scope public function testENVS():array { - $functions = realpath(__DIR__ . '/../../../resources/functions'); + $functionsDir = realpath(__DIR__ . '/../../../resources/functions'); + $envs = require('app/config/environments.php'); + /** * Command for rebuilding code packages: * bash tests/resources/functions/package-*.sh */ - $envs = [ - [ - 'language' => 'PHP', - 'version' => '7.4', - 'name' => 'php-7.4', - 'code' => $functions.'/php.tar.gz', + $functions = [ + 'node-14.5' => [ + 'code' => $functionsDir.'/node.tar.gz', + 'command' => 'node index.js', + 'timeout' => 15, + ], + 'node-15.5' => [ + 'code' => $functionsDir.'/node.tar.gz', + 'command' => 'node index.js', + 'timeout' => 15, + ], + 'php-7.4' => [ + 'code' => $functionsDir.'/php.tar.gz', 'command' => 'php index.php', 'timeout' => 15, ], - [ - 'language' => 'PHP', - 'version' => '8.0', - 'name' => 'php-8.0', - 'code' => $functions.'/php.tar.gz', + 'php-8.0' => [ + 'code' => $functionsDir.'/php.tar.gz', 'command' => 'php index.php', 'timeout' => 15, ], - [ - 'language' => 'Python', - 'version' => '3.8', - 'name' => 'python-3.8', - 'code' => $functions.'/python.tar.gz', + 'ruby-2.7' => [ + 'code' => $functionsDir.'/ruby.tar.gz', + 'command' => 'ruby app.rb', + 'timeout' => 15, + ], + 'ruby-3.0' => [ + 'code' => $functionsDir.'/ruby.tar.gz', + 'command' => 'ruby app.rb', + 'timeout' => 15, + ], + 'python-3.8' => [ + 'code' => $functionsDir.'/python.tar.gz', 'command' => 'python main.py', 'timeout' => 15, ], - [ - 'language' => 'Node.js', - 'version' => '14.5', - 'name' => 'node-14.5', - 'code' => $functions.'/node.tar.gz', - 'command' => 'node index.js', - 'timeout' => 15, - ], - [ - 'language' => 'Node.js', - 'version' => '15.5', - 'name' => 'node-15.5', - 'code' => $functions.'/node.tar.gz', - 'command' => 'node index.js', - 'timeout' => 15, - ], - [ - 'language' => 'Ruby', - 'version' => '2.7', - 'name' => 'ruby-2.7', - 'code' => $functions.'/ruby.tar.gz', - 'command' => 'ruby app.rb', - 'timeout' => 15, - ], - [ - 'language' => 'Ruby', - 'version' => '3.0', - 'name' => 'ruby-3.0', - 'code' => $functions.'/ruby.tar.gz', - 'command' => 'ruby app.rb', - 'timeout' => 15, - ], - [ - 'language' => 'Deno', - 'version' => '1.5', - 'name' => 'deno-1.5', - 'code' => $functions.'/deno.tar.gz', + 'deno-1.2' => [ + 'code' => $functionsDir.'/deno.tar.gz', 'command' => 'deno run --allow-env index.ts', 'timeout' => 15, ], - [ - 'language' => 'Deno', - 'version' => '1.6', - 'name' => 'deno-1.6', - 'code' => $functions.'/deno.tar.gz', + 'deno-1.5' => [ + 'code' => $functionsDir.'/deno.tar.gz', 'command' => 'deno run --allow-env index.ts', 'timeout' => 15, ], - [ - 'language' => 'Dart', - 'version' => '2.10', - 'name' => 'dart-2.10', - 'code' => $functions.'/dart.tar.gz', + 'deno-1.6' => [ + 'code' => $functionsDir.'/deno.tar.gz', + 'command' => 'deno run --allow-env index.ts', + 'timeout' => 15, + ], + 'dart-2.10' => [ + 'code' => $functionsDir.'/dart.tar.gz', 'command' => 'dart main.dart', 'timeout' => 15, ], - [ - 'language' => '.NET', - 'version' => '3.1', - 'name' => 'dotnet-3.1', - 'code' => $functions.'/dotnet-3.1.tar.gz', + 'dotnet-3.1' => [ + 'code' => $functionsDir.'/dotnet-3.1.tar.gz', 'command' => 'dotnet dotnet.dll', 'timeout' => 15, ], - [ - 'language' => '.NET', - 'version' => '5.0', - 'name' => 'dotnet-5.0', - 'code' => $functions.'/dotnet-5.0.tar.gz', + 'dotnet-5.0' => [ + '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]); + } sleep(count($envs) * 15); fwrite(STDERR, "."); @@ -581,9 +556,9 @@ class FunctionsCustomServerTest extends Scope $fileId = $file['body']['$id'] ?? ''; foreach ($envs as $key => $env) { - $language = $env['language'] ?? ''; + $name = $key ?? ''; + $language = $env['name'] ?? ''; $version = $env['version'] ?? ''; - $name = $env['name'] ?? ''; $code = $env['code'] ?? ''; $command = $env['command'] ?? ''; $timeout = $env['timeout'] ?? 15;