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

[FEATURE] METS application profile validation #335

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ab2e922
Inital commit of application profile validation
markusweigelt Nov 29, 2024
770da06
Test logical structure validator and fix some bugs
markusweigelt Dec 6, 2024
d89531f
Improvements test
markusweigelt Dec 9, 2024
378a776
Add link validation and add unique check for ids
markusweigelt Dec 9, 2024
242ac8f
Fix tiny bug
markusweigelt Dec 9, 2024
cede8b7
Add license comment and improve validation
markusweigelt Dec 10, 2024
9f87f0c
Tiny refactoring to reduce duplicate code
markusweigelt Dec 10, 2024
ee3682f
Improvements regarding linking validation
markusweigelt Dec 10, 2024
83c0408
Tiny refactoring to reduce complexity
markusweigelt Dec 10, 2024
e4323fd
Merge branch 'slub:master' into application-profile-validation
markusweigelt Dec 10, 2024
edb4277
Refactore validation structure and test for standardized error messag…
markusweigelt Dec 13, 2024
bf64b50
Rename assert function to a more suitable name
markusweigelt Dec 13, 2024
9324cf3
Refactor PhysicalStructureValidator including test
markusweigelt Dec 16, 2024
da52ae9
Update struct link validation and tests
markusweigelt Dec 16, 2024
da925b1
Improve validation architecture
markusweigelt Dec 19, 2024
0370272
Add validation for digital representation
markusweigelt Dec 19, 2024
d667674
Adding descriptive metadata validation and improve other validations
markusweigelt Dec 20, 2024
cedcf8e
Add tests for deskriptive metadata validator
markusweigelt Dec 20, 2024
6420bef
Add administrativ metadata validator test
markusweigelt Dec 20, 2024
d564f45
Improve tests for administrative metadata validator
markusweigelt Dec 20, 2024
3e1d41b
Adding digital representation validator test
markusweigelt Dec 20, 2024
fc2536d
Add validator
markusweigelt Dec 23, 2024
39dad35
Refactoring validation
markusweigelt Jan 6, 2025
7a50d5e
Add test for DvMetadataValidator
markusweigelt Jan 7, 2025
355faf8
Improvements
markusweigelt Jan 7, 2025
559cbc6
Add alias for validation helper and add configuration to typoscript
markusweigelt Jan 7, 2025
d201462
merge master and resolve merge conflicts
markusweigelt Jan 8, 2025
9a6965d
Reafactoring and renamings
markusweigelt Jan 8, 2025
43a0d24
Refactoring and documentation
markusweigelt Jan 9, 2025
008e0c1
Add missing properties!
markusweigelt Jan 9, 2025
8793fe8
Add phpstan ignores
markusweigelt Jan 9, 2025
fe34540
Make runTests.sh executable
markusweigelt Jan 9, 2025
492487d
Remove code coverage cause it needs a secret
markusweigelt Jan 9, 2025
3648c40
Downgrade test framework
markusweigelt Jan 9, 2025
e1daa4d
add solarium dev dependency
markusweigelt Jan 9, 2025
45230a9
Update testing pipeline
markusweigelt Jan 9, 2025
4f8c4ef
Fix codacy errors
markusweigelt Jan 9, 2025
25ee6c1
Changes codacy
markusweigelt Jan 9, 2025
699a493
Fixes of codacy issues
markusweigelt Jan 9, 2025
70cb8d9
Codacy fixes
markusweigelt Jan 9, 2025
c567307
Improvements regarding codacy issues
markusweigelt Jan 10, 2025
e47f340
Improve type in documentation
markusweigelt Jan 10, 2025
a371c26
Renaming methods for codacy
markusweigelt Jan 10, 2025
9063ba5
Set unique error codes
markusweigelt Jan 10, 2025
1da107a
Remove dot
markusweigelt Jan 10, 2025
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
21 changes: 21 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Unit Testing

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
test:
name: TYPO3
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: Build/Test/runTests.sh -s composerInstall -t 11.5

- name: Run unit tests
run: Build/Test/runTests.sh -s unit
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.cache
.idea/
.vscode/
.DS_Store
node_modules
*.css.map
Build/Test/.env
Documentation-GENERATED-temp/
public/
vendor/
Expand Down
31 changes: 31 additions & 0 deletions Build/Test/UnitTests.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!-- adopted from https://github.com/TYPO3/styleguide/blob/2a51dc3db6c2916c07595dd96e8b817a73216002/Build/UnitTests.xml -->
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
backupGlobals="true"
bootstrap="../../vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php"
cacheResult="false"
colors="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
convertNoticesToExceptions="true"
forceCoversAnnotation="false"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="false"
beStrictAboutTestsThatDoNotTestAnything="false"
failOnWarning="true"
>
<testsuites>
<testsuite name="Unit tests">
<directory>../../Tests/Unit</directory>
</testsuite>
</testsuites>
<php>
<ini name="display_errors" value="1" />
<env name="TYPO3_CONTEXT" value="Testing" />
</php>
</phpunit>
147 changes: 147 additions & 0 deletions Build/Test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# Adopted/reduced from https://github.com/TYPO3/typo3/blob/608f238a8b7696a49a47e1e73ce8e2845455f0f5/Build/testing-docker/local/docker-compose.yml

services:
mysql:
image: docker.io/mysql:${MYSQL_VERSION}
environment:
MYSQL_ROOT_PASSWORD: funcp
tmpfs:
- /var/lib/mysql/:rw,noexec,nosuid

mariadb:
image: docker.io/mariadb:${MARIADB_VERSION}
environment:
MYSQL_ROOT_PASSWORD: funcp
tmpfs:
- /var/lib/mysql/:rw,noexec,nosuid

web:
image: docker.io/typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
user: "${HOST_UID}:${HOST_GID}"
stop_grace_period: 1s
volumes:
- ${EXTENSIONS_ROOT}:/var/www/extensions/
- ${DFGVIEWER_ROOT}:${DFGVIEWER_ROOT}
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "${SERVER_PORT}:${SERVER_PORT}"
# NOTE: For testing PageViewProxy, we need another web server web:8001 that
# can be requested from TYPO3 running on web:${SERVER_PORT}.
# Setting PHP_CLI_SERVER_WORKERS wouldn't seem to work consistently.
command: >
/bin/sh -c "
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
php -S web:${SERVER_PORT} -t ${DFGVIEWER_ROOT} ${DFGVIEWER_ROOT}/Tests/routeFunctionalInstance.php &
php -S web:8001 -t ${DFGVIEWER_ROOT}
else
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal\" \
php -S web:${SERVER_PORT} -t ${DFGVIEWER_ROOT} ${DFGVIEWER_ROOT}/Tests/routeFunctionalInstance.php &
php -S web:8001 -t ${DFGVIEWER_ROOT}
fi
"
composer_install:
image: docker.io/typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
user: "${HOST_UID}:${HOST_GID}"
volumes:
- ${EXTENSIONS_ROOT}:/var/www/extensions/
- ${DFGVIEWER_ROOT}:${DFGVIEWER_ROOT}
working_dir: ${DFGVIEWER_ROOT}
environment:
COMPOSER_CACHE_DIR: ".cache/composer"
command: >
/bin/sh -c "
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
if [ -z ${TYPO3_VERSION} ]; then
composer install --no-progress --no-interaction;
else
composer update --with=typo3/cms-core:^${TYPO3_VERSION} --no-progress --no-interaction;
fi
"
functional:
image: docker.io/typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
links:
- ${DBMS}
- web
user: "${HOST_UID}:${HOST_GID}"
volumes:
- ${EXTENSIONS_ROOT}:/var/www/extensions/
- ${DFGVIEWER_ROOT}:${DFGVIEWER_ROOT}
environment:
typo3DatabaseDriver: "${DATABASE_DRIVER}"
typo3DatabaseName: func_test
typo3DatabaseUsername: root
typo3DatabasePassword: funcp
typo3DatabaseHost: ${DBMS}
working_dir: ${DFGVIEWER_ROOT}
extra_hosts:
- "host.docker.internal:host-gateway"
command: >
/bin/sh -c "
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
echo Waiting for database start...;
while ! nc -z ${DBMS} 3306; do
sleep 1;
done;
echo Database is up;
echo Waiting for Solr start...;
while ! nc -z solr 8983; do
sleep 1;
done;
echo Solr is up;
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
php -v | grep '^PHP'
if [ ${PHPUNIT_WATCH} -eq 0 ]; then
PHPUNIT_BIN=\"vendor/bin/phpunit\"
else
PHPUNIT_BIN=\"vendor/bin/phpunit-watcher watch\"
fi
COMMAND=\"$${PHPUNIT_BIN} -c Build/Test/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE}\"
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" $${COMMAND};
else
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal\" \
$${COMMAND};
fi
"
unit:
image: docker.io/typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
user: "${HOST_UID}:${HOST_GID}"
volumes:
- ${EXTENSIONS_ROOT}:/var/www/extensions/
- ${DFGVIEWER_ROOT}:${DFGVIEWER_ROOT}
working_dir: ${DFGVIEWER_ROOT}
extra_hosts:
- "host.docker.internal:host-gateway"
command: >
/bin/sh -c "
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
php -v | grep '^PHP'
if [ ${PHPUNIT_WATCH} -eq 0 ]; then
PHPUNIT_BIN=\"vendor/bin/phpunit\"
else
PHPUNIT_BIN=\"vendor/bin/phpunit-watcher watch\"
fi
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
$${PHPUNIT_BIN} -c Build/Test/UnitTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE};
else
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal\" \
$${PHPUNIT_BIN} -c Build/Test/UnitTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE};
fi
"
Loading
Loading