From 49946f74f74828be4c23ebcdeaab2764d4cdd921 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Fri, 24 Nov 2023 19:26:11 +0100 Subject: [PATCH] Updated tests - Moved node, ruby, and python test cases into "misc tools" test - Re-enabled terminus test - Cleaned up Dockerfiles from legacy code --- 8.1/Dockerfile | 82 ++----------------------------------------------- 8.2/Dockerfile | 82 ++----------------------------------------------- tests/test.bats | 78 +++++----------------------------------------- 3 files changed, 12 insertions(+), 230 deletions(-) diff --git a/8.1/Dockerfile b/8.1/Dockerfile index 8d606252..f2fe86f2 100644 --- a/8.1/Dockerfile +++ b/8.1/Dockerfile @@ -188,7 +188,7 @@ RUN set -xe; \ imagick \ memcached \ redis \ - ssh2-beta \ + ssh2 \ xdebug \ xhprof \ ;\ @@ -211,7 +211,7 @@ RUN set -xe; \ # Repo for msodbcsql18 (MS ODBC driver), required by pecl/sqlsrv and pecl/pdo_sqlsrv curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add -; \ # TODO: Using Ubuntu 22.04 packages as a temporary fix (until addressed upstream in MS repos). - #curl -fsSL https://packages.microsoft.com/config/debian/11/prod.list -o /etc/apt/sources.list.d/mssql.list; \ + #curl -fsSL https://packages.microsoft.com/config/debian/12/prod.list -o /etc/apt/sources.list.d/mssql.list; \ curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/prod.list -o /etc/apt/sources.list.d/mssql.list; \ \ buildDeps=" \ @@ -340,52 +340,6 @@ RUN set -e; \ export YARN_PROFILE="$HOME/.profile"; \ curl -fsSL https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION} >/dev/null -## Ruby (installed as user) via rvm -## Note: Disabled. rvm + its build dependecies bloat the image (~80MB) -## Debian 11 ships with Ruby 2.7, so we'll stick with that by default. -## It is still possible for the end user to switch to a different Ruby version via rvm. -#ENV \ -# RVM_VERSION_INSTALL=1.29.10 \ -# RUBY_VERSION_INSTALL=2.7.2 -## Don't use -x here, as the output may be excessive -#RUN set -e; \ -# # Export ruby gem bin path -# echo 'export PATH=$PATH:$(ruby -r rubygems -e "puts Gem.user_dir")/bin' >> $HOME/.profile; \ -# . $HOME/.profile; \ -# # Public GPG servers are not realiable, so downloading keys from rvm.io instead. -# #gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB -# # Import and trust rvm keys -# # mpapis@gmail.com -# curl -sSL https://rvm.io/mpapis.asc | gpg --batch --import -; \ -# echo 409B6B1796C275462A1703113804BB82D39DC0E3:6: | gpg --batch --import-ownertrust; \ -# # piotr.kuczynski@gmail.com -# curl -sSL https://rvm.io/pkuczynski.asc | gpg --batch --import -; \ -# echo 7D2BAF1CF37B13E2069D6956105BD0E739499BDB:6: | gpg --batch --import-ownertrust; \ -# \ -# echo 'rvm_autoupdate_flag=0' >> $HOME/.rvmrc; \ -# echo 'rvm_silence_path_mismatch_check_flag=1' >> $HOME/.rvmrc; \ -# curl -fsSL https://raw.githubusercontent.com/rvm/rvm/${RVM_VERSION_INSTALL}/binscripts/rvm-installer | bash -s -- --ignore-dotfiles --version ${RVM_VERSION_INSTALL}; \ -# { \ -# echo ''; \ -# echo 'export PATH="$PATH:$HOME/.rvm/bin"'; \ -# echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"'; \ -# } >> $HOME/.profile; \ -# # Reload $HOME/.profile to apply settings for the current shell -# . $HOME/.profile; \ -# \ -# # rvm.io does not currently have ruby binaries for Debian 9, so Ruby is compiled from source, which requires a bunch -# # of extra dependencies installed (rvm installs these automatically), which bloat this image: -# # rvm/ruby required packages: gawk, automake, bison, libffi-dev, libgdbm-dev, libncurses5-dev, libsqlite3-dev, libtool, libyaml-dev, sqlite3, zlib1g-dev, libgmp-dev, libreadline-dev, libssl-dev -# rvm install ruby-${RUBY_VERSION_INSTALL}; \ -# rvm use ruby-${RUBY_VERSION_INSTALL} --default; \ -# \ -# gem install --user-install bundler; \ -# # Have bundler install gems locally (./.bundle) by default -# echo -e "\n"'export BUNDLE_PATH=.bundle' >> $HOME/.profile; \ -# \ -# rvm cleanup all; \ -# rvm gemset globalcache enable - ## Ruby bundler ## Don't use -x here, as the output may be excessive RUN set -e; \ @@ -396,38 +350,6 @@ RUN set -e; \ # Have bundler install gems in the current directory (./.bundle) by default echo -e "\n"'export BUNDLE_PATH=.bundle' >> $HOME/.profile -# Python (installed as user) via pyenv -# Note: Disabled. pyenv + its build dependecies bloat the image (~300MB). -# Debian 10 ships with Python 3.7, so we'll stick with that by default. -# It is still possible for the end user to switch to a different python version via pyenv. -#ENV \ -# PYENV_VERSION_INSTALL=1.2.21 \ -# PYTHON_VERSION_INSTALL=3.8.3 -#RUN set -xe; \ -# # pyenv requires a bunch of build dependencies installed, which would bloat this image -# # See https://github.com/pyenv/pyenv/wiki/Common-build-problems#prerequisites -# sudo apt-get update >/dev/null; \ -# sudo apt-get -y --no-install-recommends install >/dev/null \ -# build-essential libssl-dev zlib1g-dev libbz2-dev \ -# libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ -# xz-utils tk-dev libffi-dev liblzma-dev python-openssl git \ -# ;\ -# # Cleanup -# sudo apt-get clean; sudo rm -rf /var/lib/apt/lists/*; \ -# \ -# git clone --depth 1 -b v${PYENV_VERSION_INSTALL} https://github.com/pyenv/pyenv.git $HOME/.pyenv; \ -# rm -rf $HOME/.pyenv/.git; \ -# { \ -# echo ''; \ -# echo 'export PYENV_ROOT="$HOME/.pyenv"'; \ -# echo 'export PATH="$PYENV_ROOT/bin:$PATH"'; \ -# echo 'eval "$(pyenv init -)"'; \ -# } >> $HOME/.profile; \ -# # Reload $HOME/.profile to apply settings for the current shell -# . $HOME/.profile; \ -# pyenv install ${PYTHON_VERSION_INSTALL}; \ -# pyenv global ${PYTHON_VERSION_INSTALL} - # Notify web container about started fin exec RUN echo '(/opt/ping-web.sh &)' >> $HOME/.profile diff --git a/8.2/Dockerfile b/8.2/Dockerfile index 9f287e31..64929680 100644 --- a/8.2/Dockerfile +++ b/8.2/Dockerfile @@ -188,7 +188,7 @@ RUN set -xe; \ imagick \ memcached \ redis \ - ssh2-beta \ + ssh2 \ xdebug \ xhprof \ ;\ @@ -211,7 +211,7 @@ RUN set -xe; \ # Repo for msodbcsql18 (MS ODBC driver), required by pecl/sqlsrv and pecl/pdo_sqlsrv curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add -; \ # TODO: Using Ubuntu 22.04 packages as a temporary fix (until addressed upstream in MS repos). - #curl -fsSL https://packages.microsoft.com/config/debian/11/prod.list -o /etc/apt/sources.list.d/mssql.list; \ + #curl -fsSL https://packages.microsoft.com/config/debian/12/prod.list -o /etc/apt/sources.list.d/mssql.list; \ curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/prod.list -o /etc/apt/sources.list.d/mssql.list; \ \ buildDeps=" \ @@ -340,52 +340,6 @@ RUN set -e; \ export YARN_PROFILE="$HOME/.profile"; \ curl -fsSL https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION} >/dev/null -## Ruby (installed as user) via rvm -## Note: Disabled. rvm + its build dependecies bloat the image (~80MB) -## Debian 11 ships with Ruby 2.7, so we'll stick with that by default. -## It is still possible for the end user to switch to a different Ruby version via rvm. -#ENV \ -# RVM_VERSION_INSTALL=1.29.10 \ -# RUBY_VERSION_INSTALL=2.7.2 -## Don't use -x here, as the output may be excessive -#RUN set -e; \ -# # Export ruby gem bin path -# echo 'export PATH=$PATH:$(ruby -r rubygems -e "puts Gem.user_dir")/bin' >> $HOME/.profile; \ -# . $HOME/.profile; \ -# # Public GPG servers are not realiable, so downloading keys from rvm.io instead. -# #gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB -# # Import and trust rvm keys -# # mpapis@gmail.com -# curl -sSL https://rvm.io/mpapis.asc | gpg --batch --import -; \ -# echo 409B6B1796C275462A1703113804BB82D39DC0E3:6: | gpg --batch --import-ownertrust; \ -# # piotr.kuczynski@gmail.com -# curl -sSL https://rvm.io/pkuczynski.asc | gpg --batch --import -; \ -# echo 7D2BAF1CF37B13E2069D6956105BD0E739499BDB:6: | gpg --batch --import-ownertrust; \ -# \ -# echo 'rvm_autoupdate_flag=0' >> $HOME/.rvmrc; \ -# echo 'rvm_silence_path_mismatch_check_flag=1' >> $HOME/.rvmrc; \ -# curl -fsSL https://raw.githubusercontent.com/rvm/rvm/${RVM_VERSION_INSTALL}/binscripts/rvm-installer | bash -s -- --ignore-dotfiles --version ${RVM_VERSION_INSTALL}; \ -# { \ -# echo ''; \ -# echo 'export PATH="$PATH:$HOME/.rvm/bin"'; \ -# echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"'; \ -# } >> $HOME/.profile; \ -# # Reload $HOME/.profile to apply settings for the current shell -# . $HOME/.profile; \ -# \ -# # rvm.io does not currently have ruby binaries for Debian 9, so Ruby is compiled from source, which requires a bunch -# # of extra dependencies installed (rvm installs these automatically), which bloat this image: -# # rvm/ruby required packages: gawk, automake, bison, libffi-dev, libgdbm-dev, libncurses5-dev, libsqlite3-dev, libtool, libyaml-dev, sqlite3, zlib1g-dev, libgmp-dev, libreadline-dev, libssl-dev -# rvm install ruby-${RUBY_VERSION_INSTALL}; \ -# rvm use ruby-${RUBY_VERSION_INSTALL} --default; \ -# \ -# gem install --user-install bundler; \ -# # Have bundler install gems locally (./.bundle) by default -# echo -e "\n"'export BUNDLE_PATH=.bundle' >> $HOME/.profile; \ -# \ -# rvm cleanup all; \ -# rvm gemset globalcache enable - ## Ruby bundler ## Don't use -x here, as the output may be excessive RUN set -e; \ @@ -396,38 +350,6 @@ RUN set -e; \ # Have bundler install gems in the current directory (./.bundle) by default echo -e "\n"'export BUNDLE_PATH=.bundle' >> $HOME/.profile -# Python (installed as user) via pyenv -# Note: Disabled. pyenv + its build dependecies bloat the image (~300MB). -# Debian 10 ships with Python 3.7, so we'll stick with that by default. -# It is still possible for the end user to switch to a different python version via pyenv. -#ENV \ -# PYENV_VERSION_INSTALL=1.2.21 \ -# PYTHON_VERSION_INSTALL=3.8.3 -#RUN set -xe; \ -# # pyenv requires a bunch of build dependencies installed, which would bloat this image -# # See https://github.com/pyenv/pyenv/wiki/Common-build-problems#prerequisites -# sudo apt-get update >/dev/null; \ -# sudo apt-get -y --no-install-recommends install >/dev/null \ -# build-essential libssl-dev zlib1g-dev libbz2-dev \ -# libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ -# xz-utils tk-dev libffi-dev liblzma-dev python-openssl git \ -# ;\ -# # Cleanup -# sudo apt-get clean; sudo rm -rf /var/lib/apt/lists/*; \ -# \ -# git clone --depth 1 -b v${PYENV_VERSION_INSTALL} https://github.com/pyenv/pyenv.git $HOME/.pyenv; \ -# rm -rf $HOME/.pyenv/.git; \ -# { \ -# echo ''; \ -# echo 'export PYENV_ROOT="$HOME/.pyenv"'; \ -# echo 'export PATH="$PYENV_ROOT/bin:$PATH"'; \ -# echo 'eval "$(pyenv init -)"'; \ -# } >> $HOME/.profile; \ -# # Reload $HOME/.profile to apply settings for the current shell -# . $HOME/.profile; \ -# pyenv install ${PYTHON_VERSION_INSTALL}; \ -# pyenv global ${PYTHON_VERSION_INSTALL} - # Notify web container about started fin exec RUN echo '(/opt/ping-web.sh &)' >> $HOME/.profile diff --git a/tests/test.bats b/tests/test.bats index 0659e57e..4cfe3734 100755 --- a/tests/test.bats +++ b/tests/test.bats @@ -217,14 +217,9 @@ _healthcheck_wait () unset output # Check Terminus version - # Terminus v3 is not yet fully compatible with PHP 8.1 - # TODO: Re-enable tests for Terminus v3 on PHP 8.1 once stable. - # See: https://github.com/pantheon-systems/terminus/issues/2256 - if [[ "${VERSION}" != "8.1" ]]; then - run docker exec -u docker "$NAME" bash -lc 'set -x; terminus --version | grep "^Terminus ${TERMINUS_VERSION}$"' - [[ ${status} == 0 ]] - unset output - fi + run docker exec -u docker "$NAME" bash -lc 'set -x; terminus --version | grep "^Terminus ${TERMINUS_VERSION}$"' + [[ ${status} == 0 ]] + unset output # Check Platform CLI version run docker exec -u docker "$NAME" bash -lc 'set -x; platform --version | grep "Platform.sh CLI ${PLATFORMSH_CLI_VERSION}"' @@ -240,7 +235,7 @@ _healthcheck_wait () make clean } -@test "Check NodeJS tools and versions" { +@test "Check misc tools and versions" { [[ $SKIP == 1 ]] && skip ### Setup ### @@ -266,73 +261,16 @@ _healthcheck_wait () [[ ${status} == 0 ]] unset output - ### Cleanup ### - make clean -} - -@test "Check Ruby tools and versions" { - [[ $SKIP == 1 ]] && skip - - ### Setup ### - make start - - run _healthcheck_wait - unset output - - ### Tests ### - - # rvm - run docker exec -u docker "$NAME" bash -lc 'rvm --version 2>&1 | grep "${RVM_VERSION_INSTALL}"' - [[ ${status} == 0 ]] - unset output - - # ruby - #run docker exec -u docker "$NAME" bash -lc 'ruby --version | grep "${RUBY_VERSION_INSTALL}"' - # Default Ruby version in Debian 11 = 2.7.x - run docker exec -u docker "$NAME" bash -lc 'ruby --version | grep "ruby 2.7"' - [[ ${status} == 0 ]] - unset output - - ### Cleanup ### - make clean -} - -@test "Check Python tools and versions" { - [[ $SKIP == 1 ]] && skip - - ### Setup ### - make start - - run _healthcheck_wait - unset output - - ### Tests ### - - # pyenv - run docker exec -u docker "$NAME" bash -lc 'pyenv --version 2>&1 | grep "${PYENV_VERSION_INSTALL}"' + # Stock Ruby version in Debian 12 is 3.1.x + run docker exec -u docker "$NAME" bash -lc 'ruby --version | grep "ruby 3.1"' [[ ${status} == 0 ]] unset output - # pyenv - run docker exec -u docker "$NAME" bash -lc 'python --version 2>&1 | grep "${PYTHON_VERSION_INSTALL}"' + # Stock Python version in Debian 12 is 3.11.x + run docker exec -u docker "$NAME" bash -lc 'python3 --version 2>&1 | grep "Python 3.11"' [[ ${status} == 0 ]] unset output - ### Cleanup ### - make clean -} - -@test "Check misc tools and versions" { - [[ $SKIP == 1 ]] && skip - - ### Setup ### - make start - - run _healthcheck_wait - unset output - - ### Tests ### - # Check msmtp run docker exec -u docker "$NAME" which msmtp echo "$output" | grep "/usr/bin/msmtp"