Skip to content

Commit

Permalink
Fix travis pa11y (pumukit#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnieto authored and Alfro committed Feb 16, 2020
1 parent ed247d8 commit a79f2dd
Show file tree
Hide file tree
Showing 11 changed files with 154 additions and 32 deletions.
85 changes: 85 additions & 0 deletions .env.travis
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
PUMUKIT_BASE_VERSION=migration_sf4
RUN_INIT_COMMANDS=false

###> doctrine/mongodb-odm-bundle ###
MONGODB_URL=mongodb://db:27017
MONGODB_DB=pumukit
WAIT_HOSTS=db:27017
###< doctrine/mongodb-odm-bundle ###

###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use="gmail://username:password@localhost"
# For a generic SMTP server, use="smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=null://localhost
###< symfony/swiftmailer-bundle ###

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=!ChangeMe!
TRUSTED_PROXIES=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
#https://github.com/symfony/symfony/issues/29609
TRUSTED_HOSTS=localhost|api|h2-proxy
###< symfony/framework-bundle ###

###> php-fpm ###
PHP_UPLOAD_TMP_DIR=/tmp
PHP_MEMORY_LIMIT=512M
PHP_UPLOAD_MAX_FILESIZE=10G
PHP_DEFAULT_LOCALE=es
PHP_DEFAULT_CHARSET=UTF-8
###> php-fpm ###

###> pumukit ###
PUMUKIT_USER=admin
PUMUKIT_PASS=admin
[email protected]
# Recomended values true or false other values won't be recognized
AUTOCREATE_PUMUKIT_USER=true
PUMUKIT_PRIMARY_COLOR=#c05800
PUMUKIT_FONT_COLOR=#ffffff
PUMUKIT_MONGODB_SERVER='mongodb://localhost:27017'
PUMUKIT_MONGODB_DATABASE=pumukit
PUMUKIT_MAILER_TRANSPORT=smtp
PUMUKIT_MAILER_HOST=127.0.0.1
PUMUKIT_MAILER_USER=null
PUMUKIT_MAILER_PASSWORD=null
PUMUKIT_LOCALE=en
PUMUKIT_SECRET=ThisTokenIsNotSoSecretChangeIt
PUMUKIT_TITLE=UPumukitTV
PUMUKIT_DESCRIPTION='Pumukit University TV Website'
PUMUKIT_KEYWORDS='webtv, Tv, Pumukit University, pumukit'
[email protected]
PUMUKIT_LOGO=/bundles/pumukitwebtv/images/webtv/pumukit_logo.png
PUMUKIT_LOCALES=["en", "es", "gl", "eu", "ca", "fr", "zh-TW", "zh-CN"]
PUMUKIT_HOST='localhost'
PUMUKIT_SCHEME='https'

PUMUKIT_PUBLIC_DIR='%kernel.project_dir%/public/'
PUMUKIT_STORAGE_DIR='%kernel.project_dir%/public/storage'
PUMUKIT_INBOX='%kernel.project_dir%/public/storage/inbox'
PUMUKIT_TMP='%kernel.project_dir%/public/storage/tmp'
PUMUKIT_DOWNLOADS='%kernel.project_dir%/public/storage/downloads'
PUMUKIT_MASTERS='%kernel.project_dir%/public/storage/masters'

PUMUKIT_UPLOADS_URL=/uploads
PUMUKIT_UPLOADS_DIR='%kernel.project_dir%/public/uploads'
PUMUKIT_UPLOADS_MATERIAL_DIR='%kernel.project_dir%/public/uploads/material'
PUMUKIT_UPLOADS_PIC_DIR='%kernel.project_dir%/public/uploads/pic'
PUMUKIT_DELETE_ON_DISK=true
###< pumukit ###

15 changes: 7 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ script:
- docker-compose -f docker-compose.test.yml exec php composer php-cs-fixer
- docker-compose -f docker-compose.test.yml exec php composer phpstan
- docker-compose -f docker-compose.test.yml exec php composer tests
- docker-compose -f docker-compose.test.yml exec php bin/console doctrine:mongodb:schema:create
- docker-compose -f docker-compose.test.yml exec php bin/console pumukit:init:repo all --force
- docker-compose -f docker-compose.test.yml run pa11y https://h2-proxy
- docker-compose -f docker-compose.test.yml run pa11y https://h2-proxy/series/channel/1.html
- docker-compose -f docker-compose.test.yml run pa11y https://h2-proxy/latestuploads
- docker-compose -f docker-compose.test.yml run pa11y https://h2-proxy/searchmultimediaobjects
- docker-compose -f docker-compose.test.yml run pa11y https://h2-proxy/searchseries
- docker-compose -f docker-compose.test.yml run pa11y https://h2-proxy/mediateca
- docker-compose -f docker-compose.test.yml run pa11y https://h2-proxy/categories
- docker-compose -f docker-compose.test.yml run --rm pa11y https://h2-proxy
- docker-compose -f docker-compose.test.yml run --rm pa11y https://h2-proxy/series/channel/1.html
- docker-compose -f docker-compose.test.yml run --rm pa11y https://h2-proxy/latestuploads
- docker-compose -f docker-compose.test.yml run --rm pa11y https://h2-proxy/searchmultimediaobjects
- docker-compose -f docker-compose.test.yml run --rm pa11y https://h2-proxy/searchseries
- docker-compose -f docker-compose.test.yml run --rm pa11y https://h2-proxy/mediateca
- docker-compose -f docker-compose.test.yml run --rm pa11y https://h2-proxy/categories
9 changes: 0 additions & 9 deletions bin/travis_checks/check_var_dumps
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
# Finds dumps (either classical var_dump() or symfony dump() in the most straight-forward cases
if egrep --color=auto -nr '(^| +|;| +|\{%|\{{)(var_)?dump\(' src/Pumukit/ --include \*.php --include \*.twig ; then
echo "";
echo "ERROR: Found one or several calls to var_dump()/dump() on the php code.";
echo "";
errorsOnChecks=1;
fi


# Finds console.log() calls for javascript code
# TODO: This grep is excluding the 'public' directories on purpose, although most of the js code is there.
# The issue is that there are external libraries with console.logs on their code as of now, and since we don't
Expand Down
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
"description": "Media Portal",
"require": {
"php": ">=7.2.0",
"ext-curl": "*",
"ext-fileinfo": "*",
"ext-gd": "*",
"ext-json": "*",
"ext-mongodb": "*",
"ext-sysvsem": "*",
"ext-curl": "*",
"doctrine/mongodb-odm": "~2",
"doctrine/mongodb-odm-bundle": "~4",
"friendsofsymfony/user-bundle": "dev-master",
"gedmo/doctrine-extensions": "dev-master",
"incenteev/composer-parameter-handler": "^2.0",
"jakub-onderka/php-var-dump-check": "~0.3",
"jms/serializer-bundle": "2.4.*",
"knplabs/knp-menu-bundle": "~2.0",
"sensio/framework-extra-bundle": "^5.5",
Expand Down Expand Up @@ -60,7 +61,8 @@
"bin/console lint:twig src",
"bin/console lint:twig templates",
"bin/console lint:xlif translations/",
"./bin/travis_checks/check_var_dumps"
"vendor/bin/var-dump-check --symfony src",
"bin/travis_checks/check_var_dumps"
],
"php-cs-fixer": "vendor/bin/php-cs-fixer fix src --dry-run -v",
"phpstan": [
Expand Down Expand Up @@ -111,11 +113,11 @@
"repositories": {
"teltekfosuserbundle": {
"type": "vcs",
"url": "https://github.com/teltek/FOSUserBundle.git"
"url": "https://github.com/teltek/FOSUserBundle"
},
"teltekdoctrineextensions": {
"type": "vcs",
"url": "https://github.com/teltek/DoctrineExtensions.git"
"url": "https://github.com/teltek/DoctrineExtensions"
}
}
}
52 changes: 49 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions doc/docker/pumukit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ RUN apk add --no-cache \
py-argparse \
py2-pip \
py-gflags \
grep \
;

RUN pip install google-api-python-client==1.2
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
php:
image: teltek/pumukit:$PUMUKIT_BASE_VERSION
env_file:
- .env
- .env.travis
build:
context: ./
args:
Expand All @@ -18,7 +18,7 @@ services:
h2-proxy:
image: teltek/nginx:$PUMUKIT_BASE_VERSION
env_file:
- .env
- .env.travis
build:
context: ./doc/docker/nginx
cache_from:
Expand Down
1 change: 0 additions & 1 deletion src/Pumukit/NewAdminBundle/Controller/TrackController.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ public function uploadAction(Request $request, MultimediaObject $multimediaObjec
throw new \Exception('PHP ERROR: File exceeds post_max_size ('.ini_get('post_max_size').')');
}
if (($request->files->has('resource')) && ('file' === $request->get('file_type'))) {
dump('llega');
$multimediaObject = $this->jobService->createTrackFromLocalHardDrive($multimediaObject, $request->files->get('resource'), $profile, $priority, $language, $description);
} elseif (($request->get('file')) && ('inbox' === $request->get('file_type'))) {
$multimediaObject = $this->jobService->createTrackFromInboxOnServer($multimediaObject, $request->get('file'), $profile, $priority, $language, $description);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@
var list_mmo = list_mmo.split(",");
for (var value of list_mmo) {
if(value != '') {
console.log(list_mmo);
console.log(cod);
updateMultimediaObjectByTag(cod, value);
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/Pumukit/SchemaBundle/Utils/Search/SearchUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ public static function scapeTildes($element)
*/
private static function completeRegexExpression($regexString)
{
$regexString = implode($regexString, self::$glue);

return $regexString;
return implode($regexString, self::$glue);
}
}
3 changes: 3 additions & 0 deletions symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
"incenteev/composer-parameter-handler": {
"version": "v2.1.3"
},
"jakub-onderka/php-var-dump-check": {
"version": "v0.3"
},
"jms/metadata": {
"version": "1.7.0"
},
Expand Down

0 comments on commit a79f2dd

Please sign in to comment.