PHPUnit で CI に Shippable を使用する場合、一度に複数のテスト クラスを作成する方法がわかりません。
すべてのテストを 1 つのクラスに入れると、問題なく動作し、レポートとシーケンス カバレッジが得られます。しかし、2 つのテストクラスが必要な場合、適切なレポートが得られません。
私の構造:
- config
- ...
- tests
- SQLTest.php
- UserTest.php
私の shippable.yml :
language: php
php:
- 5.4
before_script:
- mkdir -p shippable/testresults
- mkdir -p shippable/codecoverage
- mysql -e 'create database if not exists test;'
script:
- phpunit --log-junit shippable/testresults/junit.xml --coverage-xml shippable/codecoverage tests
SQLTest.php :
class SQLTest extends PHPUnit_Framework_TestCase {
public function testRandomStringLength(){
$test = "string";
$this -> assertEquals(strlen($test), 6);
}
}
UserTest.php :
class UserTest extends PHPUnit_Framework_TestCase {
public function testRandomStringLength(){
$test = "string";
$this -> assertEquals(strlen($test), 6);
}
}
Shippableのログには次のように書かれています:
Time: 202 ms, Memory: 7.75Mb
OK (2 tests, 2 assertions)
Generating code coverage report in PHPUnit XML format ... done
ビルドは成功です。しかし、[テスト] タブをクリックすると、 と表示されますNo tests for this build.
。なぜそれが起こっているのですか?