From 3a5bb6b5a69e04470d3c19c3e87ca4b80809c4ce Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Dec 2025 06:01:00 +0000 Subject: [PATCH] Fix SMTP test configuration to work without authentication Remove maildev authentication configuration as the mailcatcher image doesn't support it. Tests now use empty credentials which works with the unauthenticated maildev instance. Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com> --- .env | 4 ++-- docker-compose.yml | 3 --- .../Services/Projects/ProjectsConsoleClientTest.php | 10 +++++----- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.env b/.env index 4fbe3333b4..55ec662f24 100644 --- a/.env +++ b/.env @@ -69,8 +69,8 @@ _APP_STORAGE_ANTIVIRUS_PORT=3310 _APP_SMTP_HOST=maildev _APP_SMTP_PORT=1025 _APP_SMTP_SECURE= -_APP_SMTP_USERNAME=user -_APP_SMTP_PASSWORD=password +_APP_SMTP_USERNAME= +_APP_SMTP_PASSWORD= _APP_SMS_PROVIDER=sms://username:password@mock _APP_SMS_FROM=+123456789 _APP_SMS_PROJECTS_DENY_LIST= diff --git a/docker-compose.yml b/docker-compose.yml index b6b22baa49..f246dbb456 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1110,9 +1110,6 @@ services: - "traefik.http.routers.appwrite_maildev_https.rule=Host(`mail.localhost`)" - "traefik.http.routers.appwrite_maildev_https.service=appwrite_maildev" - "traefik.http.routers.appwrite_maildev_https.tls=true" - environment: - - MAILDEV_INCOMING_USER=${_APP_SMTP_USERNAME} - - MAILDEV_INCOMING_PASS=${_APP_SMTP_PASSWORD} request-catcher-webhook: # used mainly for dev tests (mock HTTP webhook) image: appwrite/requestcatcher:1.0.0 diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index bda213d121..6ae578385a 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -620,11 +620,11 @@ class ProjectsConsoleClientTest extends Scope $id = $data['projectId']; $smtpHost = System::getEnv('_APP_SMTP_HOST', "maildev"); $smtpPort = intval(System::getEnv('_APP_SMTP_PORT', "1025")); - $smtpUsername = System::getEnv('_APP_SMTP_USERNAME', 'user'); - $smtpPassword = System::getEnv('_APP_SMTP_PASSWORD', 'password'); + $smtpUsername = System::getEnv('_APP_SMTP_USERNAME', ''); + $smtpPassword = System::getEnv('_APP_SMTP_PASSWORD', ''); /** - * Test for SUCCESS: Valid Credentials + * Test for SUCCESS: Valid Connection (no auth required) */ $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/smtp', array_merge([ 'content-type' => 'application/json', @@ -695,8 +695,8 @@ class ProjectsConsoleClientTest extends Scope { $smtpHost = System::getEnv('_APP_SMTP_HOST', "maildev"); $smtpPort = intval(System::getEnv('_APP_SMTP_PORT', "1025")); - $smtpUsername = System::getEnv('_APP_SMTP_USERNAME', 'user'); - $smtpPassword = System::getEnv('_APP_SMTP_PASSWORD', 'password'); + $smtpUsername = System::getEnv('_APP_SMTP_USERNAME', ''); + $smtpPassword = System::getEnv('_APP_SMTP_PASSWORD', ''); // Create a team $team = $this->client->call(Client::METHOD_POST, '/teams', array_merge([