Skip to content

Commit 62a93d1

Browse files
committed
ci(e2etest) use test image
1 parent 85d3068 commit 62a93d1

File tree

4 files changed

+26
-74
lines changed

4 files changed

+26
-74
lines changed

ci/gitlab-ci/lib.yml

+12-30
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@
883883
# lib/scripts/test.sh
884884
test_prepare_working_dir() {
885885
if [ "${TINE20ROOT}" != "${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20" ]; then
886-
log "test_preapre_wirking_dir is only requires the tine root to be: \${CI_BUILDS_DIR}/\${CI_PROJECT_NAMESPACE}/tine20"
886+
log "test_preapre_working_dir requires the tine root to be: \${CI_BUILDS_DIR}/\${CI_PROJECT_NAMESPACE}/tine20"
887887
# This function is only intended to work with the source from gitlab...
888888
# intended: for the main repo => do basicly nothing. Or for customapps => clone main repo and include customapp
889889
# and setup vars as if we where running in the main repo.
@@ -1061,7 +1061,7 @@
10611061
entry_points:
10621062
# lib/entry_points/tine_as_a_service.sh
10631063
tine_as_a_service:
1064-
-
1064+
- /bin/bash
10651065
- -c
10661066
- |
10671067
# lib/scripts/cache_cleanup.sh
@@ -1942,7 +1942,7 @@
19421942
# lib/scripts/test.sh
19431943
test_prepare_working_dir() {
19441944
if [ "${TINE20ROOT}" != "${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20" ]; then
1945-
log "test_preapre_wirking_dir is only requires the tine root to be: \${CI_BUILDS_DIR}/\${CI_PROJECT_NAMESPACE}/tine20"
1945+
log "test_preapre_working_dir requires the tine root to be: \${CI_BUILDS_DIR}/\${CI_PROJECT_NAMESPACE}/tine20"
19461946
# This function is only intended to work with the source from gitlab...
19471947
# intended: for the main repo => do basicly nothing. Or for customapps => clone main repo and include customapp
19481948
# and setup vars as if we where running in the main repo.
@@ -2117,29 +2117,20 @@
21172117
echo -e "\033[0;34m"$@"\033[0m"
21182118
}
21192119
2120-
echo -n 'wait for signal_files_ready ...'; while [ ! -f ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_files_ready ]; do sleep 1; done; echo ' done'
2120+
#!/bin/bash
2121+
echo -n 'wait for signal_mount_ready ...'; while [ ! -f ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_mount_ready ]; do sleep 1; done; echo ' done'
21212122
2122-
cp -r /usr/share/tine20/Tinebase/js/node_modules $TINE20ROOT/Tinebase/js/node_modules
2123-
cp -r /usr/share/tine20/vendor $TINE20ROOT/tine20/vendor
2124-
2125-
# delete potentially old code, to make sure it can not be used
2126-
if test "${TINE20ROOT}" != "/usr/share/tine20"; then rm -rf /usr/share/tine20; fi
2127-
2128-
touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_node_modules_copied
2129-
2130-
# install php deps
2131-
cd $TINE20ROOT/tine20
2132-
composer install --no-ansi --no-progress --no-suggest --no-scripts --ignore-platform-reqs
2133-
$TINE20ROOT/ci/scripts/install_custom_app.sh
2123+
test_prepare_working_dir
2124+
touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_files_ready
21342125
2126+
test_composer_install
21352127
touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_php_deps_installed
21362128
2137-
# install js deps
2138-
npm --prefix $TINE20ROOT/tine20/Tinebase/js/ install;
2129+
test_npm_install
21392130
touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_js_deps_installed
21402131
2141-
# setup configs
2142-
/usr/sbin/confd -onetime -backend env;
2132+
rm /etc/confd/conf.d/worker.inc.php.toml || true # todo: is it needed? can it be moved to test_prepare_config
2133+
test_prepare_global_configs
21432134
21442135
# setup database
21452136
if ! tine20_await_db; then
@@ -2148,20 +2139,11 @@
21482139
exit 1
21492140
fi
21502141
2151-
mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS dovecot";
2152-
mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS postfix";
2153-
mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE USER IF NOT EXISTS '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD';";
2154-
mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"GRANT ALL PRIVILEGES ON postfix.* TO '$MYSQL_USER'@'%'";
2155-
mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"GRANT ALL PRIVILEGES ON dovecot.* TO '$MYSQL_USER'@'%'";
2156-
mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" "dovecot" < /config/sql/dovecot_tables.sql;
2157-
mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" "postfix" < /config/sql/postfix_tables.sql;
2142+
test_prepare_mail_db
21582143
21592144
# setup tine enviroment
21602145
touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAMESPACE}/tine20.log
21612146
chown tine20:tine20 ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAMESPACE}/tine20.log
2162-
rm /etc/supervisor.d/worker.ini || true # todo delete when merged with "speared node container" change
2163-
rm /etc/crontabs/tine20 || true
2164-
rm /etc/confd/conf.d/worker.inc.php.toml || true
21652147
21662148
echo -n 'wait for signal_js_deps_installed ...'; while [ ! -f ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_js_deps_installed ]; do sleep 1; done; echo ' done'
21672149

ci/gitlab-ci/lib/entry_points/tine_as_a_service.sh

+9-27
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
1-
echo -n 'wait for signal_files_ready ...'; while [ ! -f ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_files_ready ]; do sleep 1; done; echo ' done'
1+
#!/bin/bash
2+
echo -n 'wait for signal_mount_ready ...'; while [ ! -f ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_mount_ready ]; do sleep 1; done; echo ' done'
23

3-
cp -r /usr/share/tine20/Tinebase/js/node_modules $TINE20ROOT/Tinebase/js/node_modules
4-
cp -r /usr/share/tine20/vendor $TINE20ROOT/tine20/vendor
5-
6-
# delete potentially old code, to make sure it can not be used
7-
if test "${TINE20ROOT}" != "/usr/share/tine20"; then rm -rf /usr/share/tine20; fi
8-
9-
touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_node_modules_copied
10-
11-
# install php deps
12-
cd $TINE20ROOT/tine20
13-
composer install --no-ansi --no-progress --no-suggest --no-scripts --ignore-platform-reqs
14-
$TINE20ROOT/ci/scripts/install_custom_app.sh
4+
test_prepare_working_dir
5+
touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_files_ready
156

7+
test_composer_install
168
touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_php_deps_installed
179

18-
# install js deps
19-
npm --prefix $TINE20ROOT/tine20/Tinebase/js/ install;
10+
test_npm_install
2011
touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_js_deps_installed
2112

22-
# setup configs
23-
/usr/sbin/confd -onetime -backend env;
13+
rm /etc/confd/conf.d/worker.inc.php.toml || true # todo: is it needed? can it be moved to test_prepare_config
14+
test_prepare_global_configs
2415

2516
# setup database
2617
if ! tine20_await_db; then
@@ -29,20 +20,11 @@ if ! tine20_await_db; then
2920
exit 1
3021
fi
3122

32-
mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS dovecot";
33-
mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS postfix";
34-
mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"CREATE USER IF NOT EXISTS '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD';";
35-
mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"GRANT ALL PRIVILEGES ON postfix.* TO '$MYSQL_USER'@'%'";
36-
mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" -e"GRANT ALL PRIVILEGES ON dovecot.* TO '$MYSQL_USER'@'%'";
37-
mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" "dovecot" < /config/sql/dovecot_tables.sql;
38-
mysql -h$MAIL_DB_HOST -uroot -p"$MYSQL_ROOT_PASSWORD" "postfix" < /config/sql/postfix_tables.sql;
23+
test_prepare_mail_db
3924

4025
# setup tine enviroment
4126
touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAMESPACE}/tine20.log
4227
chown tine20:tine20 ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAMESPACE}/tine20.log
43-
rm /etc/supervisor.d/worker.ini || true # todo delete when merged with "speared node container" change
44-
rm /etc/crontabs/tine20 || true
45-
rm /etc/confd/conf.d/worker.inc.php.toml || true
4628

4729
echo -n 'wait for signal_js_deps_installed ...'; while [ ! -f ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_js_deps_installed ]; do sleep 1; done; echo ' done'
4830

ci/gitlab-ci/lib/scripts/test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
test_prepare_working_dir() {
22
if [ "${TINE20ROOT}" != "${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20" ]; then
3-
log "test_preapre_wirking_dir is only requires the tine root to be: \${CI_BUILDS_DIR}/\${CI_PROJECT_NAMESPACE}/tine20"
3+
log "test_preapre_working_dir requires the tine root to be: \${CI_BUILDS_DIR}/\${CI_PROJECT_NAMESPACE}/tine20"
44
# This function is only intended to work with the source from gitlab...
55
# intended: for the main repo => do basicly nothing. Or for customapps => clone main repo and include customapp
66
# and setup vars as if we where running in the main repo.

ci/gitlab-ci/test_js_jobs.yml

+4-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
.js-e2e-tests-source:
22
extends: .abstract_jobs.test
33
stage: test
4-
needs:
5-
- docker_build_source
4+
needs: []
65
variables:
76
KUBERNETES_CPU_REQUEST: $ABSTRACT_JOBS_E2E_TEST_KUBERNETES_CPU_REQUEST
87
KUBERNETES_CPU_LIMIT: $ABSTRACT_JOBS_E2E_TEST_KUBERNETES_CPU_LIMIT
@@ -19,25 +18,21 @@
1918
TEST_DOCKER: "true"
2019
TEST_BROWSER_LANGUAGE: en
2120
TINE20_INSTALL_LANG: de
22-
ARG_COPY_SOURCE: "true"
23-
ARG_IMAGE: test-source
2421
TINE20ROOT: ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20
2522
WAIT_FOR_DB_TIMEOUT: '120'
2623
services:
2724
- !reference [.lib-services, db_service]
2825
- !reference [.lib-services, redis_service]
2926
- !reference [.lib-services, mail_service]
30-
- name: ${REGISTRY}/${ARG_IMAGE}-commit:${IMAGE_TAG}
27+
- name: ${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/tine20/test:${BASE_MAJOR_COMMIT_REF_NAME}-${PHP_VERSION}
3128
alias: tine
3229
entrypoint:
3330
!reference [.lib, entry_points, tine_as_a_service]
3431
image:
3532
name: dockerregistry.metaways.net/tine20/tine20/puppeteer:1.0.4
3633
before_script:
37-
# clone tine repo if test is run for a custom app. the tine repo will in any case be under $TINE20ROOT
38-
- if test "${CI_PROJECT_NAME}" != "tine20"; then git clone -b $TINE20_BRANCH --single-branch --depth 1 $TINE20_REPO_URL $TINE20ROOT; fi
39-
- cd $TINE20ROOT; git submodule init; git submodule update
40-
- touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_files_ready
34+
- touch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_mount_ready
35+
- echo -n 'wait for signal_files_ready ...'; while [ ! -f ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_files_ready ]; do sleep 1; done; echo ' done'
4136
# install e2e test dependencies
4237
- npm --prefix $TINE20ROOT/tests/e2etests/ install
4338
# wait for service to become ready
@@ -46,7 +41,6 @@
4641
- if [ -f ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_wait_for_database_failed ]; then echo "waiting for database failed"; exit 1; fi
4742
- if [ -f ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/signal_demo_data_install_failed ]; then echo "demo data install failed"; exit 1; fi
4843
script:
49-
- env
5044
- |
5145
if [ "${TINE20_BUILDTYPE}" == "DEVELOPMENT" ]; then
5246
export TEST_URL=http://tine:10443;
@@ -111,12 +105,6 @@ js-e2e-tests-source-save-screenshots:
111105
- !reference [.js-e2e-tests-source, rules]
112106
js-e2e-tests-source-php-version-matrix:
113107
extends: .js-e2e-tests-source
114-
variables:
115-
IMAGE_TAG: ${CI_PIPELINE_ID}-${PHP_VERSION}
116-
needs:
117-
- 'docker_build_source_matrix: [7.4]'
118-
- 'docker_build_source_matrix: [8.0]'
119-
- 'docker_build_source_matrix: [8.1]'
120108
parallel:
121109
matrix:
122110
- PHP_VERSION:

0 commit comments

Comments
 (0)