Browse Source

Generate coverage for quick DB tests

This adds the "QUICKDB" group which excludes some tests that abuse unit tests as integration tests as displayed in https://github.com/nextcloud/server/issues/1626

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
tags/v11.0RC2
Lukas Reschke 7 years ago
parent
commit
a1f5364d7f
No account linked to committer's email address

+ 14
- 4
.drone.yml View File

when: when:
matrix: matrix:
TESTS: integration-sharees-features TESTS: integration-sharees-features
codecov:
nodb-codecov:
image: nextcloudci/php7.0:php7.0-2 image: nextcloudci/php7.0:php7.0-2
commands: commands:
- TEST_SELECTION=NODB ./autotest.sh sqlite - TEST_SELECTION=NODB ./autotest.sh sqlite
- sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi" - sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"
when: when:
matrix: matrix:
TESTS: codecov

TESTS: nodb-codecov
db-codecov:
image: nextcloudci/php7.0:php7.0-2
commands:
- TEST_SELECTION=QUICKDB ./autotest.sh sqlite
- wget https://codecov.io/bash -O codecov.sh
- sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"
- sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"
when:
matrix:
TESTS: db-codecov
matrix: matrix:
include: include:
- TESTS: signed-off-check - TESTS: signed-off-check
- TESTS: codecov
- TESTS: nodb-codecov
- TESTS: db-codecov
- TESTS: integration-capabilities_features - TESTS: integration-capabilities_features
- TESTS: integration-federation_features - TESTS: integration-federation_features
- TESTS: integration-auth - TESTS: integration-auth

+ 1
- 1
apps/files_sharing/tests/EtagPropagationTest.php View File

/** /**
* Class EtagPropagationTest * Class EtagPropagationTest
* *
* @group DB
* @group SLOWDB
* *
* @package OCA\Files_Sharing\Tests * @package OCA\Files_Sharing\Tests
*/ */

+ 1
- 1
apps/files_sharing/tests/GroupEtagPropagationTest.php View File

use OC\Files\View; use OC\Files\View;


/** /**
* @group DB
* @group SLOWDB
* *
* @package OCA\Files_Sharing\Tests * @package OCA\Files_Sharing\Tests
*/ */

+ 1
- 1
apps/files_sharing/tests/SharedMountTest.php View File

/** /**
* Class SharedMountTest * Class SharedMountTest
* *
* @group DB
* @group SLOWDB
*/ */
class SharedMountTest extends TestCase { class SharedMountTest extends TestCase {



+ 5
- 2
autotest.sh View File

export XDEBUG_CONFIG=$_XDEBUG_CONFIG export XDEBUG_CONFIG=$_XDEBUG_CONFIG
fi fi
GROUP='' GROUP=''
if [ "$TEST_SELECTION" == "QUICKDB" ]; then
GROUP='--group DB --exclude-group=SLOWDB'
fi
if [ "$TEST_SELECTION" == "DB" ]; then if [ "$TEST_SELECTION" == "DB" ]; then
GROUP='--group DB'
GROUP='--group DB,SLOWDB'
fi fi
if [ "$TEST_SELECTION" == "NODB" ]; then if [ "$TEST_SELECTION" == "NODB" ]; then
GROUP='--exclude-group DB'
GROUP='--exclude-group DB,SLOWDB'
fi fi


COVER='' COVER=''

+ 4
- 2
tests/lib/TestCase.php View File

return true; return true;
} }
$annotations = $this->getAnnotations(); $annotations = $this->getAnnotations();
if (isset($annotations['class']['group']) && in_array('DB', $annotations['class']['group'])) {
return true;
if (isset($annotations['class']['group'])) {
if(in_array('DB', $annotations['class']['group']) || in_array('SLOWDB', $annotations['class']['group']) ) {
return true;
}
} }


return false; return false;

Loading…
Cancel
Save