mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
Updated integration tests script
This commit is contained in:
committed by
Dan Christian Bogos
parent
84c6a0e498
commit
0bd420aa12
@@ -1,147 +1,183 @@
|
||||
#! /usr/bin/env sh
|
||||
#!/bin/bash
|
||||
go clean --cache
|
||||
results=()
|
||||
./test.sh
|
||||
gen=$?
|
||||
|
||||
results+=($?)
|
||||
if [ "$#" -ne 0 ]; then
|
||||
# to run the integration tests for gob only add `-rpc=*gob` as argument to this script
|
||||
# to run for a single dbtype add `-dbtype=*mysql` as argument
|
||||
# ./integaration_tes.sh -dbtype=*mysql -rpc=*gob
|
||||
echo "go test github.com/cgrates/cgrates/apier/v1 -tags=integration $@"
|
||||
go test github.com/cgrates/cgrates/apier/v1 -tags=integration $@
|
||||
results+=($?)
|
||||
echo "go test github.com/cgrates/cgrates/apier/v2 -tags=integration $@"
|
||||
go test github.com/cgrates/cgrates/apier/v2 -tags=integration $@
|
||||
results+=($?)
|
||||
echo "go test github.com/cgrates/cgrates/engine -tags=integration $@"
|
||||
go test github.com/cgrates/cgrates/engine -tags=integration $@
|
||||
results+=($?)
|
||||
echo "go test github.com/cgrates/cgrates/ers -tags=integration $@"
|
||||
go test github.com/cgrates/cgrates/ers -tags=integration $@
|
||||
results+=($?)
|
||||
echo "go test github.com/cgrates/cgrates/loaders -tags=integration $@"
|
||||
go test github.com/cgrates/cgrates/loaders -tags=integration $@
|
||||
results+=($?)
|
||||
echo "go test github.com/cgrates/cgrates/general_tests -tags=integration $@"
|
||||
go test github.com/cgrates/cgrates/general_tests -tags=integration $@
|
||||
results+=($?)
|
||||
echo "go test github.com/cgrates/cgrates/agents -tags=integration $@"
|
||||
go test github.com/cgrates/cgrates/agents -tags=integration $@
|
||||
results+=($?)
|
||||
echo "go test github.com/cgrates/cgrates/sessions -tags=integration $@"
|
||||
go test github.com/cgrates/cgrates/sessions -tags=integration $@
|
||||
results+=($?)
|
||||
echo "go test github.com/cgrates/cgrates/dispatchers -tags=integration $@"
|
||||
go test github.com/cgrates/cgrates/dispatchers -tags=integration $@
|
||||
results+=($?)
|
||||
echo "go test github.com/cgrates/cgrates/apier/v1 -tags=offline $@"
|
||||
go test github.com/cgrates/cgrates/apier/v1 -tags=offline $@
|
||||
results+=($?)
|
||||
else
|
||||
# Internal
|
||||
echo 'go test github.com/cgrates/cgrates/apier/v1 -tags=integration -dbtype=*internal'
|
||||
go test github.com/cgrates/cgrates/apier/v1 -tags=integration -dbtype=*internal
|
||||
ap1_internal=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/apier/v2 -tags=integration -dbtype=*internal'
|
||||
go test github.com/cgrates/cgrates/apier/v2 -tags=integration -dbtype=*internal
|
||||
ap2_internal=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/engine -tags=integration -dbtype=*internal'
|
||||
go test github.com/cgrates/cgrates/engine -tags=integration -dbtype=*internal
|
||||
en_internal=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/ers -tags=integration -dbtype=*internal'
|
||||
go test github.com/cgrates/cgrates/ers -tags=integration -dbtype=*internal
|
||||
ers_internal=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/loaders -tags=integration -dbtype=*internal'
|
||||
go test github.com/cgrates/cgrates/loaders -tags=integration -dbtype=*internal
|
||||
lds_internal=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/general_tests -tags=integration -dbtype=*internal'
|
||||
go test github.com/cgrates/cgrates/general_tests -tags=integration -dbtype=*internal
|
||||
gnr_internal=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/agents -tags=integration -dbtype=*internal'
|
||||
go test github.com/cgrates/cgrates/agents -tags=integration -dbtype=*internal
|
||||
agts_internal=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/sessions -tags=integration -dbtype=*internal'
|
||||
go test github.com/cgrates/cgrates/sessions -tags=integration -dbtype=*internal
|
||||
smg_internal=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/dispatchers -tags=integration -dbtype=*internal'
|
||||
go test github.com/cgrates/cgrates/dispatchers -tags=integration -dbtype=*internal
|
||||
dis_internal=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/apier/v1 -tags=offline -dbtype=*internal'
|
||||
go test github.com/cgrates/cgrates/apier/v1 -tags=offline -dbtype=*internal
|
||||
offline_internal=$?
|
||||
results+=($?)
|
||||
# SQL
|
||||
echo 'go test github.com/cgrates/cgrates/apier/v1 -tags=integration -dbtype=*mysql'
|
||||
go test github.com/cgrates/cgrates/apier/v1 -tags=integration -dbtype=*mysql
|
||||
ap1_mysql=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/apier/v2 -tags=integration -dbtype=*mysql'
|
||||
go test github.com/cgrates/cgrates/apier/v2 -tags=integration -dbtype=*mysql
|
||||
ap2_mysql=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/engine -tags=integration -dbtype=*mysql'
|
||||
go test github.com/cgrates/cgrates/engine -tags=integration -dbtype=*mysql
|
||||
en_mysql=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/ers -tags=integration -dbtype=*mysql'
|
||||
go test github.com/cgrates/cgrates/ers -tags=integration -dbtype=*mysql
|
||||
ers_mysql=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/loaders -tags=integration -dbtype=*mysql'
|
||||
go test github.com/cgrates/cgrates/loaders -tags=integration -dbtype=*mysql
|
||||
lds_mysql=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/general_tests -tags=integration -dbtype=*mysql'
|
||||
go test github.com/cgrates/cgrates/general_tests -tags=integration -dbtype=*mysql
|
||||
gnr_mysql=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/agents -tags=integration -dbtype=*mysql'
|
||||
go test github.com/cgrates/cgrates/agents -tags=integration -dbtype=*mysql
|
||||
agts_mysql=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/sessions -tags=integration -dbtype=*mysql'
|
||||
go test github.com/cgrates/cgrates/sessions -tags=integration -dbtype=*mysql
|
||||
smg_mysql=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/dispatchers -tags=integration -dbtype=*mysql'
|
||||
go test github.com/cgrates/cgrates/dispatchers -tags=integration -dbtype=*mysql
|
||||
dis_mysql=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/apier/v1 -tags=offline -dbtype=*mysql'
|
||||
go test github.com/cgrates/cgrates/apier/v1 -tags=offline -dbtype=*mysql
|
||||
offline_mysql=$?
|
||||
results+=($?)
|
||||
# Mongo
|
||||
echo 'go test github.com/cgrates/cgrates/apier/v1 -tags=integration -dbtype=*mongo'
|
||||
go test github.com/cgrates/cgrates/apier/v1 -tags=integration -dbtype=*mongo
|
||||
ap1_mongo=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/apier/v2 -tags=integration -dbtype=*mongo'
|
||||
go test github.com/cgrates/cgrates/apier/v2 -tags=integration -dbtype=*mongo
|
||||
ap2_mongo=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/engine -tags=integration -dbtype=*mongo'
|
||||
go test github.com/cgrates/cgrates/engine -tags=integration -dbtype=*mongo
|
||||
en_mongo=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/ers -tags=integration -dbtype=*mongo'
|
||||
go test github.com/cgrates/cgrates/ers -tags=integration -dbtype=*mongo
|
||||
ers_mongo=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/loaders -tags=integration -dbtype=*mongo'
|
||||
go test github.com/cgrates/cgrates/loaders -tags=integration -dbtype=*mongo
|
||||
lds_mongo=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/general_tests -tags=integration -dbtype=*mongo'
|
||||
go test github.com/cgrates/cgrates/general_tests -tags=integration -dbtype=*mongo
|
||||
gnr_mongo=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/agents -tags=integration -dbtype=*mongo'
|
||||
go test github.com/cgrates/cgrates/agents -tags=integration -dbtype=*mongo
|
||||
agts_mongo=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/sessions -tags=integration -dbtype=*mongo'
|
||||
go test github.com/cgrates/cgrates/sessions -tags=integration -dbtype=*mongo
|
||||
smg_mongo=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/dispatchers -tags=integration -dbtype=*mongo'
|
||||
go test github.com/cgrates/cgrates/dispatchers -tags=integration -dbtype=*mongo
|
||||
dis_mongo=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/apier/v1 -tags=offline -dbtype=*mongo'
|
||||
go test github.com/cgrates/cgrates/apier/v1 -tags=offline -dbtype=*mongo
|
||||
offline_mongo=$?
|
||||
results+=($?)
|
||||
# Postgres
|
||||
echo 'go test github.com/cgrates/cgrates/apier/v1 -tags=integration -dbtype=*postgres'
|
||||
go test github.com/cgrates/cgrates/apier/v1 -tags=integration -dbtype=*postgres
|
||||
ap1_postgres=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/apier/v2 -tags=integration -dbtype=*postgres'
|
||||
go test github.com/cgrates/cgrates/apier/v2 -tags=integration -dbtype=*postgres
|
||||
ap2_postgres=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/engine -tags=integration -dbtype=*postgres'
|
||||
go test github.com/cgrates/cgrates/engine -tags=integration -dbtype=*postgres
|
||||
en_postgres=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/ers -tags=integration -dbtype=*postgres'
|
||||
go test github.com/cgrates/cgrates/ers -tags=integration -dbtype=*postgres
|
||||
ers_postgres=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/loaders -tags=integration -dbtype=*postgres'
|
||||
go test github.com/cgrates/cgrates/loaders -tags=integration -dbtype=*postgres
|
||||
lds_postgres=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/general_tests -tags=integration -dbtype=*postgres'
|
||||
go test github.com/cgrates/cgrates/general_tests -tags=integration -dbtype=*postgres
|
||||
gnr_postgres=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/agents -tags=integration -dbtype=*postgres'
|
||||
go test github.com/cgrates/cgrates/agents -tags=integration -dbtype=*postgres
|
||||
agts_postgres=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/sessions -tags=integration -dbtype=*postgres'
|
||||
go test github.com/cgrates/cgrates/sessions -tags=integration -dbtype=*postgres
|
||||
smg_postgres=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/dispatchers -tags=integration -dbtype=*postgres'
|
||||
go test github.com/cgrates/cgrates/dispatchers -tags=integration -dbtype=*postgres
|
||||
dis_postgres=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/apier/v1 -tags=offline -dbtype=*postgres'
|
||||
go test github.com/cgrates/cgrates/apier/v1 -tags=offline -dbtype=*postgres
|
||||
offline_postgres=$?
|
||||
results+=($?)
|
||||
|
||||
fi
|
||||
|
||||
echo 'go test github.com/cgrates/cgrates/config -tags=integration'
|
||||
go test github.com/cgrates/cgrates/config -tags=integration
|
||||
cfg=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/migrator -tags=integration'
|
||||
go test github.com/cgrates/cgrates/migrator -tags=integration
|
||||
mgr=$?
|
||||
results+=($?)
|
||||
echo 'go test github.com/cgrates/cgrates/services -tags=integration'
|
||||
go test github.com/cgrates/cgrates/services -tags=integration
|
||||
srv=$?
|
||||
results+=($?)
|
||||
|
||||
exit $gen && $ap1_internal && $ap2_internal && $en_internal && $ers_internal && $lds_internal &&
|
||||
$gnr_internal && $agts_internal && $smg_internal && $dis_internal && $offline_internal && $ap1_mysql &&
|
||||
$ap2_mysql && $en_mysql && $ers_mysql && $lds_mysql && $gnr_mysql && $agts_mysql && $smg_mysql &&
|
||||
$dis_mysql && $offline_mysql && $ap1_mongo && $ap2_mongo && $en_mongo && $ers_mongo && $lds_mongo &&
|
||||
$gnr_mongo && $agts_mongo && $smg_mongo && $dis_mongo && $offline_mongo && $ap1_postgres &&
|
||||
$ap2_postgres && $en_postgres && $ers_postgres && $lds_postgres && $gnr_postgres && $agts_postgres &&
|
||||
$smg_postgres && $dis_postgres && $offline_postgres && $cfg && $mgr && $srv
|
||||
|
||||
pass=1
|
||||
for val in ${results[@]}; do
|
||||
(( pass=$pass&&$val))
|
||||
done
|
||||
exit $pass
|
||||
Reference in New Issue
Block a user