Просмотр исходного кода

Integration tests #5694 - separate integration tests

Aleksandr Trofimov 1 месяц назад
Родитель
Сommit
ebda1812e7
3 измененных файлов с 19 добавлено и 2 удалено
  1. 3 1
      build.xml
  2. 3 1
      composer.json
  3. 13 0
      tests/README.md

+ 3 - 1
build.xml

@@ -171,7 +171,7 @@
     <target name="test-integration">
         <echo msg="Testing integration..." />
         <exec executable="${php}" dir="${project.basedir}" checkreturn="true">
-            <arg line="plugins/bin/phpunit -c tests/phpunit.xml --testsuite Integration" />
+            <arg line="plugins/bin/phpunit -c tests/phpunit.xml --testsuite Integration --log-junit logs/junit-integration.xml" />
         </exec>
     </target>
 
@@ -441,6 +441,8 @@
                 <exclude name="phpcdp.xml" />
                 <exclude name="phpcpd.xml" />
                 <exclude name="junit.xml" />
+                <exclude name="junit-units.xml" />
+                <exclude name="junit-integration.xml" />
             </fileset>
         </delete>
         <delete includeemptydirs="true">

+ 3 - 1
composer.json

@@ -127,6 +127,8 @@
             "test -f ./plugins/ffmpeg/ffmpeg/ffmpeg-linux-x64 && mv ./plugins/ffmpeg/ffmpeg/ffmpeg-linux-x64 ./plugins/ffmpeg/ffmpeg.exe && rm -rf ./plugins/ffmpeg/ffmpeg || true",
             "grep -Fq \"this->headers['Content-MD5']\" plugins/tpyo/amazon-s3-php-class/S3.php || patch -p1 --batch < patches/plugins_tpyo_amazon-s3-php-class.txt"
         ],
-        "test": "phpunit -c tests/phpunit.xml"
+        "test": "phpunit -c tests/phpunit.xml",
+        "test-units": "phpunit -c tests/phpunit.xml --testsuite Units --log-junit logs/junit-units.xml",
+        "test-integration": "phpunit -c tests/phpunit.xml --testsuite Integration --log-junit logs/junit-integration.xml"
     }
 }

+ 13 - 0
tests/README.md

@@ -49,13 +49,26 @@ Alternatively:
 ```
 phing test
 ```
+JUnit report: `logs/junit.xml`.
+
 Unit tests only:
 ```
 phing test-units
 ```
+or:
+```
+composer test-units
+```
+JUnit report: `logs/junit-units.xml`.
+
 Integration tests only:
 ```
 phing test-integration
 ```
+or:
+```
+composer test-integration
+```
+JUnit report: `logs/junit-integration.xml`.
 
 Integration tests read `tests/.env` when present (`cp tests/.env.example tests/.env`). Without that file they use installer defaults. Tests skip an account that is not installed.