add code for community server coverage

This commit is contained in:
einhorn_b 2021-05-21 20:15:26 +02:00
parent 713b7b3dcc
commit f8bb7cc08d
4 changed files with 21 additions and 9 deletions

View File

@ -316,9 +316,19 @@ jobs:
########################################################################## ##########################################################################
- name: Login-Server | Unit tests - name: Login-Server | Unit tests
run: | run: |
docker run -v ~/coverage:/code/build/coverage -v ./configs/login_server/Gradido_LoginServer_Test.properties:/code/build/Gradido_LoginServer_Test.properties gradido/login_server:test --entrypoint docker run -v ~/coverage:/code/build/coverage -v gradido/login_server:test " ./vendor/bin/phpunit --coverage-html ./coverage"
cp -r ~/coverage ./coverage cp -r ~/coverage ./coverage
##########################################################################
# COVERAGE CHECK BACKEND COMMUNITY-SERVER ####################################
##########################################################################
- name: backend | Coverage check
uses: webcraftmedia/coverage-check-action@master
with:
report_name: Coverage Backend
type: lcov
result_path: ./coverage/lcov.info
min_coverage: 8
token: ${{ github.token }}
#test: #test:
# runs-on: ubuntu-latest # runs-on: ubuntu-latest

View File

@ -23,8 +23,7 @@ class CommunityProfilesFixture extends TestFixture
'state_user_id' => ['type' => 'index', 'columns' => ['state_user_id'], 'length' => []], 'state_user_id' => ['type' => 'index', 'columns' => ['state_user_id'], 'length' => []],
], ],
'_constraints' => [ '_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []], 'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []]
'community_profiles_ibfk_1' => ['type' => 'foreign', 'columns' => ['state_user_id'], 'references' => ['state_users', 'id'], 'update' => 'restrict', 'delete' => 'restrict', 'length' => []],
], ],
'_options' => [ '_options' => [
'engine' => 'InnoDB', 'engine' => 'InnoDB',

View File

@ -306,9 +306,9 @@ return [
'persistent' => false, 'persistent' => false,
'host' => 'localhost', 'host' => 'localhost',
//'port' => 'non_standard_port_number', //'port' => 'non_standard_port_number',
'username' => 'my_app', 'username' => 'root',
'password' => 'secret', 'password' => '',
'database' => 'test_myapp', 'database' => 'gradido_community_test',
//'encoding' => 'utf8mb4', //'encoding' => 'utf8mb4',
'timezone' => 'UTC', 'timezone' => 'UTC',
'cacheMetadata' => true, 'cacheMetadata' => true,

View File

@ -48,16 +48,19 @@ int load() {
printf("[load] error loading Gradido_LoginServer_Test.properties, make sure this file exist! (%s)\n", ex.displayText().data()); printf("[load] error loading Gradido_LoginServer_Test.properties, make sure this file exist! (%s)\n", ex.displayText().data());
return -3; return -3;
} }
std::clog << "[Gradido_LoginServer_Test::load] after loading config" << std::endl;
if (!ServerConfig::initServerCrypto(*test_config)) { if (!ServerConfig::initServerCrypto(*test_config)) {
//printf("[Gradido_LoginServer::%s] error init server crypto\n", __FUNCTION__); //printf("[Gradido_LoginServer::%s] error init server crypto\n", __FUNCTION__);
printf("[load] error init server crypto"); printf("[load] error init server crypto");
return -1; return -1;
} }
std::clog << "[Gradido_LoginServer_Test::load] after init server crypto" << std::endl;
if (!ServerConfig::loadMnemonicWordLists()) { if (!ServerConfig::loadMnemonicWordLists()) {
printf("[load] error in loadMnemonicWordLists"); printf("[load] error in loadMnemonicWordLists");
return -2; return -2;
} }
std::clog << "[Gradido_LoginServer_Test::load] after load mnemonic word lists" << std::endl;
// start cpu scheduler // start cpu scheduler
uint8_t worker_count = Poco::Environment::processorCount(); uint8_t worker_count = Poco::Environment::processorCount();
@ -77,6 +80,7 @@ int load() {
} catch(Poco::Exception& ex) { } catch(Poco::Exception& ex) {
printf("Poco Exception by connecting to db: %s\n", ex.displayText().data()); printf("Poco Exception by connecting to db: %s\n", ex.displayText().data());
} }
std::clog << "[Gradido_LoginServer_Test::load] after connecting to db" << std::endl;
//printf("try connect php server mysql \n"); //printf("try connect php server mysql \n");
//conn->setConnectionsFromConfig(*test_config, CONNECTION_MYSQL_PHP_SERVER); //conn->setConnectionsFromConfig(*test_config, CONNECTION_MYSQL_PHP_SERVER);
@ -132,8 +136,7 @@ int load() {
int run() int run()
{ {
//printf("running tests\n"); std::clog << "[Gradido_LoginServer_Test::run]" << std::endl;
printf("running tests\n");
for (std::list<Test*>::iterator it = gTests.begin(); it != gTests.end(); it++) for (std::list<Test*>::iterator it = gTests.begin(); it != gTests.end(); it++)
{ {
//printf("running: %s\n", it->getName()); //printf("running: %s\n", it->getName());