From 6722c14397c3b44950baaac7484d4333b002d29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 30 Nov 2021 09:22:01 +0100 Subject: [PATCH 1/2] MOBILE-3833 lang: Add suffix param to get_languages --- scripts/lang_functions.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/lang_functions.sh b/scripts/lang_functions.sh index ef7de3a0f..6b5b4ece3 100755 --- a/scripts/lang_functions.sh +++ b/scripts/lang_functions.sh @@ -102,6 +102,15 @@ function get_language { pushd $LANGPACKSFOLDER > /dev/null curl -s $MOODLEORG_URL/$lastversion/$lang.zip --output $lang.zip > /dev/null + size=$(du -k "$lang.zip" | cut -f 1) + if [ ! -n $lang.zip ] || [ $size -le 60 ]; then + echo "Wrong language name or corrupt file for $lang" + rm $lang.zip + + popd > /dev/null + return + fi + rm -R $lang > /dev/null 2>&1> /dev/null unzip -o -u $lang.zip > /dev/null @@ -114,6 +123,8 @@ function get_language { # Entry function to get all language files. function get_languages { + suffix=$1 + get_last_version if [ -d $LANGPACKSFOLDER ]; then @@ -131,6 +142,7 @@ function get_languages { if [ $AWS_SERVICE -eq 1 ]; then get_all_languages_aws + suffix='' else echo "Fallback language list will only get current installation languages" get_installed_languages @@ -138,5 +150,9 @@ function get_languages { for lang in $langs; do get_language "$lang" + + if [ $suffix != '' ]; then + get_language "$lang$suffix" + fi done } From 8e86fbd924ae20286c957ed19b285805f001816f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 29 Nov 2021 13:02:45 +0100 Subject: [PATCH 2/2] MOBILE-3833 behat: Adapt performance tests --- tests/behat/performance.feature | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/behat/performance.feature b/tests/behat/performance.feature index 264e395af..f90a81ce9 100644 --- a/tests/behat/performance.feature +++ b/tests/behat/performance.feature @@ -56,7 +56,7 @@ Feature: Measure performance. And I set the field "Your site" to "$WWWROOT" in the app And I press "Connect to your site" in the app And I log in as "student1" - Then I should find "Course 1" in the app + And I should find "Timeline" in the app When I stop measuring "Login" Then "Login" should have taken less than 10 seconds @@ -69,16 +69,18 @@ Feature: Measure performance. And I set the field "Your site" to "$WWWROOT" in the app And I press "Connect to your site" in the app And I log in as "student1" - Then I should find "Course 1" in the app + Then I press "My courses" in the app + And I should find "Course 1" in the app When I reload the page And I start measuring "Open Activity" And I wait the app to restart Then I should find "Course 1" in the app - When I press "Course 1" in the app + When I enter the course "Course 1" in the app And I press "Choice course 1" in the app Then I should find "Option 1" in the app When I stop measuring "Open Activity" - Then "Open Activity" should have taken less than 7 seconds + # TODO Check back to 7s or review perfect timings + Then "Open Activity" should have taken less than 8 seconds