Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test setup for content bundle integration #693

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
bbdedb7
Move files
alexander-schranz Aug 8, 2024
81bd67c
Add article test template setup
alexander-schranz Aug 8, 2024
3f37979
Update CI script
alexander-schranz Aug 8, 2024
e396d34
Fix Kernel Class
alexander-schranz Aug 8, 2024
46f4299
Update test setup
alexander-schranz Aug 8, 2024
d08d6c3
Fix ghost handling
alexander-schranz Aug 8, 2024
abcab8b
Fix bootstrap directory
alexander-schranz Aug 8, 2024
566f620
Update crowdin path
alexander-schranz Aug 8, 2024
8e9dbc5
Increase required symfony version
alexander-schranz Aug 8, 2024
e80a32b
Fix some more phpstan issues
alexander-schranz Aug 8, 2024
76dd1a6
Drop support for 8.0
alexander-schranz Aug 8, 2024
ce8d8fc
Readd circle ci to keep CI green
alexander-schranz Aug 8, 2024
6c28bab
Drop support for Sulu 2.5
alexander-schranz Aug 8, 2024
b82f845
Update gitignore
alexander-schranz Aug 8, 2024
4e93810
Test Circle Ci
alexander-schranz Aug 8, 2024
59343ad
Update PHPUnit
alexander-schranz Aug 8, 2024
b755a9f
Update readme file
alexander-schranz Aug 8, 2024
51f49f1
Fix code style
alexander-schranz Aug 8, 2024
2924f53
Move files
alexander-schranz Aug 8, 2024
d036f81
Create missing trait
alexander-schranz Aug 8, 2024
bd99f01
Update PHPUnit config
alexander-schranz Aug 8, 2024
b3dd69c
Remove env variables
alexander-schranz Aug 8, 2024
e84db16
Update content bundle
alexander-schranz Aug 8, 2024
769dcf2
Update conflict
alexander-schranz Aug 8, 2024
e219686
Remove unused headless bundle integration
alexander-schranz Aug 8, 2024
9d9eea2
Remove unneeded dependencies
alexander-schranz Aug 8, 2024
102cbc3
Update phpunit
alexander-schranz Aug 8, 2024
16dd780
Remove unneeded phcpr shell
alexander-schranz Aug 8, 2024
b0898e0
Remove monolog bundle
alexander-schranz Aug 8, 2024
2a01ef0
Make messenger and content bundle hard depenedency
alexander-schranz Aug 8, 2024
05790d6
Add some more fixes
alexander-schranz Aug 8, 2024
a4e75ce
Fix messenger version requirement
alexander-schranz Aug 8, 2024
1996fd3
Fix admin class
alexander-schranz Aug 8, 2024
3de83a3
Fix phpstan dir
alexander-schranz Aug 8, 2024
701423d
Fix phpstan issues in test directory
alexander-schranz Aug 8, 2024
03f5fd9
Fix some phpstan issues
alexander-schranz Aug 8, 2024
a099d79
Fix coduo php matcher lowest
alexander-schranz Aug 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2

jobs:
build:
docker:
- image: circleci/php:7.3-node-browsers
steps:
- checkout
- run:
name: Install OS dependencies (mysql, gd)
command: |
sudo apt-get install -y libpng-dev
sudo docker-php-ext-install pdo_mysql gd
parallel: true
- run: echo "Circle CI is not longer used on 3.0 can be removed when support for 2.x is removed"
2 changes: 1 addition & 1 deletion .github/workflows/crowdin-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Copy translation file
run: cp Resources/translations/admin.en.json admin.en.json
run: cp translations/admin.en.json admin.en.json
- name: Download Crowdin CLI
run: curl "https://downloads.crowdin.com/cli/v3/crowdin-cli.zip" --output crowdin-cli.zip && unzip crowdin-cli.zip
- name: Upload translations to crowdin
Expand Down
76 changes: 5 additions & 71 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,106 +9,48 @@ on:

jobs:
test:
name: "PHP ${{ matrix.php-version }} (elasticsearch ${{ matrix.elasticsearch-version }}, ${{ matrix.phpcr-transport }}, ${{ matrix.dependency-versions }})"
name: 'PHP ${{ matrix.php-version }} (${{ matrix.dependency-versions }}, Coverage ${{ matrix.coverage }})'
runs-on: ubuntu-latest

env:
DATABASE_URL: mysql://root:[email protected]:3306/sulu_test?serverVersion=5.7
PHPCR_TRANSPORT: ${{ matrix.phpcr-transport }}
APP_ENV: test
DATABASE_URL: mysql://root:[email protected]:3306/su_content_test?serverVersion=8.0.29&charset=utf8mb4&collation=utf8mb4_unicode_ci
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

strategy:
fail-fast: false
matrix:
include:
- php-version: '8.0'
elasticsearch-version: '7.11.1'
elasticsearch-package-constraint: '~7.11.0'
phpcr-transport: jackrabbit
- php-version: '8.2'
dependency-versions: 'lowest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
ELASTICSEARCH_HOST: '127.0.0.1:9200'

- php-version: '8.1'
elasticsearch-version: '7.11.1'
elasticsearch-package-constraint: '~7.11.0'
phpcr-transport: doctrinedbal
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
ELASTICSEARCH_HOST: '127.0.0.1:9200'

- php-version: '8.2'
elasticsearch-version: '7.11.1'
elasticsearch-package-constraint: '~7.11.0'
phpcr-transport: jackrabbit
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
ELASTICSEARCH_HOST: '127.0.0.1:9200'

- php-version: '8.3'
elasticsearch-version: '7.17.2'
elasticsearch-package-constraint: '~7.17.0'
phpcr-transport: doctrinedbal
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
phpstan: false
env:
SYMFONY_DEPRECATIONS_HELPER: weak
ELASTICSEARCH_HOST: '127.0.0.1:9200'

- php-version: '8.4'
composer-options: '--ignore-platform-reqs'
elasticsearch-version: '8.14.3'
elasticsearch-package-constraint: '~7.17.0'
phpcr-transport: doctrinedbal
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
phpstan: false
env:
SYMFONY_DEPRECATIONS_HELPER: weak
ELASTICSEARCH_HOST: '127.0.0.1:9200'

services:
mysql:
image: mysql:5.7
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5

jackrabbit:
image: sulu/jackrabbit:2.20-tomcat-filesystem
env:
DATABASE_HOST: mysql
DATABASE_PORT: 3306
DATABASE_NAME: sulu_test_jackrabbit
DATABASE_USER: root
DATABASE_PASS: root
LOG_LEVEL: WARN
ports:
- 8080:8080

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${{ matrix.elasticsearch-version }}
ports:
- 9200:9200
env:
discovery.type: 'single-node'
xpack.security.enabled: 'false'
options: --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=5

steps:
- name: Checkout project
uses: actions/checkout@v4
Expand All @@ -126,9 +68,6 @@ jobs:
# testing lowest versions.
run: composer remove "*php-cs-fixer*" "*phpstan*" "*rector*" --dev --no-update

- name: Require elasticsearch dependency
run: composer require --dev elasticsearch/elasticsearch:"${{ matrix.elasticsearch-package-constraint }}" --no-interaction --no-update

- name: Install composer dependencies
uses: ramsey/composer-install@v2
with:
Expand All @@ -137,11 +76,9 @@ jobs:

- name: Bootstrap test environment
run: composer bootstrap-test-environment
env: ${{ matrix.env }}

- name: Execute test cases
run: time composer test
env: ${{ matrix.env }}

lint:
name: "PHP Lint"
Expand All @@ -162,9 +99,6 @@ jobs:
tools: 'composer:v2'
coverage: none

- name: Require elasticsearch dependency
run: composer require --dev elasticsearch/elasticsearch:"~7.11.0" --no-interaction --no-update

- name: Install composer dependencies
uses: ramsey/composer-install@v2
with:
Expand Down
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,8 @@ php-cs-fixer
.DS_Store

# Frontend Caches
bower_components/
.tmp/
.sass-cache/
node_modules/
npm-debug.log

# tests
.env.*.local
/Tests/Application/config/parameters.yml
/Tests/Application/var
/Tests/Functional/Import/export.test.xliff
/tests/Application/var
9 changes: 7 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
EOF;

$finder = PhpCsFixer\Finder::create()
->exclude(['Tests/Application/var/cache'])
->in(__DIR__);
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->exclude([
'Application/var/',
]);

$config = new PhpCsFixer\Config();
$config->setRiskyAllowed(true)
Expand Down
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ Execute the following [composer](https://getcomposer.org/) commands to add the b
project:

```bash
composer require "elasticsearch/elasticsearch:7.9.*" # should match version of your elasticsearch installation
composer require sulu/article-bundle
```

Afterwards, visit the [bundle documentation](Resources/doc) to
Afterwards, visit the [bundle documentation](docs) to
find out **how to set up and configure the SuluArticleBundle** to your specific needs.


Expand All @@ -67,18 +66,6 @@ In contrast to Sulu pages, articles are **managed in a flat list** instead of a
the Sulu page tree, the article bundle is **optimized for managing a big number of articles**.


### Elasticsearch dependency

The SuluArticleBundle was originally developed to be used in the publishing industry. To satisfy the initial
requirements regarding performance and scalability, a **view layer stored in an Elasticsearch index** was utilized.
Because of this, there is **no way to use the bundle without Elasticsearch** at the moment. It is planned to
remove this hard dependency in the next major version.

If you cannot or do not want to make Elasticsearch a dependency of your project, you can **use Sulu pages for
certain use cases** instead of the SuluArticleBundle. However, be aware that the article list provides a better
performance and is more comfortable to use with a large number of entities.


## ❤️  Support and Contributions

The Sulu content management system is a **community-driven open source project** backed by various partner companies.
Expand Down
32 changes: 0 additions & 32 deletions SuluArticleBundle.php

This file was deleted.

2 changes: 0 additions & 2 deletions Tests/Application/.env

This file was deleted.

42 changes: 0 additions & 42 deletions Tests/Application/bin/console.php

This file was deleted.

19 changes: 0 additions & 19 deletions Tests/Application/config/templates/articles/article.xml

This file was deleted.

Loading
Loading