Skip to content

Commit

Permalink
Merge branch '1.2'
Browse files Browse the repository at this point in the history
* 1.2:
  Fix docs build
  Fix typo
  Rename typo in filename
  Allow to use Pagerfanta in both ^1.0 and ^2.0
  Fixing Typo in Documentation
  [Core][Fixture] Fix for ignored geographical zone scope
  Do not run tests if not needed
  • Loading branch information
pamil committed Sep 18, 2018
2 parents 521f087 + ad8bedd commit cc41960
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 26 deletions.
File renamed without changes.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -11,6 +11,8 @@

/bin/symfony_requirements

/docs/.doctrees

/composer.lock
/vendor
/node_modules
Expand Down
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -37,8 +37,10 @@ matrix:
-
php: 7.2
env:
- SYLIUS_SUITE="packages"
- SYLIUS_SUITE="docs packages"
- SYMFONY_VERSION="4.1.*"
services:
- docker
addons:
apt:
packages:
Expand Down
10 changes: 10 additions & 0 deletions docs/Dockerfile
@@ -0,0 +1,10 @@
FROM python:2

WORKDIR /usr/src/app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD [ "bash", "build.sh" ]
18 changes: 18 additions & 0 deletions docs/build.sh
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -x

code=0

sphinx-build -nWT . build || code=$?
# Flags used here
# -n Run in nit-picky mode. Currently, this generates warnings for all missing references.
# -W Turn warnings into errors. This means that the build stops at the first warning and sphinx-build exits with exit status 1.
# -T Displays the full stack trace if an unhandled exception occurs.

if [[ ${code} != 0 ]]; then
(>&2 echo "Build failed, rerunning to show all the warnings and errors")
sphinx-build -nT . build
fi

exit ${code}
2 changes: 1 addition & 1 deletion docs/cookbook/frontend/admin-js-and-css.rst
Expand Up @@ -68,7 +68,7 @@ As an example we will change the sidebar menu background color, what is clearly
.. code-block:: twig
{# src/AppBundle/Resources/views/Admin/_stylesheets.html.twig #}
{% include 'SyliusUiBundle::stylesheets.html.twig' with {'path': 'assets/admin/css/custom.css'} %}
{% include 'SyliusUiBundle::_stylesheets.html.twig' with {'path': 'assets/admin/css/custom.css'} %}
**3. Use the Sonata block event to insert your stylesheets:**

Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
@@ -1,3 +1,3 @@
sphinx>=1.6,<2.0,!=1.6.4
pyOpenSSL==16.2.0
pyOpenSSL
requests[security]
2 changes: 1 addition & 1 deletion etc/travis/suites/application/is_suitable.sh
Expand Up @@ -6,7 +6,7 @@ if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
exit 0 # Always execute full suite on branch builds
fi

if [ $(git diff --name-only HEAD origin/master | grep -c -v -e ^docs -e ^CHANGELOG.md -e ^CONTRIBUTING.md -e ^LICENSE -e ^PULL_REQUEST_TEMPLATE.md -e ^README.md -e ^UPGRADE.md) -eq 0 ]; then
if [ $(git diff --name-only HEAD origin/$TRAVIS_BRANCH | grep -c -v -e ^docs -e ^.github -e ^CHANGELOG -e ^LICENSE -e ^README -e ^UPGRADE) -eq 0 ]; then
print_header "Skipped suite" "Application"
print_warning "No other changes than those in docs/* were found"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion etc/travis/suites/common/before_install.sh
Expand Up @@ -3,7 +3,7 @@
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"

print_header "Customizing the environment" "Sylius"
run_command "git fetch origin master:refs/remotes/origin/master" || exit $? # Make origin/master available for is_suitable steps
run_command "git fetch origin $TRAVIS_BRANCH:refs/remotes/origin/$TRAVIS_BRANCH" || exit $? # Make origin/master available for is_suitable steps
run_command "phpenv config-rm xdebug.ini" # Disable XDebug
run_command "echo \"memory_limit=4096M\" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini" || exit $? # Increase memory limit to 4GB
run_command "mkdir -p \"${SYLIUS_CACHE_DIR}\"" || exit $? # Create Sylius cache directory
4 changes: 2 additions & 2 deletions etc/travis/suites/docs/install.sh
Expand Up @@ -3,5 +3,5 @@ set -e

source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"

print_header "Installing" "Sphinx"
run_command "pip install -q --user -r docs/requirements.txt"
print_header "Installing" "Python & Sphinx"
run_command "docker build -t sylius-docs docs"
2 changes: 1 addition & 1 deletion etc/travis/suites/docs/is_suitable.sh
Expand Up @@ -6,7 +6,7 @@ if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
exit 0 # Always execute full suite on branch builds
fi

if [ $(git diff --name-only HEAD origin/master | grep -c -e ^docs) -eq 0 ]; then
if [ $(git diff --name-only HEAD origin/$TRAVIS_BRANCH | grep -c -e ^docs) -eq 0 ]; then
print_header "Skipped suite" "Docs"
print_warning "No changes detected in docs/*"
exit 1
Expand Down
15 changes: 1 addition & 14 deletions etc/travis/suites/docs/script.sh
Expand Up @@ -2,18 +2,5 @@

source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"

code=0

print_header "Building" "Documentation"
run_command "sphinx-build -nWT docs docs/build" || code=$?
# Flags used here
# -n Run in nit-picky mode. Currently, this generates warnings for all missing references.
# -W Turn warnings into errors. This means that the build stops at the first warning and sphinx-build exits with exit status 1.
# -T Displays the full stack trace if an unhandled exception occurs.

if [[ ${code} != 0 ]]; then
print_warning "Build failed, rerunning to show all the warnings and errors"
run_command "sphinx-build -nT docs docs/build"
fi

exit ${code}
run_command "docker run -it --rm sylius-docs"
2 changes: 1 addition & 1 deletion etc/travis/suites/packages/is_suitable.sh
Expand Up @@ -6,7 +6,7 @@ if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
exit 0 # Always execute full suite on branch builds
fi

if [ $(git diff --name-only HEAD origin/master | grep -c -e ^src/Sylius/Bundle -e ^src/Sylius/Component) -eq 0 ]; then
if [ $(git diff --name-only HEAD origin/$TRAVIS_BRANCH | grep -c -e ^src/Sylius/Bundle -e ^src/Sylius/Component) -eq 0 ]; then
print_header "Skipped suite" "Packages"
print_warning "No changes detected in src/Sylius/Bundle/* or src/Sylius/Component/*"
exit 1
Expand Down
Expand Up @@ -2,7 +2,7 @@
Feature: Verifying inventory quantity on cart summary
In order to not be able to add more items than available
As a Customer
I want to be notified that requested item quantity cannot be handle
I want to be notified that requested item quantity cannot be handled

Background:
Given the store operates on a single channel in "United States"
Expand Down
4 changes: 4 additions & 0 deletions src/Sylius/Bundle/CoreBundle/Fixture/GeographicalFixture.php
Expand Up @@ -208,6 +208,10 @@ private function loadZones(array $zones, \Closure $zoneValidator): void
$zone->setName($zoneName);
$zone->setType($zoneType);

if (isset($zoneOptions['scope'])) {
$zone->setScope($zoneOptions['scope']);
}

$this->zoneManager->persist($zone);
} catch (\InvalidArgumentException $exception) {
throw new \InvalidArgumentException(sprintf(
Expand Down
Expand Up @@ -143,6 +143,7 @@ function it_creates_and_persist_a_country_and_a_zone_with_scope_containing_it(
$zone->setCode('POLAND')->shouldBeCalled();
$zone->setName('Poland')->shouldBeCalled();
$zone->setType(ZoneInterface::TYPE_COUNTRY)->shouldBeCalled();
$zone->setScope('tax')->shouldBeCalled();

$countryManager->persist($country)->shouldBeCalled();
$zoneManager->persist($zone)->shouldBeCalled();
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/GridBundle/composer.json
Expand Up @@ -36,7 +36,7 @@
"matthiasnoback/symfony-config-test": "^3.0",
"matthiasnoback/symfony-dependency-injection-test": "^2.0",
"ocramius/proxy-manager": "^2.1",
"pagerfanta/pagerfanta": "^1.0",
"pagerfanta/pagerfanta": "^1.0|^2.0",
"phpspec/phpspec": "^4.0",
"phpunit/phpunit": "^6.5",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Component/Resource/composer.json
Expand Up @@ -27,7 +27,7 @@
"symfony/event-dispatcher": "^3.4|^4.1.1",
"symfony/property-access": "^3.4|^4.1.1",
"winzou/state-machine": "^0.3",
"pagerfanta/pagerfanta": "^1.0"
"pagerfanta/pagerfanta": "^1.0|^2.0"
},
"require-dev": {
"phpspec/phpspec": "^4.0",
Expand Down

0 comments on commit cc41960

Please sign in to comment.