forked from hurtom/toloka
-
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.
[ci] Add travis config, add codeception tests
+ Initial travis integration + Run tests using docker + Initial Codeception tests (dummy) hurtom#10 + Add codecov config + Codacy coverage upload + Code Climate coverage upload
- Loading branch information
Showing
27 changed files
with
363 additions
and
1 deletion.
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,10 @@ | ||
coverage: | ||
notify: | ||
gitter: | ||
default: | ||
url: secret:kvLT+qHSbVOxA0G+9zqmoJEcsjpbzbS56X1gw0gJDtVBxHjjsvisBWfxQH/OlqPd03Ulqv6CNPSvhtuzhAKA72VzDBor/1w/AVuktCmNdepejXJKl+xcpvnU8/bD4fa8 | ||
threshold: 1% | ||
only_pulls: false | ||
branches: null | ||
flags: null | ||
paths: null |
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 @@ | ||
coverage_clover: tests/_output/clover.xml | ||
json_path: tests/_output/coveralls-upload.json |
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,66 @@ | ||
sudo: required | ||
|
||
language: php | ||
|
||
services: | ||
- docker | ||
|
||
php: | ||
- 7.1 | ||
|
||
env: | ||
global: | ||
- DOCKER_COMPOSE_VERSION=1.14.0 | ||
# Codacy | ||
# Code Climate | ||
matrix: | ||
- COMPOSER_FLAGS="--prefer-lowest" | ||
- COMPOSER_FLAGS="" | ||
|
||
notifications: | ||
webhooks: | ||
urls: | ||
- secure: "Y1c9BAQwPLcz1ux2yxzyeFkNblIJuwSnwrnBSEwL4stIn+d4OktoJ0mxir+L9fzVhOkzOX1qRQr9cV8H37SENiI5WEmfTyQQ775TIXwUjGEgI7Rl9sUN7Cl12/tsA6TQDPxy+R9JeHzjZUwp/56K3hZi8TdK/mNQCcrFAabAdZZYaJTx5Uzm4vkWi20/uDDF0tTh4V79MUfAQ+OoMi7VO7BgQuR38cZEfD59i/A9dN2/Su1VVeeQd2Rw1j4S8rcvGaYb7Yhm51gMtPVNnA1LjwXxVPZ+/z8w8v3a1FAzwp+/+jDKVIY5+XEC96HeOwVXLbPscubJ6T5dqDjJ17SDgcNNYOg6WH6kfiJi3Ec7tMjeCJ/Ujsm8X6H2A0B7+n2Q1+Kd1jVtbGNwbdUVoxY7vp52839OzA1+qIcKLFVREGub81b/XAfJ1HJz6dYcJnX5VCIJ9PN5hiitAhrbWVLzdQhZ4ujiJxwIFiC+HQETq0TNqf2IgGkc135ihOR7H0fzvXIijq0eDhWfqERmUc4NLZRGp82ikWHq8tF8e2ipfjOulTPx6qcCrXHMiHkFe7F02cqVSqtJxRKu2Rhg6+IJ3Wsz73jx1GOqrk8+MKpkwY67yuN3qwGC11wOtv+CbP8O67iNxYZ4pKhRMuNwcibCTRzj5XpQveBoMQiRu8AkmeA=" | ||
# on_* options: [always|never|change] default: always | ||
on_success: change | ||
on_failure: always | ||
on_start: never | ||
|
||
before_install: | ||
- sudo rm /usr/local/bin/docker-compose | ||
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose | ||
- chmod +x docker-compose | ||
- sudo mv docker-compose /usr/local/bin | ||
- docker-compose --version | ||
|
||
before_script: | ||
- test $(grep -q memory_limit docker/php.ini) || echo 'memory_limit=-1' >> docker/php.ini | ||
- docker-compose pull | ||
- docker-compose up -d | ||
- docker-compose exec -T toloka chown -R 33:33 /var/www | ||
- docker-compose exec -T toloka chmod -R a+w /var/www/html/tests/_output | ||
- travis_retry docker-compose exec -T toloka composer self-update | ||
- travis_retry docker-compose exec -T -u 33 toloka composer update --no-interaction --prefer-dist ${COMPOSER_FLAGS} | ||
|
||
script: | ||
- docker-compose exec -T -u 33 toloka composer test:unit:clover | ||
|
||
after_script: | ||
### Codacy | ||
- vendor/bin/codacycoverage clover tests/_output/clover.xml | ||
### Scrutinizer | ||
#- vendor/bin/ocular code-coverage:upload --format=php-clover tests/_output/clover.xml | ||
### Coveralls | ||
- vendor/bin/coveralls -v -x tests/_output/clover.xml | ||
### Code Climate | ||
- if [ $TRAVIS_PULL_REQUEST = 'false' ]; then vendor/bin/test-reporter --coverage-report=tests/_output/clover.xml; fi | ||
### stop docker at the end | ||
- docker-compose stop | ||
|
||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) | ||
|
||
addons: | ||
hosts: | ||
- toloka.dev | ||
- toloka.local |
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,12 @@ | ||
paths: | ||
tests: tests | ||
output: tests/_output | ||
data: tests/_data | ||
support: tests/_support | ||
envs: tests/_envs | ||
actor_suffix: Tester | ||
coverage: | ||
enabled: true | ||
extensions: | ||
enabled: | ||
- Codeception\Extension\RunFailed |
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
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
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,2 @@ | ||
* | ||
!.gitignore |
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,26 @@ | ||
<?php | ||
|
||
|
||
/** | ||
* Inherited Methods | ||
* @method void wantToTest($text) | ||
* @method void wantTo($text) | ||
* @method void execute($callable) | ||
* @method void expectTo($prediction) | ||
* @method void expect($prediction) | ||
* @method void amGoingTo($argumentation) | ||
* @method void am($role) | ||
* @method void lookForwardTo($achieveValue) | ||
* @method void comment($description) | ||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL) | ||
* | ||
* @SuppressWarnings(PHPMD) | ||
*/ | ||
class AcceptanceTester extends \Codeception\Actor | ||
{ | ||
use _generated\AcceptanceTesterActions; | ||
|
||
/** | ||
* Define custom actions here | ||
*/ | ||
} |
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,26 @@ | ||
<?php | ||
|
||
|
||
/** | ||
* Inherited Methods | ||
* @method void wantToTest($text) | ||
* @method void wantTo($text) | ||
* @method void execute($callable) | ||
* @method void expectTo($prediction) | ||
* @method void expect($prediction) | ||
* @method void amGoingTo($argumentation) | ||
* @method void am($role) | ||
* @method void lookForwardTo($achieveValue) | ||
* @method void comment($description) | ||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL) | ||
* | ||
* @SuppressWarnings(PHPMD) | ||
*/ | ||
class ApiTester extends \Codeception\Actor | ||
{ | ||
use _generated\ApiTesterActions; | ||
|
||
/** | ||
* Define custom actions here | ||
*/ | ||
} |
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,26 @@ | ||
<?php | ||
|
||
|
||
/** | ||
* Inherited Methods | ||
* @method void wantToTest($text) | ||
* @method void wantTo($text) | ||
* @method void execute($callable) | ||
* @method void expectTo($prediction) | ||
* @method void expect($prediction) | ||
* @method void amGoingTo($argumentation) | ||
* @method void am($role) | ||
* @method void lookForwardTo($achieveValue) | ||
* @method void comment($description) | ||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL) | ||
* | ||
* @SuppressWarnings(PHPMD) | ||
*/ | ||
class FunctionalTester extends \Codeception\Actor | ||
{ | ||
use _generated\FunctionalTesterActions; | ||
|
||
/** | ||
* Define custom actions here | ||
*/ | ||
} |
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,9 @@ | ||
<?php | ||
namespace Helper; | ||
|
||
// here you can define custom actions | ||
// all public methods declared in helper class will be available in $I | ||
|
||
class Acceptance extends \Codeception\Module | ||
{ | ||
} |
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,9 @@ | ||
<?php | ||
namespace Helper; | ||
|
||
// here you can define custom actions | ||
// all public methods declared in helper class will be available in $I | ||
|
||
class Api extends \Codeception\Module | ||
{ | ||
} |
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,9 @@ | ||
<?php | ||
namespace Helper; | ||
|
||
// here you can define custom actions | ||
// all public methods declared in helper class will be available in $I | ||
|
||
class Functional extends \Codeception\Module | ||
{ | ||
} |
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,9 @@ | ||
<?php | ||
namespace Helper; | ||
|
||
// here you can define custom actions | ||
// all public methods declared in helper class will be available in $I | ||
|
||
class Unit extends \Codeception\Module | ||
{ | ||
} |
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,26 @@ | ||
<?php | ||
|
||
|
||
/** | ||
* Inherited Methods | ||
* @method void wantToTest($text) | ||
* @method void wantTo($text) | ||
* @method void execute($callable) | ||
* @method void expectTo($prediction) | ||
* @method void expect($prediction) | ||
* @method void amGoingTo($argumentation) | ||
* @method void am($role) | ||
* @method void lookForwardTo($achieveValue) | ||
* @method void comment($description) | ||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL) | ||
* | ||
* @SuppressWarnings(PHPMD) | ||
*/ | ||
class UnitTester extends \Codeception\Actor | ||
{ | ||
use _generated\UnitTesterActions; | ||
|
||
/** | ||
* Define custom actions here | ||
*/ | ||
} |
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 @@ | ||
* | ||
!.gitignore |
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,12 @@ | ||
# Codeception Test Suite Configuration | ||
# | ||
# Suite for acceptance tests. | ||
# Perform tests in browser using the WebDriver or PhpBrowser. | ||
# If you need both WebDriver and PHPBrowser tests - create a separate suite. | ||
|
||
actor: AcceptanceTester | ||
modules: | ||
enabled: | ||
- PhpBrowser: | ||
url: http://toloka.dev | ||
- \Helper\Acceptance |
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,20 @@ | ||
<?php | ||
|
||
|
||
class FirstCest | ||
{ | ||
public function _before(AcceptanceTester $I) | ||
{ | ||
} | ||
|
||
public function _after(AcceptanceTester $I) | ||
{ | ||
} | ||
|
||
// tests | ||
public function frontpageWorks(AcceptanceTester $I) | ||
{ | ||
$I->amOnPage('/'); | ||
$I->see('Домашня'); | ||
} | ||
} |
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,7 @@ | ||
actor: ApiTester | ||
modules: | ||
enabled: | ||
- REST: | ||
url: http://toloka.dev/api/v1/ | ||
depends: PhpBrowser | ||
part: Json |
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,10 @@ | ||
<?php | ||
class ApiCest | ||
{ | ||
public function tryApi(ApiTester $I) | ||
{ | ||
$I->sendGET('/'); | ||
$I->seeResponseCodeIs(200); | ||
//$I->seeResponseIsJson(); | ||
} | ||
} |
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,12 @@ | ||
# Codeception Test Suite Configuration | ||
# | ||
# Suite for functional tests | ||
# Emulate web requests and make application process them | ||
# Include one of framework modules (Symfony2, Yii2, Laravel5) to use it | ||
# Remove this suite if you don't use frameworks | ||
|
||
actor: FunctionalTester | ||
modules: | ||
enabled: | ||
# add a framework module here | ||
- \Helper\Functional |
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,9 @@ | ||
# Codeception Test Suite Configuration | ||
# | ||
# Suite for unit or integration tests. | ||
|
||
actor: UnitTester | ||
modules: | ||
enabled: | ||
- Asserts | ||
- \Helper\Unit |
Empty file.
Oops, something went wrong.