1 Commits

Author SHA1 Message Date
Sebastian 0891a5b600 chore(deps): update dependency vuetify to v4.1.5
PHP Unit Tests / test (pull_request) Failing after 12m28s
JS Unit Tests / test (pull_request) Failing after 12m41s
Build Test / test (pull_request) Failing after 12m51s
2026-07-18 03:05:11 +00:00
13 changed files with 1155 additions and 1541 deletions
@@ -1,59 +0,0 @@
name: PHP Integration Tests
on:
pull_request:
workflow_dispatch:
jobs:
test:
name: Integration Tests
runs-on: ubuntu-latest
services:
mongo:
image: mongo:8
options: >-
--health-cmd "mongosh --quiet --eval \"db.adminCommand('ping')\""
--health-interval 5s
--health-timeout 5s
--health-retries 12
steps:
- name: Retrieve Server Install Action
uses: actions/checkout@v6.0.2
with:
repository: Nodarx/action-server-install
ref: main
path: action-server-install
github-server-url: https://git.ktrix.dev
- name: Install server
uses: ./action-server-install
with:
install-php: 'true'
php-version: '8.5'
server-path: './server'
database-uri: 'mongodb://mongo:27017/?tls=false'
database-name: 'ktrix_ci'
app-environment: 'test'
- name: Checkout module under test
uses: actions/checkout@v6.0.2
with:
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.head.sha || github.sha }}
path: server/modules/provider_jmapc
github-server-url: https://git.ktrix.dev
- name: Install module dependencies
run: composer install --prefer-dist --no-progress
working-directory: server/modules/provider_jmapc
- name: Install and enable module
working-directory: server
run: |
php bin/console module:install provider_jmapc
php bin/console module:enable provider_jmapc
- name: Run integration tests
working-directory: server/modules/provider_jmapc
run: composer test:integration
+5 -1
View File
@@ -14,7 +14,11 @@ node_modules/
# Backend development # Backend development
/lib/vendor/ /lib/vendor/
coverage/ coverage/
*.cache phpunit.xml.cache
.phpunit.cache
.phpunit.result.cache
.php-cs-fixer.cache
.phpstan.cache
.phpactor/ .phpactor/
# Editors # Editors
+5 -6
View File
@@ -10,7 +10,7 @@
"config": { "config": {
"optimize-autoloader": true, "optimize-autoloader": true,
"platform": { "platform": {
"php": "8.3" "php": "8.2"
}, },
"autoloader-suffix": "ProviderJmapc", "autoloader-suffix": "ProviderJmapc",
"vendor-dir": "lib/vendor", "vendor-dir": "lib/vendor",
@@ -27,11 +27,11 @@
"require": { "require": {
"guzzlehttp/guzzle": "^7.0", "guzzlehttp/guzzle": "^7.0",
"guzzlehttp/psr7": "^2.0", "guzzlehttp/psr7": "^2.0",
"php": ">=8.3 <=8.5", "php": ">=8.2 <=8.5",
"sebastiankrupinski/jmap-client-php": "dev-main" "sebastiankrupinski/jmap-client-php": "dev-main"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^12.0" "phpunit/phpunit": "^11.0"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@@ -48,8 +48,7 @@
], ],
"post-update-cmd": [ "post-update-cmd": [
], ],
"test:unit": "phpunit --configuration tests/php/phpunit.xml --testsuite \"Unit Tests\" --colors=always --testdox", "test:unit": "phpunit --configuration tests/php/phpunit.unit.xml --colors=always --testdox",
"test:integration": "phpunit --configuration tests/php/phpunit.xml --testsuite \"Integration Tests\" --colors=always --testdox", "test:coverage": "XDEBUG_MODE=coverage phpunit --configuration tests/php/phpunit.unit.xml --coverage-html .phpunit.coverage --coverage-text"
"test:coverage": "XDEBUG_MODE=coverage phpunit --configuration tests/php/phpunit.xml --testsuite \"Unit Tests\" --coverage-html .phpunit.coverage --coverage-text"
} }
} }
Generated
+360 -276
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -142,7 +142,7 @@ class Provider implements ProviderBaseInterface, ProviderServiceMutateInterface,
} }
$created = $this->serviceStore->create($tenantId, $userId, $service); $created = $this->serviceStore->create($tenantId, $userId, $service);
return (string) $created['sid']; return (string) $created['id'];
} }
public function serviceModify(string $tenantId, string $userId, ResourceServiceMutateInterface $service): string public function serviceModify(string $tenantId, string $userId, ResourceServiceMutateInterface $service): string
@@ -151,8 +151,8 @@ class Provider implements ProviderBaseInterface, ProviderServiceMutateInterface,
throw new \InvalidArgumentException('Service must be instance of JMAP Service'); throw new \InvalidArgumentException('Service must be instance of JMAP Service');
} }
$this->serviceStore->modify($tenantId, $userId, $service); $updated = $this->serviceStore->modify($tenantId, $userId, $service);
return (string) $service->identifier(); return (string) $updated['sid'];
} }
public function serviceDestroy(string $tenantId, string $userId, ResourceServiceMutateInterface $service): bool public function serviceDestroy(string $tenantId, string $userId, ResourceServiceMutateInterface $service): bool
+1 -1
View File
@@ -97,7 +97,7 @@ class Provider implements IProviderBase, IProviderServiceMutate
} }
// Note: This simplified interface doesn't pass tenantId // Note: This simplified interface doesn't pass tenantId
// Will need to get it from TenantContextInterface in actual implementation // Will need to get it from SessionTenant in actual implementation
throw new \RuntimeException('Use Mail Provider interface for service creation'); throw new \RuntimeException('Use Mail Provider interface for service creation');
} }
+7 -4
View File
@@ -13,7 +13,7 @@ use GuzzleHttp\Client as HttpClient;
use GuzzleHttp\Psr7\HttpFactory; use GuzzleHttp\Psr7\HttpFactory;
use JmapClient\Authentication\Basic; use JmapClient\Authentication\Basic;
use JmapClient\Client as JmapClient; use JmapClient\Client as JmapClient;
use KTXF\Security\Crypto; use KTXC\Server;
use KTXF\Resource\Provider\ResourceServiceIdentityBasic; use KTXF\Resource\Provider\ResourceServiceIdentityBasic;
use KTXF\Resource\Provider\ResourceServiceLocationUri; use KTXF\Resource\Provider\ResourceServiceLocationUri;
use KTXM\ProviderJmapc\Providers\Mail\Service as MailService; use KTXM\ProviderJmapc\Providers\Mail\Service as MailService;
@@ -73,7 +73,8 @@ class RemoteService {
} }
// debugging // debugging
if ($service->getDebug()) { if ($service->getDebug()) {
$logDir = dirname(__DIR__, 5) . '/var/log/jmap/' . $service->identifier() . '.json'; $logDir = Server::getInstance()?->logDir();
$logDir .= '/jmap/' . $service->identifier() . '.json';
$client->configureTransportLogState(true); $client->configureTransportLogState(true);
$client->configureTransportLogLocation($logDir); $client->configureTransportLogLocation($logDir);
} }
@@ -199,7 +200,7 @@ class RemoteService {
return $service; return $service;
} }
public static function cookieStoreRetrieve(mixed $id, Crypto $crypto): ?array { public static function cookieStoreRetrieve(mixed $id): ?array {
$file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . (string)$id . '.jmapc'; $file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . (string)$id . '.jmapc';
@@ -208,6 +209,7 @@ class RemoteService {
} }
$data = file_get_contents($file); $data = file_get_contents($file);
$crypto = Server::getInstance()->container()->get(\KTXF\Security\Crypto::class);
$data = $crypto->decrypt($data); $data = $crypto->decrypt($data);
if (!empty($data)) { if (!empty($data)) {
@@ -218,12 +220,13 @@ class RemoteService {
} }
public static function cookieStoreDeposit(mixed $id, array $value, Crypto $crypto): void { public static function cookieStoreDeposit(mixed $id, array $value): void {
if (empty($value)) { if (empty($value)) {
return; return;
} }
$crypto = Server::getInstance()->container()->get(\KTXF\Security\Crypto::class);
$data = $crypto->encrypt(json_encode($value)); $data = $crypto->encrypt(json_encode($value));
$file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . (string)$id . '.jmapc'; $file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . (string)$id . '.jmapc';
+767 -1140
View File
File diff suppressed because it is too large Load Diff
+2 -5
View File
@@ -18,7 +18,7 @@
"test:coverage": "vitest run --coverage --config tests/js/vitest.config.ts" "test:coverage": "vitest run --coverage --config tests/js/vitest.config.ts"
}, },
"dependencies": { "dependencies": {
"pinia": "^4.0.0", "pinia": "^3.0.0",
"vue": "^3.5.18", "vue": "^3.5.18",
"vue-router": "^5.0.0", "vue-router": "^5.0.0",
"vuetify": "^4.0.0" "vuetify": "^4.0.0"
@@ -27,12 +27,9 @@
"@vitejs/plugin-vue": "^6.0.1", "@vitejs/plugin-vue": "^6.0.1",
"@vitest/coverage-v8": "^4.0.18", "@vitest/coverage-v8": "^4.0.18",
"@vitest/ui": "^4.0.18", "@vitest/ui": "^4.0.18",
"@vue/test-utils": "^2.4.10",
"@vue/tsconfig": "^0.9.0", "@vue/tsconfig": "^0.9.0",
"jsdom": "^30.0.0", "typescript": "~7.0.0",
"typescript": "~6.0.0",
"vite": "^8.0.0", "vite": "^8.0.0",
"vitest": "^4.0.18",
"vue-tsc": "^3.0.5" "vue-tsc": "^3.0.5"
} }
} }
+3 -3
View File
@@ -1,17 +1,17 @@
import { fileURLToPath } from 'node:url' import { fileURLToPath } from 'node:url'
import { defineConfig, configDefaults } from 'vitest/config' import { defineConfig, configDefaults } from 'vitest/config'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import vuetify from 'vite-plugin-vuetify'
import path from 'path' import path from 'path'
const __filename = fileURLToPath(import.meta.url) const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename) const __dirname = path.dirname(__filename)
export default defineConfig({ export default defineConfig({
plugins: [vue()], plugins: [vue(), vuetify()],
resolve: { resolve: {
alias: { alias: {
'@': path.resolve(__dirname, '../../src'), '@KTXC': path.resolve(__dirname, '../../../core/src'),
'@KTXC': path.resolve(__dirname, '../../../../core/src'),
}, },
}, },
test: { test: {
-29
View File
@@ -1,29 +0,0 @@
<?php
namespace KTXT\ProviderJmapc\Integration;
use PHPUnit\Framework\TestCase;
class BaseTest extends TestCase
{
public function testBasicAssertion(): void
{
$this->assertTrue(true);
}
public function testArrayOperations(): void
{
$array = ['foo' => 'bar'];
$this->assertArrayHasKey('foo', $array);
$this->assertEquals('bar', $array['foo']);
}
public function testStringOperations(): void
{
$string = 'Hello, World!';
$this->assertStringContainsString('World', $string);
$this->assertEquals(13, strlen($string));
}
}
-10
View File
@@ -2,16 +2,6 @@
require dirname(__DIR__, 2).'/lib/vendor/autoload.php'; require dirname(__DIR__, 2).'/lib/vendor/autoload.php';
// When this module is checked out inside a full server (server/modules/<handle>,
// as it is in CI and in this monorepo checkout), also load the server's own
// core/shared autoloader so tests can reference framework (KTXC/KTXF) types.
// Standalone module checkouts without a server alongside them skip this.
define('SERVER_ROOT', dirname(__DIR__, 4));
$serverAutoload = SERVER_ROOT . '/vendor/autoload.php';
if (is_file($serverAutoload)) {
require $serverAutoload;
}
if (isset($_SERVER['APP_DEBUG']) && $_SERVER['APP_DEBUG']) { if (isset($_SERVER['APP_DEBUG']) && $_SERVER['APP_DEBUG']) {
umask(0000); umask(0000);
} }
@@ -21,9 +21,6 @@
<testsuite name="Unit Tests"> <testsuite name="Unit Tests">
<directory>unit</directory> <directory>unit</directory>
</testsuite> </testsuite>
<testsuite name="Integration Tests">
<directory>Integration</directory>
</testsuite>
</testsuites> </testsuites>
<source ignoreSuppressionOfDeprecations="true" <source ignoreSuppressionOfDeprecations="true"
@@ -32,7 +29,8 @@
restrictWarnings="true" restrictWarnings="true"
> >
<include> <include>
<directory>../../lib</directory> <directory>../../core/lib</directory>
<directory>../../shared/lib</directory>
</include> </include>
<deprecationTrigger> <deprecationTrigger>