Skip to content

Commit 18e07b7

Browse files
authored
[CI] Moved to Github Actions (#165)
1 parent d69b5a0 commit 18e07b7

File tree

5 files changed

+72
-34
lines changed

5 files changed

+72
-34
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Browser tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- '[0-9]+.[0-9]+'
8+
pull_request: ~
9+
10+
jobs:
11+
symfony-cache:
12+
name: "Symfony Cache integration tests"
13+
uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main
14+
with:
15+
project-edition: 'oss'
16+
project-version: '^3.3.x-dev'
17+
test-suite: '--mode=standard --profile=httpCache --suite=symfonycache'
18+
test-setup-phase-1: '--mode=standard --profile=httpCache --suite=setup-symfony-cache'
19+
test-setup-phase-2: '--mode=standard --profile=httpCache --suite=setup'
20+
secrets:
21+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
22+
varnish:
23+
name: "Varnish integration tests"
24+
uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main
25+
with:
26+
project-edition: 'oss'
27+
project-version: '^3.3.x-dev'
28+
setup: "doc/docker/base-dev.yml:doc/docker/varnish.yml:doc/docker/selenium.yml"
29+
test-suite: '--mode=standard --profile=httpCache --suite=varnish'
30+
test-setup-phase-1: '--mode=standard --profile=httpCache --suite=setup'
31+
secrets:
32+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
33+
varnish-token:
34+
name: "Varnish integration tests with invalidate token"
35+
uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main
36+
with:
37+
project-edition: 'oss'
38+
project-version: '^3.3.x-dev'
39+
setup: "doc/docker/base-dev.yml:doc/docker/varnish.yml:doc/docker/selenium.yml"
40+
test-suite: '--mode=standard --profile=httpCache --suite=varnish'
41+
test-setup-phase-1: '--mode=standard --profile=httpCache --suite=setup-token'
42+
test-setup-phase-2: '--mode=standard --profile=httpCache --suite=setup'
43+
secrets:
44+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.travis.yml

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,6 @@ matrix:
2626
- USER_RUNNING_TESTS=root
2727
- PHP_IMAGE=ezsystems/php:7.3-v1
2828
- WEB_HOST=web
29-
- name: "PHP 7.3 Symfony Cache integration tests"
30-
php: 7.3
31-
env:
32-
- TEST_CMD="vendor/bin/ezbehat --mode=standard --profile=httpCache --suite=symfonycache -c=behat_ibexa_oss.yaml"
33-
- SETUP_CMD="vendor/bin/ezbehat --mode=standard --profile=httpCache --suite=setup -c=behat_ibexa_oss.yaml"
34-
- WEB_HOST="http://web"
35-
- APP_DEBUG=1
36-
- ENABLE_SYMFONY_CACHE=1
37-
- name: "PHP 7.3 Varnish integration tests"
38-
php: 7.3
39-
env:
40-
- TEST_CMD="vendor/bin/ezbehat --mode=standard --profile=httpCache --suite=varnish -c=behat_ibexa_oss.yaml"
41-
- SETUP_CMD="vendor/bin/ezbehat --mode=standard --profile=httpCache --suite=setup -c=behat_ibexa_oss.yaml"
42-
- APP_DEBUG=1
43-
- WEB_HOST="http://varnish"
44-
- COMPOSE_FILE="doc/docker/base-dev.yml:doc/docker/varnish.yml:doc/docker/selenium.yml"
45-
- name: "PHP 7.3 Varnish integration tests with invalidate token"
46-
php: 7.3
47-
env:
48-
- TEST_CMD="vendor/bin/ezbehat --mode=standard --profile=httpCache --suite=varnish -c=behat_ibexa_oss.yaml"
49-
- SETUP_CMD="vendor/bin/ezbehat --mode=standard --profile=httpCache --suite=setup -c=behat_ibexa_oss.yaml"
50-
- HTTPCACHE_VARNISH_INVALIDATE_TOKEN=TESTTOKEN
51-
- APP_DEBUG=1
52-
- WEB_HOST="http://varnish"
53-
- COMPOSE_FILE="doc/docker/base-dev.yml:doc/docker/varnish.yml:doc/docker/selenium.yml"
5429

5530
# test only master + stable (+ Pull requests)
5631
branches:
@@ -63,15 +38,10 @@ before_script:
6338
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
6439
- travis_retry composer install --prefer-dist --no-interaction
6540
- ./vendor/bin/prepare_project_edition.sh oss ${PROJECT_VERSION} ${COMPOSE_FILE}
66-
# Execute Symfony command if injected into test matrix
67-
- if [ "${SYMFONY_CMD}" != "" ] ; then cd "$HOME/build/project"; docker-compose exec --user www-data app sh -c "APP_ENV=behat php bin/console ${SYMFONY_CMD}" ; fi
68-
- if [ "${ENABLE_SYMFONY_CACHE}" != "" ] ; then cd "$HOME/build/project"; docker-compose exec --user www-data app sh -c "patch -p1 -i vendor/ezsystems/ezplatform-http-cache/tests/SymfonyProxy/enable_symfony_proxy.patch" ; fi
69-
- if [ "$SETUP_CMD" != "" ] ; then cd "$HOME/build/project"; docker-compose exec --user "$USER_RUNNING_TESTS" app sh -c "$SETUP_CMD" ; fi
70-
- if [ "$SETUP_CMD" != "" ] ; then cd "$HOME/build/project"; docker-compose exec --user "$USER_RUNNING_TESTS" app sh -c "composer run post-install-cmd" ; fi
41+
- cd "$HOME/build/project"; docker-compose exec --user www-data app sh -c "APP_ENV=behat php bin/console ${SYMFONY_CMD}"
7142

7243
script:
73-
- if [ "$REST_TEST" != "" ] ; then cd "$HOME/build/project"; docker-compose exec app sh -c "cd vendor/ezsystems/ezplatform-rest && composer update --no-interaction && php ./vendor/bin/phpunit -c phpunit-integration-rest.xml" ; fi
74-
- if [ "$TEST_CMD" != "" ] ; then cd "$HOME/build/project"; docker-compose exec --user "$USER_RUNNING_TESTS" app sh -c "$TEST_CMD" ; fi
44+
- cd "$HOME/build/project"; docker-compose exec app sh -c "cd vendor/ezsystems/ezplatform-rest && composer update --no-interaction && php ./vendor/bin/phpunit -c phpunit-integration-rest.xml"
7545

7646
notifications:
7747
slack:

behat_suites.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,19 @@ httpCache:
3232
- Ibexa\Behat\Browser\Context\ContentPreviewContext
3333
setup:
3434
paths:
35-
- '%paths.base%/vendor/ezsystems/ezplatform-http-cache/features/setup'
35+
- '%paths.base%/vendor/ezsystems/ezplatform-http-cache/features/setup/setup.feature'
3636
contexts:
3737
- EzSystems\Behat\API\Context\TestContext
3838
- EzSystems\Behat\API\Context\ContentTypeContext
3939
- EzSystems\Behat\Core\Context\ConfigurationContext
4040
- EzSystems\Behat\API\Context\ContentContext
41+
setup-token:
42+
paths:
43+
- '%paths.base%/vendor/ezsystems/ezplatform-http-cache/features/setup/invalidateToken.feature'
44+
contexts:
45+
- EzSystems\Behat\Core\Context\ConfigurationContext
46+
setup-symfony-cache:
47+
paths:
48+
- '%paths.base%/vendor/ezsystems/ezplatform-http-cache/features/setup/symfonyCache.feature'
49+
contexts:
50+
- EzSystems\Behat\Core\Context\FileContext
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@setup
2+
Feature: Set system to use token for invalidation
3+
4+
Scenario: Set up the system to test caching of subrequests
5+
Given I append configuration to "parameters"
6+
"""
7+
varnish_invalidate_token: 'TESTTOKEN'
8+
"""

tests/SymfonyProxy/enable_symfony_proxy.patch renamed to features/setup/symfonyCache.feature

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
@setup
2+
Feature: Set up the system to use Symfony Proxy
3+
4+
Scenario: Set up the system to use Symfony Proxy
5+
Given I apply the patch
6+
"""
17
From fe9ff7bd801f978cfc50aae0411bb3eefdd3059a Mon Sep 17 00:00:00 2001
28
From: =?UTF-8?q?Marek=20Noco=C5=84?= <mnocon@users.noreply.github.com>
39
Date: Wed, 7 Jul 2021 15:29:57 +0200
@@ -29,4 +35,4 @@ index 9982c21..03ac40a 100644
2935
};
3036
--
3137
2.30.0
32-
38+
"""

0 commit comments

Comments
 (0)