From e7f3e0a617b80f6908bee3f757c565373e0f7f4d Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 29 Jul 2023 23:16:35 +0100 Subject: [PATCH 1/8] Removes symbolic links as part of the clean up --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 74a6f7a1..2356cbdf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,7 +59,8 @@ RUN eval.sh install_mt $MT_VER && \ # Clean up. RUN eval.sh clean_bt && \ eval.sh clean_ea && \ - eval.sh clean_files + eval.sh clean_files && \ + find . -type l -print -delete # Install MT5 platform. FROM ea-tester-base AS ea-tester-with-mt5 From 425f08081fb5cb05becddb8d1a12004189b9178e Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 29 Jul 2023 23:53:23 +0100 Subject: [PATCH 2/8] Removes files in /tmp --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2356cbdf..4c2f14fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,7 +60,8 @@ RUN eval.sh install_mt $MT_VER && \ RUN eval.sh clean_bt && \ eval.sh clean_ea && \ eval.sh clean_files && \ - find . -type l -print -delete + find . -type l -print -delete && \ + find /tmp -mindepth 1 -print -delete # Install MT5 platform. FROM ea-tester-base AS ea-tester-with-mt5 From be2baab777e4943bfa1e065b3e1b84786be4e4bb Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 30 Jul 2023 00:01:18 +0100 Subject: [PATCH 3/8] Update Wine to devel --- scripts/provision.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/provision.sh b/scripts/provision.sh index da8c9b80..91f0ddcd 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -124,7 +124,7 @@ case "$(uname -s)" in curl -L chls.pro/ssl > /usr/local/share/ca-certificates/charles.crt && update-ca-certificates # Adds GPG release key. apt-key add < <(curl -S https://www.charlesproxy.com/packages/apt/PublicKey) - # Adds APT Wine repository. + # Adds APT repository. add-apt-repository -y "deb https://www.charlesproxy.com/packages/apt/ charles-proxy main" # Install HTTPS transport driver. apt-get install -qq apt-transport-https @@ -146,7 +146,7 @@ case "$(uname -s)" in # Install wine and dependencies. # @see: https://wiki.winehq.org/Ubuntu - apt-get install -qq winehq-staging # Install Wine. + apt-get install -qq winehq-devel # Install Wine. apt-get install -qq wine-gecko winbind || true # Install Wine recommended libraries. apt-get install -qq xvfb xdotool x11-utils xterm # Virtual frame buffer and X11 utils. From b755e6f590756eff2d4b6b6120b45c1241d11941 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 30 Jul 2023 00:12:26 +0100 Subject: [PATCH 4/8] provision: Allows to provision when ubuntu home dir exists --- scripts/provision.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/provision.sh b/scripts/provision.sh index 91f0ddcd..5b7caca6 100755 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -7,7 +7,7 @@ # Initialize script. (("$OPT_NOERR")) || set -e (("$OPT_TRACE")) && set -x -if [ -z "$CI" -a ! -d /vagrant -a ! -d /home/travis -a ! -f /.dockerenv ]; then +if [ -z "$CI" -a ! -d /vagrant -a ! -d /home/ubuntu -a ! -d /home/travis -a ! -f /.dockerenv ]; then echo "Error: This script needs to be run within container." >&2 exit 1 elif [ -f ~/.provisioned -a -z "$OPT_FORCE" ]; then From ee6b90db743a2016f216332ab668940e7eb1236c Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 30 Jul 2023 00:35:39 +0100 Subject: [PATCH 5/8] Do not search files through hidden directories --- Dockerfile | 1 - scripts/.funcs.cmds.inc.sh | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4c2f14fc..60e82e0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,7 +60,6 @@ RUN eval.sh install_mt $MT_VER && \ RUN eval.sh clean_bt && \ eval.sh clean_ea && \ eval.sh clean_files && \ - find . -type l -print -delete && \ find /tmp -mindepth 1 -print -delete # Install MT5 platform. diff --git a/scripts/.funcs.cmds.inc.sh b/scripts/.funcs.cmds.inc.sh index 8cc81429..6f3104bd 100644 --- a/scripts/.funcs.cmds.inc.sh +++ b/scripts/.funcs.cmds.inc.sh @@ -557,10 +557,10 @@ ea_find() echo "$file" return } - result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f '(' -iname "$file" -o -iname "${file%.*}.mq${mt_ver}" ')' -print -quit) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f '(' -iname "$file" -o -name "${file%.*}.ex${mt_ver}" ')' -print -quit) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -iname "*${file%.*}*.mq${mt_ver}" -print -quit) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -iname "*${file%.*}*.ex${mt_ver}" -print -quit) + result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a '(' -iname "$file" -o -iname "${file%.*}.mq${mt_ver}" ')' -print -quit) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a '(' -iname "$file" -o -name "${file%.*}.ex${mt_ver}" ')' -print -quit) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a -iname "*${file%.*}*.mq${mt_ver}" -print -quit) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a -iname "*${file%.*}*.ex${mt_ver}" -print -quit) echo ${result#./} cd - &> /dev/null } @@ -586,10 +586,10 @@ script_find() echo "$file" return } - result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f '(' -iname "$file" -o -iname "${file%.*}.mq${mt_ver}" ')' -print -quit) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f '(' -iname "$file" -o -name "${file%.*}.ex${mt_ver}" ')' -print -quit) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -iname "*${file%.*}*.mq${mt_ver}" -print -quit) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -iname "*${file%.*}*.ex${mt_ver}" -print -quit) + result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a '(' -iname "$file" -o -iname "${file%.*}.mq${mt_ver}" ')' -print -quit) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a '(' -iname "$file" -o -name "${file%.*}.ex${mt_ver}" ')' -print -quit) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a -iname "*${file%.*}*.mq${mt_ver}" -print -quit) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a -iname "*${file%.*}*.ex${mt_ver}" -print -quit) echo ${result#./} cd - &> /dev/null } From fd12ea9f74426acf3d9cba5769405ec7c1034199 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 30 Jul 2023 01:20:29 +0100 Subject: [PATCH 6/8] Another approach to ignore 'File system loop detected' errors --- scripts/.funcs.cmds.inc.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/.funcs.cmds.inc.sh b/scripts/.funcs.cmds.inc.sh index 6f3104bd..1d311c1b 100644 --- a/scripts/.funcs.cmds.inc.sh +++ b/scripts/.funcs.cmds.inc.sh @@ -557,10 +557,10 @@ ea_find() echo "$file" return } - result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a '(' -iname "$file" -o -iname "${file%.*}.mq${mt_ver}" ')' -print -quit) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a '(' -iname "$file" -o -name "${file%.*}.ex${mt_ver}" ')' -print -quit) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a -iname "*${file%.*}*.mq${mt_ver}" -print -quit) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a -iname "*${file%.*}*.ex${mt_ver}" -print -quit) + result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f '(' -iname "$file" -o -iname "${file%.*}.mq${mt_ver}" ')' -print -quit 2> >(grep -v "File system loop detected")) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f '(' -iname "$file" -o -name "${file%.*}.ex${mt_ver}" ')' -print -quit 2> >(grep -v "File system loop detected")) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -iname "*${file%.*}*.mq${mt_ver}" -print -quit 2> >(grep -v "File system loop detected")) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -iname "*${file%.*}*.ex${mt_ver}" -print -quit 2> >(grep -v "File system loop detected")) echo ${result#./} cd - &> /dev/null } @@ -586,10 +586,10 @@ script_find() echo "$file" return } - result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a '(' -iname "$file" -o -iname "${file%.*}.mq${mt_ver}" ')' -print -quit) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a '(' -iname "$file" -o -name "${file%.*}.ex${mt_ver}" ')' -print -quit) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a -iname "*${file%.*}*.mq${mt_ver}" -print -quit) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -not -path '*/.*' -a -iname "*${file%.*}*.ex${mt_ver}" -print -quit) + result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f '(' -iname "$file" -o -iname "${file%.*}.mq${mt_ver}" ')' -print -quit 2> >(grep -v "File system loop detected")) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f '(' -iname "$file" -o -name "${file%.*}.ex${mt_ver}" ')' -print -quit 2> >(grep -v "File system loop detected")) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -iname "*${file%.*}*.mq${mt_ver}" -print -quit 2> >(grep -v "File system loop detected")) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -iname "*${file%.*}*.ex${mt_ver}" -print -quit 2> >(grep -v "File system loop detected")) echo ${result#./} cd - &> /dev/null } From 4b6ae97aa16041947bb3cf190479b0a03efef62d Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 30 Jul 2023 01:48:37 +0100 Subject: [PATCH 7/8] Sets OPT_TRACE on runner.debug --- .github/workflows/docker.yml | 3 +++ .github/workflows/tests-shell.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 92f69386..030b6fde 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -81,6 +81,9 @@ jobs: runs-on: ubuntu-latest needs: Docker container: + env: + OPT_TRACE: ${{ runner.debug }} + OPT_VERBOSE: true image: ea31337/ea-tester:dev volumes: - ${{ github.workspace }}/scripts/tests:/opt/scripts diff --git a/.github/workflows/tests-shell.yml b/.github/workflows/tests-shell.yml index 6e5e26af..6ea402f8 100644 --- a/.github/workflows/tests-shell.yml +++ b/.github/workflows/tests-shell.yml @@ -20,6 +20,9 @@ jobs: working-directory: scripts/tests runs-on: ubuntu-latest container: + env: + OPT_TRACE: ${{ runner.debug }} + OPT_VERBOSE: true image: ea31337/ea-tester:dev strategy: matrix: From 1f1b2b4ef3575fa8b89b8bd39b9457ad36722044 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 30 Jul 2023 01:59:19 +0100 Subject: [PATCH 8/8] find_ea/find_script: Improves command for find --- scripts/.funcs.cmds.inc.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/.funcs.cmds.inc.sh b/scripts/.funcs.cmds.inc.sh index 1d311c1b..52c00f10 100644 --- a/scripts/.funcs.cmds.inc.sh +++ b/scripts/.funcs.cmds.inc.sh @@ -557,10 +557,10 @@ ea_find() echo "$file" return } - result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f '(' -iname "$file" -o -iname "${file%.*}.mq${mt_ver}" ')' -print -quit 2> >(grep -v "File system loop detected")) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f '(' -iname "$file" -o -name "${file%.*}.ex${mt_ver}" ')' -print -quit 2> >(grep -v "File system loop detected")) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -iname "*${file%.*}*.mq${mt_ver}" -print -quit 2> >(grep -v "File system loop detected")) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -iname "*${file%.*}*.ex${mt_ver}" -print -quit 2> >(grep -v "File system loop detected")) + result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 4 -type f '(' -iname "$file" -o -iname "${file%.*}.mq${mt_ver}" ')' -print -quit) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 4 -type f '(' -iname "$file" -o -name "${file%.*}.ex${mt_ver}" ')' -print -quit) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" -maxdepth 5 -type f -iname "*${file%.*}*.mq${mt_ver}" -print -quit) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" -maxdepth 5 -type f -iname "*${file%.*}*.ex${mt_ver}" -print -quit) echo ${result#./} cd - &> /dev/null } @@ -586,10 +586,10 @@ script_find() echo "$file" return } - result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f '(' -iname "$file" -o -iname "${file%.*}.mq${mt_ver}" ')' -print -quit 2> >(grep -v "File system loop detected")) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f '(' -iname "$file" -o -name "${file%.*}.ex${mt_ver}" ')' -print -quit 2> >(grep -v "File system loop detected")) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -iname "*${file%.*}*.mq${mt_ver}" -print -quit 2> >(grep -v "File system loop detected")) - [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 5 -type f -iname "*${file%.*}*.ex${mt_ver}" -print -quit 2> >(grep -v "File system loop detected")) + result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 4 -type f '(' -iname "$file" -o -iname "${file%.*}.mq${mt_ver}" ')' -print -quit) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" ~ -maxdepth 4 -type f '(' -iname "$file" -o -name "${file%.*}.ex${mt_ver}" ')' -print -quit) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" -maxdepth 5 -type f -iname "*${file%.*}*.mq${mt_ver}" -print) + [ -z "$result" ] && result=$(find -L . "$WORKDIR" "$ROOT" -maxdepth 5 -type f -iname "*${file%.*}*.ex${mt_ver}" -print) echo ${result#./} cd - &> /dev/null }