diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ed2b65ff7..d99c29999a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,7 +4,7 @@ on: [pull_request] jobs: tests: name: Unit & E2E - runs-on: self-hosted + runs-on: ubuntu-latest steps: - name: Checkout repository @@ -23,12 +23,14 @@ jobs: # Upstream bug causes buildkit pulls to fail so prefetch base images # https://github.com/moby/moby/issues/41864 run: | - echo "_APP_FUNCTIONS_RUNTIMES=php-8.0" >> .env + export COMPOSE_INTERACTIVE_NO_CLI + export DOCKER_BUILDKIT=1 + export COMPOSE_DOCKER_CLI_BUILD=1 + export BUILDKIT_PROGRESS=plain docker pull composer:2.0 - docker pull php:8.0-cli-alpine - docker compose build --progress=plain - docker compose up -d - sleep 10 + docker compose -f docker-compose.yml -f docker-compose.ci.yml build appwrite + docker compose -f docker-compose.yml -f docker-compose.ci.yml up -d + sleep 30 - name: Doctor run: docker compose exec -T appwrite doctor @@ -37,10 +39,3 @@ jobs: - name: Run Tests run: docker compose exec -T appwrite test --debug - - - name: Teardown - if: always() - run: | - docker ps -aq | xargs docker rm --force || true - docker volume prune --force || true - docker network prune --force || true \ No newline at end of file diff --git a/README.md b/README.md index c8654b572a..1bd62d61b9 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ -[![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=friendly&color=191120&style=flat-square)](https://hacktoberfest.appwrite.io) +[![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=ready&color=191120&style=flat-square)](https://hacktoberfest.appwrite.io) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord?r=Github) [![Build Status](https://img.shields.io/github/workflow/status/appwrite/appwrite/Tests?label=tests&style=flat-square)](https://github.com/appwrite/appwrite/actions) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml new file mode 100644 index 0000000000..21d5e5d296 --- /dev/null +++ b/docker-compose.ci.yml @@ -0,0 +1,48 @@ +services: + appwrite: + image: appwrite-dev + + appwrite-realtime: + image: appwrite-dev + + appwrite-worker-audits: + image: appwrite-dev + + appwrite-worker-webhooks: + image: appwrite-dev + + appwrite-worker-deletes: + image: appwrite-dev + + appwrite-worker-databases: + image: appwrite-dev + + appwrite-worker-builds: + image: appwrite-dev + + appwrite-worker-certificates: + image: appwrite-dev + + appwrite-worker-functions: + image: appwrite-dev + + appwrite-executor: + image: appwrite-dev + + appwrite-worker-mails: + image: appwrite-dev + + appwrite-worker-messaging: + image: appwrite-dev + + appwrite-maintenance: + image: appwrite-dev + + appwrite-usage-timeseries: + image: appwrite-dev + + appwrite-usage-database: + image: appwrite-dev + + appwrite-schedule: + image: appwrite-dev diff --git a/docker-compose.yml b/docker-compose.yml index 79a8d218fa..6ab2353e3a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -73,9 +73,9 @@ services: build: context: . args: - - DEBUG=false - - TESTING=true - - VERSION=dev + DEBUG: false + TESTING: true + VERSION: dev ports: - 9501:80 networks: diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index 6a0d87c214..56b72e4468 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -116,7 +116,7 @@ class FunctionsCustomClientTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Wait for deployment to be built. - sleep(10); + sleep(20); $function = $this->client->call(Client::METHOD_PATCH, '/functions/' . $function['body']['$id'] . '/deployments/' . $deploymentId, [ 'content-type' => 'application/json', @@ -228,7 +228,7 @@ class FunctionsCustomClientTest extends Scope $deploymentId = $deployment['body']['$id'] ?? ''; // Wait for deployment to be built. - sleep(10); + sleep(20); $this->assertEquals(202, $deployment['headers']['status-code']); @@ -252,7 +252,7 @@ class FunctionsCustomClientTest extends Scope $executionId = $execution['body']['$id'] ?? ''; - sleep(10); + sleep(20); $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions/' . $executionId, [ 'content-type' => 'application/json', @@ -326,7 +326,7 @@ class FunctionsCustomClientTest extends Scope $deploymentId = $deployment['body']['$id'] ?? ''; // Wait for deployment to be built. - sleep(10); + sleep(20); $this->assertEquals(202, $deployment['headers']['status-code']); @@ -395,7 +395,7 @@ class FunctionsCustomClientTest extends Scope $this->assertEquals(202, $execution['headers']['status-code']); - sleep(10); + sleep(20); $base = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions', [ 'content-type' => 'application/json', @@ -556,7 +556,7 @@ class FunctionsCustomClientTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Wait for deployment to be built. - sleep(10); + sleep(20); $function = $this->client->call(Client::METHOD_PATCH, '/functions/' . $functionId . '/deployments/' . $deploymentId, [ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 94f7e84f43..5e498368ea 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -373,7 +373,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals('index.php', $deployment['body']['entrypoint']); // Wait for deployment to build. - sleep(30); + sleep(60); return array_merge($data, ['deploymentId' => $deploymentId]); } @@ -610,7 +610,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals('', $execution['body']['stderr']); $this->assertEquals(0, $execution['body']['duration']); - sleep(5); + sleep(10); $execution = $this->client->call(Client::METHOD_GET, '/functions/' . $data['functionId'] . '/executions/' . $executionId, array_merge([ 'content-type' => 'application/json', @@ -637,7 +637,7 @@ class FunctionsCustomServerTest extends Scope * Test for FAILURE */ - sleep(10); + sleep(20); return array_merge($data, ['executionId' => $executionId]); } @@ -881,7 +881,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Allow build step to run - sleep(20); + sleep(40); $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', array_merge([ 'content-type' => 'application/json', @@ -894,7 +894,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $execution['headers']['status-code']); - sleep(10); + sleep(20); $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions', array_merge([ 'content-type' => 'application/json', @@ -965,7 +965,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Allow build step to run - sleep(10); + sleep(20); $deployment = $this->client->call(Client::METHOD_PATCH, '/functions/' . $functionId . '/deployments/' . $deploymentId, array_merge([ 'content-type' => 'application/json', @@ -988,7 +988,7 @@ class FunctionsCustomServerTest extends Scope $executionId = $execution['body']['$id'] ?? ''; - sleep(10); + sleep(20); $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions/' . $executionId, array_merge([ 'content-type' => 'application/json', @@ -1087,7 +1087,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Allow build step to run - sleep(10); + sleep(20); $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', array_merge([ 'content-type' => 'application/json', @@ -1103,7 +1103,7 @@ class FunctionsCustomServerTest extends Scope $executionId = $execution['body']['$id'] ?? ''; - sleep(10); + sleep(20); $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions/' . $executionId, array_merge([ 'content-type' => 'application/json', @@ -1200,7 +1200,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Allow build step to run - sleep(30); + sleep(60); $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', array_merge([ 'content-type' => 'application/json', @@ -1216,7 +1216,7 @@ class FunctionsCustomServerTest extends Scope $executionId = $execution['body']['$id'] ?? ''; - sleep(30); + sleep(60); $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions/' . $executionId, array_merge([ 'content-type' => 'application/json', @@ -1314,7 +1314,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Allow build step to run - sleep(40); + sleep(80); $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', array_merge([ 'content-type' => 'application/json', @@ -1330,7 +1330,7 @@ class FunctionsCustomServerTest extends Scope $executionId = $execution['body']['$id'] ?? ''; - sleep(10); + sleep(20); $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions/' . $executionId, array_merge([ 'content-type' => 'application/json', @@ -1428,7 +1428,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); // Allow build step to run - sleep(30); + sleep(60); $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', array_merge([ 'content-type' => 'application/json', @@ -1444,7 +1444,7 @@ class FunctionsCustomServerTest extends Scope $executionId = $execution['body']['$id'] ?? ''; - sleep(10); + sleep(20); $executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions/' . $executionId, array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php index db520bf502..f2f4b27260 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php @@ -634,7 +634,7 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); // wait for timeout function to complete - sleep(10); + sleep(20); $webhook = $this->getLastRequest(); $signatureExpected = self::getWebhookSignature($webhook, $this->getProject()['signatureKey']);