This commit is contained in:
einhorn_b 2021-05-24 17:59:59 +02:00
parent 61633ba7b0
commit 1228586d47
5 changed files with 113 additions and 6 deletions

103
.github/workflows/debug.yml vendored Normal file
View File

@ -0,0 +1,103 @@
name: gradido debug actions with act CI
jobs:
##############################################################################
# JOB: DOCKER BUILD AND TEST LOGIN SERVER ####################################
##############################################################################
test_login_server_debug:
name: Docker Build Test - Login Server
runs-on: ubuntu-latest
#needs: [nothing]
services:
mariadb:
image: gradido/mariadb:test
env:
MARIADB_ALLOW_EMPTY_PASSWORD: 1
MARIADB_USER: root
ports:
- 3306:3306
volumes:
- db_vol:/var/lib/mysql
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
##########################################################################
# BUILD LOGIN SERVER DOCKER IMAGE ########################################
##########################################################################
- name: login server | Build `test` image
run: |
docker build --target test -t "gradido/login_server:test" -f ./login_server/Dockerfile login_server/
docker save "gradido/login_server:test" > /tmp/login_server.tar
##########################################################################
# UNIT TESTS BACKEND LOGIN-SERVER #######################################
##########################################################################
- name: Login-Server | Unit tests
run: |
docker run -v ~/coverage:/code/build/coverage -v ./configs/login_server:/etc/grd_login gradido/login_server:test
cp -r ~/coverage ./coverage
##########################################################################
# COVERAGE CHECK BACKEND LOGIN-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 }}
##############################################################################
# JOB: DOCKER BUILD AND TEST COMMUNITY SERVER ################################
##############################################################################
build_test_community_server:
name: Docker Build Test - Community Server
runs-on: ubuntu-latest
#needs: [nothing]
services:
mariadb:
image: gradido/mariadb:test
env:
MARIADB_ALLOW_EMPTY_PASSWORD: 1
MARIADB_USER: root
ports:
- 3306:3306
volumes:
- db_vol:/var/lib/mysql
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v2
##########################################################################
# BUILD COMMUNITY SERVER DOCKER IMAGE ####################################
##########################################################################
- name: community server | Build `test` image
run: |
docker build -t "gradido/community_server:test" -f ./community_server/Dockerfile ./
docker save "gradido/community_server:test" > /tmp/community_server.tar
##########################################################################
# UNIT TESTS BACKEND COMMUNITY-SERVER #######################################
##########################################################################
- name: community server | Unit tests
run: |
docker run -v ~/coverage:/var/www/cakephp/webroot/coverage gradido/community_server:test "./vendor/bin/phpunit --coverage-html ./webroot/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 }}

View File

@ -253,7 +253,7 @@ jobs:
##########################################################################
- name: Login-Server | Unit tests
run: |
docker run -v ~/coverage:/code/build/coverage -v ~/configs/login_server:/code/config gradido/login_server:test
docker run -v ~/coverage:/code/build/coverage -v ./configs/login_server:/etc/grd_login gradido/login_server:test
cp -r ~/coverage ./coverage
##########################################################################
# COVERAGE CHECK BACKEND LOGIN-SERVER ####################################

View File

@ -30,8 +30,6 @@ RUN apk add --no-cache bash perl
# cd lcov && \
# make install
RUN mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Debug .. && \
make -j$(nproc) Gradido_LoginServer_Test
@ -39,6 +37,7 @@ RUN mkdir build && cd build && \
RUN chmod +x build/bin/Gradido_LoginServer_Test
#CMD [ "./build/bin/Gradido_LoginServer_Test" ]
#ENTRYPOINT [ "/usr/bin/make", "-C", "/code/build", "coverage" ]
ENTRYPOINT make -C build coverage
#########################################################################################################

View File

@ -36,12 +36,17 @@ void runMysql(std::string sqlQuery)
}
}
int load() {
int load(int argc, char* argv[]) {
// init server config, init seed array
std::clog << "[load]" << std::endl;
Poco::AutoPtr<Poco::Util::LayeredConfiguration> test_config(new Poco::Util::LayeredConfiguration);
std::string config_file_name = Poco::Path::config() + "grd_login/grd_login_test.properties";
if(argc > 1 && strlen(argv[1]) > 4) {
config_file_name = argv[1];
}
try {
auto cfg = new Poco::Util::PropertyFileConfiguration("config/Gradido_LoginServer_Test.properties");
auto cfg = new Poco::Util::PropertyFileConfiguration(config_file_name);
test_config->add(cfg);
}
catch (Poco::Exception& ex) {
@ -161,7 +166,7 @@ void ende()
int main(int argc, char** argv)
{
if (load() < 0) {
if (load(argc, argv) < 0) {
printf("early exit\n");
return -42;
}