Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing integration tests #11246

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ jobs:
cat $PORTAL_SOURCE_DIR/src/main/resources/application.properties | \
sed 's|spring.datasource.mysql.url=.*|spring.datasource.mysql.url=jdbc:mysql://cbioportal-database:3306/cbioportal?useSSL=false|' | \
sed 's|spring.datasource.mysql.username=.*|spring.datasource.mysql.username=cbio_user|' | \
sed 's|spring.datasource.mysql.password=.*|spring.datasource.mysql.password=somepassword|' \
sed 's|spring.datasource.mysql.password=.*|spring.datasource.mysql.password=somepassword|' | \
sed 'a spring.datasource.driver-class-name=com.mysql.jdbc.Driver' | \
sed 'a spring.datasource.url=jdbc:mysql://cbioportal-database:3306/cbioportal?useSSL=false' | \
sed 'a spring.datasource.username=cbio_user' | \
sed 'a spring.datasource.password=somepassword' \
Comment on lines +48 to +51
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a workaround to add legacy properties which are needed by migrate.py script. This is required for now because migration script is in the separate cbioportal-core repo.

> application.properties
- name: 'Copy cgds.sql file into Docker Compose'
run: cp ./cbioportal/src/main/resources/db-scripts/cgds.sql ./cbioportal-docker-compose/data/.
Expand Down
12 changes: 6 additions & 6 deletions docker/web-and-data/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ parse_db_params_from_config_and_command_line() {
else
PROPERTIES_FILE=$BAKED_IN_WAR_CONFIG_FILE
fi
for param in db.host spring.datasource.username db.portal_db_name spring.datasource.password spring.datasource.url; do
for param in db.host spring.datasource.mysql.username db.portal_db_name spring.datasource.mysql.password spring.datasource.mysql.url; do
if $(parse_db_params_from_command_line $@ | grep -q $param); then
prop=$(parse_db_params_from_command_line $@ | grep "^$param" || [[ $? == 1 ]])
else
Expand All @@ -37,7 +37,7 @@ parse_db_params_from_config_and_command_line() {
after_equal_sign="${prop#*=}"
updated_before_equal_sign="${before_equal_sign//./_}"
prop="${updated_before_equal_sign}=${after_equal_sign}"
if [[ $param == spring.datasource.url ]]
if [[ $param == spring.datasource.mysql.url ]]
then
# Remove the parameters (?...) from the connection URL.
echo $(sed -r "s/^([^=]+)=([^\?]+).*/\1=\2/" <<< $prop)
Expand Down Expand Up @@ -79,9 +79,9 @@ check_db_connection() {
eval "$(parse_connection_string $db_connection_string)"
fi

if [[ -n $spring_datasource_url ]]
if [[ -n $spring_datasource_mysql_url ]]
then
eval "$(parse_connection_string $spring_datasource_url)"
eval "$(parse_connection_string $spring_datasource_mysql_url)"
fi

if [ -z ${db_port+x} ] # is $db_port unset?
Expand All @@ -93,11 +93,11 @@ check_db_connection() {
fi
fi

while ! mysqladmin ping -s -h$(echo ${db_host} | cut -d: -f1) -P${db_port} -u${spring_datasource_username} -p${spring_datasource_password};
while ! mysqladmin ping -s -h$(echo ${db_host} | cut -d: -f1) -P${db_port} -u${spring_datasource_mysql_username} -p${spring_datasource_mysql_password};
do
sleep 5s;
if [ -n "$SHOW_DEBUG_INFO" ] && [ "$SHOW_DEBUG_INFO" != "false" ]; then
echo mysqladmin ping -s -h$(echo ${db_host} | cut -d: -f1) -P${db_port} -u${spring_datasource_username} -p${spring_datasource_password}
echo mysqladmin ping -s -h$(echo ${db_host} | cut -d: -f1) -P${db_port} -u${spring_datasource_mysql_username} -p${spring_datasource_mysql_password}
fi
echo "Database not available yet (first time can take a few minutes to load seed database)... Attempting reconnect..."
done
Expand Down
Loading