diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7c53b03b52..9ddba90595 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -147,9 +147,17 @@ jobs: - name: Run ${{matrix.service}} Tests run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.service}} --debug + - name: Log docker-compose logs + run: docker compose logs appwrite + if: failure() + - name: Run ${{matrix.service}} Shared Tables Tests run: _APP_DATABASE_SHARED_TABLES=database_db_main docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.service}} --debug + - name: Log docker-compose logs + run: docker compose logs appwrite + if: failure() + benchmarking: name: Benchmark runs-on: ubuntu-latest diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index adce8e2cfe..c809d3a15a 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -250,28 +250,21 @@ class FunctionsCustomClientTest extends Scope 'activate' => true ]); - try { - $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'x-appwrite-event' => "OVERRIDDEN", - 'x-appwrite-trigger' => "OVERRIDDEN", - 'x-appwrite-user-id' => "OVERRIDDEN", - 'x-appwrite-user-jwt' => "OVERRIDDEN", - ]); - - $output = json_decode($execution['body']['responseBody'], true); - $this->assertNotEquals('OVERRIDDEN', $output['APPWRITE_FUNCTION_JWT']); - $this->assertNotEquals('OVERRIDDEN', $output['APPWRITE_FUNCTION_EVENT']); - $this->assertNotEquals('OVERRIDDEN', $output['APPWRITE_FUNCTION_TRIGGER']); - $this->assertNotEquals('OVERRIDDEN', $output['APPWRITE_FUNCTION_USER_ID']); - } catch (\Exception $e) { - // output docker logs - $out = ''; - Console::execute('docker compose logs appwrite', '', $out, $out); - fwrite(STDOUT, print_r($out, true)); - } + $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'x-appwrite-event' => "OVERRIDDEN", + 'x-appwrite-trigger' => "OVERRIDDEN", + 'x-appwrite-user-id' => "OVERRIDDEN", + 'x-appwrite-user-jwt' => "OVERRIDDEN", + ]); + + $output = json_decode($execution['body']['responseBody'], true); + $this->assertNotEquals('OVERRIDDEN', $output['APPWRITE_FUNCTION_JWT']); + $this->assertNotEquals('OVERRIDDEN', $output['APPWRITE_FUNCTION_EVENT']); + $this->assertNotEquals('OVERRIDDEN', $output['APPWRITE_FUNCTION_TRIGGER']); + $this->assertNotEquals('OVERRIDDEN', $output['APPWRITE_FUNCTION_USER_ID']); $this->cleanupFunction($functionId);