-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Invertus/feature/api-client-mocking
Feature / api client mocking
- Loading branch information
Showing
34 changed files
with
477 additions
and
2,322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
APP_ENV=ci | ||
PAYMENT_API_TEST_BASE_URL=http://172.17.0.1:8443 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: PHP tests | ||
on: [pull_request] | ||
|
||
jobs: | ||
# similar job as below. Editing this one don't forget the one below | ||
unit-system-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
presta-versions: ['1.7.8.0-7.4', 'latest'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.0.0 | ||
|
||
- name: Cache vendor folder | ||
uses: actions/cache@v1 | ||
with: | ||
path: vendor | ||
key: php-${{ hashFiles('composer.lock') }} | ||
|
||
- name: Cache composer folder | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.composer/cache | ||
key: php-composer-cache | ||
|
||
- run: sudo composer self-update 2.2.11 | ||
- run: cp .env.dist .env | ||
- run: composer install | ||
- run: make run-tests-github-actions ps_instance=${{ matrix.presta-versions }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
vendor | ||
.idea | ||
.idea | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) | ||
|
||
run-ps: | ||
docker network create prestashop-net-${ps_instance} || true | ||
docker run -ti --name some-mysql-${ps_instance} --network prestashop-net-${ps_instance} --platform ${platform} -e APP_ENV=ci -e MYSQL_ROOT_PASSWORD=admin -e MYSQL_DATABASE=prestashop -p 4420:3306 -d mariadb:10.7.4 | ||
docker run -ti -v $(ROOT_DIR):/var/www/html/modules/prestashopdevcon --platform ${platform} --name some-prestashop-${ps_instance} --network prestashop-net-${ps_instance} -e DB_SERVER=some-mysql-${ps_instance} -e PS_INSTALL_AUTO=1 -e DB_NAME=prestashop -e PS_DOMAIN=localhost:8080 -e PS_FOLDER_ADMIN=admin1 -p 8080:80 -d prestashop/prestashop:${ps_instance} | ||
|
||
run-wiremock: | ||
docker run -d -ti --rm --name wiremock-${ps_instance} --network prestashop-net-${ps_instance} -v $(ROOT_DIR)/wiremock:/home/wiremock -p 8443:8080 wiremock/wiremock | ||
|
||
run-integration-tests: | ||
docker exec -i some-prestashop-${ps_instance} sh -c "cd /var/www/html && php bin/console prestashop:module install prestashopdevcon" | ||
docker exec -i some-prestashop-${ps_instance} sh -c "cd /var/www/html/modules/prestashopdevcon && php vendor/bin/phpunit -c tests/phpunit.xml --testsuite Integration" | ||
|
||
run-tests-github-actions: | ||
make run-ps ps_instance=${ps_instance} platform=linux/amd64 | ||
make run-wiremock ps_instance=${ps_instance} | ||
sleep 2m | ||
make run-integration-tests ps_instance=${ps_instance} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.