1
0
Fork 0
mirror of synced 2024-09-09 22:27:06 +12:00

Merge pull request #882 from TorstenDittmann/feat-465-add-arm-support

feat(tests): add architecture detection
This commit is contained in:
Eldad A. Fux 2021-02-05 20:46:30 +02:00 committed by GitHub
commit 469fe6a9c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 79 deletions

View file

@ -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',

View file

@ -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

View file

@ -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;