Skip to content

Commit

Permalink
improved dockerized tests (yiisoft#15516)
Browse files Browse the repository at this point in the history
- added ENV variable for using custom runtime folder
- create assets directory before using asset-manager
  • Loading branch information
schmunk42 authored and samdark committed Jan 18, 2018
1 parent eaca9c4 commit 1bc17a3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,10 @@

Yii::setAlias('@yiiunit', __DIR__);

if (getenv('TEST_RUNTIME_PATH')) {
Yii::setAlias('@yiiunit/runtime', getenv('TEST_RUNTIME_PATH'));
Yii::setAlias('@runtime', getenv('TEST_RUNTIME_PATH'));
}

require_once __DIR__ . '/compatibility.php';
require_once __DIR__ . '/TestCase.php';
2 changes: 2 additions & 0 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ services:
# Tmpfs volume (experimental, asset tests may fail)
#tmpfs:
# - /project/tests/runtime
environment:
- TEST_RUNTIME_PATH=/tmp/runtime

networks:
default:
Expand Down
2 changes: 1 addition & 1 deletion tests/framework/grid/CheckboxColumnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ protected function setUp()
$this->mockApplication();
Yii::setAlias('@webroot', '@yiiunit/runtime');
Yii::setAlias('@web', 'http://localhost/');
Yii::$app->assetManager->bundles['yii\web\JqueryAsset'] = false;
FileHelper::createDirectory(Yii::getAlias('@webroot/assets'));
Yii::$app->assetManager->bundles['yii\web\JqueryAsset'] = false;
}

public function testInputName()
Expand Down

0 comments on commit 1bc17a3

Please sign in to comment.