[macOS] Get rid of invoke_tests imports (#2496)

* get rid of invoke_tests imports

* add sudo

* change path to /usr/bin/invoke_tests

* create /usr/local/bin dir

* remove local variables

* fix group owner

* set default 775 perm

* delete invoke_tests symlink
This commit is contained in:
Aleksandr Chebotov
2021-01-22 09:26:28 +03:00
committed by GitHub
parent 8450762c10
commit caa7a1ac6d
36 changed files with 35 additions and 70 deletions

View File

@@ -23,4 +23,12 @@ sudo "/Library/Application Support/VMware Tools/vmware-resolutionSet" 1176 885
# sudo security delete-certificate -Z FF6797793A3CD798DC5B2ABEF56F73EDC9F83A64 /Library/Keychains/System.keychain # sudo security delete-certificate -Z FF6797793A3CD798DC5B2ABEF56F73EDC9F83A64 /Library/Keychains/System.keychain
curl https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer --output $HOME/AppleWWDRCAG3.cer --silent curl https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer --output $HOME/AppleWWDRCAG3.cer --silent
sudo security add-trusted-cert -d -r unspecified -k /Library/Keychains/System.keychain $HOME/AppleWWDRCAG3.cer sudo security add-trusted-cert -d -r unspecified -k /Library/Keychains/System.keychain $HOME/AppleWWDRCAG3.cer
rm $HOME/AppleWWDRCAG3.cer rm $HOME/AppleWWDRCAG3.cer
# Create symlink for tests running
if [ ! -d "/usr/local/bin" ];then
sudo mkdir -p -m 775 /usr/local/bin
sudo chown $USER:admin /usr/local/bin
fi
chmod +x $HOME/utils/invoke-tests.sh
sudo ln -s $HOME/utils/invoke-tests.sh /usr/local/bin/invoke_tests

View File

@@ -36,4 +36,7 @@ sudo rm -rf ~/utils ~/image-generation /tmp/*
# for now there is no way to get status of indexing process, it takes around 3 minutes to accomplish # for now there is no way to get status of indexing process, it takes around 3 minutes to accomplish
sudo mdutil -E / sudo mdutil -E /
sudo log stream | grep -q -E 'mds.*Released.*BackgroundTask' || true sudo log stream | grep -q -E 'mds.*Released.*BackgroundTask' || true
echo "Indexing completed" echo "Indexing completed"
# delete symlink for tests running
sudo rm -f /usr/local/bin/invoke_tests

View File

@@ -1,6 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
function filter_components_by_version { function filter_components_by_version {
minimumVersion=$1 minimumVersion=$1

View File

@@ -1,5 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh source ~/utils/utils.sh
echo "install soundflower" echo "install soundflower"

View File

@@ -1,7 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
echo Installing aws... echo Installing aws...
AWS_CLI_URL="https://awscli.amazonaws.com/AWSCLIV2.pkg" AWS_CLI_URL="https://awscli.amazonaws.com/AWSCLIV2.pkg"
@@ -15,4 +13,4 @@ brew install aws-sam-cli
echo "Install aws cli session manager" echo "Install aws cli session manager"
brew install --cask session-manager-plugin brew install --cask session-manager-plugin
invoke_tests "Common" "AWS" invoke_tests "Common" "AWS"

View File

@@ -1,7 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
AZCOPY_DOWNLOAD_URL="https://aka.ms/downloadazcopy-v10-mac" AZCOPY_DOWNLOAD_URL="https://aka.ms/downloadazcopy-v10-mac"
@@ -14,4 +12,4 @@ chmod +x "/usr/local/bin/azcopy"
echo "Done, cleaning up" echo "Done, cleaning up"
rm -rf azcopy* rm -rf azcopy*
invoke_tests "Common" "AzCopy" invoke_tests "Common" "AzCopy"

View File

@@ -1,6 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
echo "Installing Chrome..." echo "Installing Chrome..."
brew_cask_install_ignoring_sha256 "google-chrome" brew_cask_install_ignoring_sha256 "google-chrome"
@@ -14,4 +13,4 @@ brew_smart_install "selenium-server-standalone"
CHROMEWEBDRIVER_DIR=$(readlink $(which chromedriver) | xargs dirname) CHROMEWEBDRIVER_DIR=$(readlink $(which chromedriver) | xargs dirname)
echo "export CHROMEWEBDRIVER=$CHROMEWEBDRIVER_DIR" >> "${HOME}/.bashrc" echo "export CHROMEWEBDRIVER=$CHROMEWEBDRIVER_DIR" >> "${HOME}/.bashrc"
invoke_tests "Browsers" "Chrome" invoke_tests "Browsers" "Chrome"

View File

@@ -1,5 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
# Setup the Cocoapods # Setup the Cocoapods
echo "Installing Cocoapods..." echo "Installing Cocoapods..."
@@ -8,4 +7,4 @@ pod setup
# Create a symlink to /usr/local/bin since it was removed due to Homebrew change. # Create a symlink to /usr/local/bin since it was removed due to Homebrew change.
ln -sf $(which pod) /usr/local/bin/pod ln -sf $(which pod) /usr/local/bin/pod
invoke_tests "Common" "CocoaPods" invoke_tests "Common" "CocoaPods"

View File

@@ -1,6 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
common_packages=$(get_toolset_value '.brew.common_packages[]') common_packages=$(get_toolset_value '.brew.common_packages[]')
for package in $common_packages; do for package in $common_packages; do
@@ -18,4 +17,4 @@ done
bazel bazel
# Invoke tests for all common tools # Invoke tests for all common tools
invoke_tests "Common" "CommonUtils" invoke_tests "Common" "CommonUtils"

View File

@@ -6,9 +6,7 @@
# https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script # https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
# #
########################################################################### ###########################################################################
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_CLI_TELEMETRY_OPTOUT=1
@@ -56,7 +54,6 @@ if [ $(dotnet --list-sdks | wc -l) -lt "1" ]; then
fi fi
echo 'export PATH="$PATH:$HOME/.dotnet/tools"' >> "$HOME/.bashrc" echo 'export PATH="$PATH:$HOME/.dotnet/tools"' >> "$HOME/.bashrc"
echo "Dotnet operations have been completed successfully..." echo "Dotnet operations have been completed successfully..."
invoke_tests "Common" ".NET" invoke_tests "Common" ".NET"

View File

@@ -1,6 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
echo "Installing Microsoft Edge..." echo "Installing Microsoft Edge..."
brew install --cask microsoft-edge brew install --cask microsoft-edge
@@ -59,4 +58,4 @@ sudo rm -rf "/Library/Application Support/Microsoft/MAU2.0/"
sudo rm -rf "/Library/LaunchAgents/com.microsoft.update.agent.plist" sudo rm -rf "/Library/LaunchAgents/com.microsoft.update.agent.plist"
sudo rm -rf "/Library/PrivelegedHelperTools/com.microsoft.autoupdate.helper" sudo rm -rf "/Library/PrivelegedHelperTools/com.microsoft.autoupdate.helper"
invoke_tests "Browsers" "Edge" invoke_tests "Browsers" "Edge"

View File

@@ -1,5 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh source ~/utils/utils.sh
echo "Installing Firefox..." echo "Installing Firefox..."
@@ -11,4 +10,4 @@ brew_smart_install "geckodriver"
echo "Add GECKOWEBDRIVER to bashrc..." echo "Add GECKOWEBDRIVER to bashrc..."
echo "export GECKOWEBDRIVER=$(brew --prefix geckodriver)/bin" >> "${HOME}/.bashrc" echo "export GECKOWEBDRIVER=$(brew --prefix geckodriver)/bin" >> "${HOME}/.bashrc"
invoke_tests "Browsers" "Firefox" invoke_tests "Browsers" "Firefox"

View File

@@ -1,6 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
echo "Installing GCC@8 using homebrew..." echo "Installing GCC@8 using homebrew..."
brew_smart_install "gcc@8" brew_smart_install "gcc@8"

View File

@@ -1,6 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh source ~/utils/utils.sh
echo Installing Git... echo Installing Git...
@@ -33,4 +31,4 @@ git config --global advice.detachedHead false
git config --global advice.amWorkDir false git config --global advice.amWorkDir false
git config --global advice.rmHints false git config --global advice.rmHints false
invoke_tests "Common" "Git" invoke_tests "Common" "Git"

View File

@@ -1,5 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
export PATH="$HOME/.ghcup/bin:$PATH" export PATH="$HOME/.ghcup/bin:$PATH"

View File

@@ -1,5 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
MINICONDA_INSTALLER="/tmp/miniconda.sh" MINICONDA_INSTALLER="/tmp/miniconda.sh"
curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o $MINICONDA_INSTALLER curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o $MINICONDA_INSTALLER
@@ -12,4 +11,4 @@ if [ -d "$HOME/.conda" ]; then
sudo chown -R $USER "$HOME/.conda" sudo chown -R $USER "$HOME/.conda"
fi fi
invoke_tests "Common" "Miniconda" invoke_tests "Common" "Miniconda"

View File

@@ -1,6 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
# MongoDB object-value database # MongoDB object-value database
# installs last version of MongoDB Community Edition # installs last version of MongoDB Community Edition

View File

@@ -1,5 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh source ~/utils/utils.sh
node_modules=( node_modules=(

View File

@@ -4,7 +4,6 @@
# #
########################################################################### ###########################################################################
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
VERSION=$(curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name') VERSION=$(curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh | bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh | bash
@@ -32,4 +31,4 @@ fi
echo "Node version manager has been installed successfully" echo "Node version manager has been installed successfully"
invoke_tests "Node" "nvm" invoke_tests "Node" "nvm"

View File

@@ -1,7 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
installAzulJDK() { installAzulJDK() {
local URL=$1 local URL=$1

View File

@@ -1,6 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
echo "Install latest openssl" echo "Install latest openssl"
brew_smart_install "openssl" brew_smart_install "openssl"
@@ -11,4 +10,4 @@ brew_smart_install "openssl@1.1"
# Symlink brew openssl@1.1 to `/usr/local/bin` as Homebrew refuses # Symlink brew openssl@1.1 to `/usr/local/bin` as Homebrew refuses
ln -sf $(brew --prefix openssl@1.1)/bin/openssl /usr/local/bin/openssl ln -sf $(brew --prefix openssl@1.1)/bin/openssl /usr/local/bin/openssl
invoke_tests "Common" "OpenSSL" invoke_tests "Common" "OpenSSL"

View File

@@ -1,6 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
echo Installing PHP echo Installing PHP
brew_smart_install "php" brew_smart_install "php"
@@ -8,4 +7,4 @@ brew_smart_install "php"
echo Installing composer echo Installing composer
brew_smart_install "composer" brew_smart_install "composer"
invoke_tests "PHP" invoke_tests "PHP"

View File

@@ -1,6 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
export PATH="$PATH:/opt/pipx_bin" export PATH="$PATH:/opt/pipx_bin"
@@ -19,4 +18,4 @@ for package in $pipx_packages; do
fi fi
done done
invoke_tests "PipxPackages" invoke_tests "PipxPackages"

View File

@@ -1,6 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
#Install latest version of postgresql #Install latest version of postgresql
brew_smart_install "postgres" brew_smart_install "postgres"
@@ -27,4 +26,4 @@ done
#Stop postgresql #Stop postgresql
brew services stop postgresql brew services stop postgresql
invoke_tests "Databases" "PostgreSQL" invoke_tests "Databases" "PostgreSQL"

View File

@@ -1,7 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
echo Installing Azure CLI... echo Installing Azure CLI...
brew_smart_install "azure-cli" brew_smart_install "azure-cli"
@@ -36,4 +34,4 @@ sudo ln -s /usr/local/bin/pwsh /usr/local/bin/powershell
# fix ~/.azure directory permissions # fix ~/.azure directory permissions
sudo chown -R ${USER}: $HOME/.azure sudo chown -R ${USER}: $HOME/.azure
invoke_tests "Powershell" invoke_tests "Powershell"

View File

@@ -1,5 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh source ~/utils/utils.sh
echo "Installing Python Tooling" echo "Installing Python Tooling"
@@ -28,4 +27,4 @@ echo "export PIPX_BIN_DIR=${PIPX_BIN_DIR}" >> "${HOME}/.bashrc"
echo "export PIPX_HOME=${PIPX_HOME}" >> "${HOME}/.bashrc" echo "export PIPX_HOME=${PIPX_HOME}" >> "${HOME}/.bashrc"
echo 'export PATH="$PIPX_BIN_DIR:$PATH"' >> "${HOME}/.bashrc" echo 'export PATH="$PIPX_BIN_DIR:$PATH"' >> "${HOME}/.bashrc"
invoke_tests "Python" invoke_tests "Python"

View File

@@ -1,5 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh source ~/utils/utils.sh
echo Installing Ruby... echo Installing Ruby...

View File

@@ -1,5 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh source ~/utils/utils.sh
echo Updating RubyGems... echo Updating RubyGems...
@@ -31,4 +30,4 @@ gem install bundler --force
echo Installing fastlane tools... echo Installing fastlane tools...
gem install fastlane gem install fastlane
invoke_tests "RubyGem" invoke_tests "RubyGem"

View File

@@ -1,6 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
echo Installing Rustup... echo Installing Rustup...
brew_smart_install "rustup-init" brew_smart_install "rustup-init"

View File

@@ -1,5 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh source ~/utils/utils.sh
echo "Get the latest Stack version..." echo "Get the latest Stack version..."

View File

@@ -1,5 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh source ~/utils/utils.sh
echo "Install SwiftLint" echo "Install SwiftLint"
@@ -8,4 +7,4 @@ download_with_retries $swiftlintUrl "/tmp" "SwiftLint.pkg"
sudo installer -pkg /tmp/SwiftLint.pkg -target / sudo installer -pkg /tmp/SwiftLint.pkg -target /
rm -rf /tmp/SwiftLint.pkg rm -rf /tmp/SwiftLint.pkg
invoke_tests "Linters" "SwiftLint" invoke_tests "Linters" "SwiftLint"

View File

@@ -1,5 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh source ~/utils/utils.sh
# Set env variable for vcpkg # Set env variable for vcpkg

View File

@@ -1,7 +1,6 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/xamarin-utils.sh source ~/utils/xamarin-utils.sh
source ~/utils/invoke-tests.sh
VSMAC_VERSION=$(get_toolset_value '.xamarin.vsmac') VSMAC_VERSION=$(get_toolset_value '.xamarin.vsmac')
if [ $VSMAC_VERSION == "latest" ]; then if [ $VSMAC_VERSION == "latest" ]; then
@@ -28,4 +27,3 @@ sudo hdiutil detach "$TMPMOUNT"
sudo rm -rf "$TMPMOUNT" sudo rm -rf "$TMPMOUNT"
invoke_tests "Common" "VSMac" invoke_tests "Common" "VSMac"

View File

@@ -1,5 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh source ~/utils/utils.sh
ANDROID_HOME=$HOME/Library/Android/sdk ANDROID_HOME=$HOME/Library/Android/sdk
@@ -64,4 +63,4 @@ echo "Installing ndk r18B..."
echo y | $SDKMANAGER "ndk;18.1.5063045" echo y | $SDKMANAGER "ndk;18.1.5063045"
echo "export ANDROID_NDK_18R_PATH=${ANDROID_HOME}/ndk/18.1.5063045" >> "${HOME}/.bashrc" echo "export ANDROID_NDK_18R_PATH=${ANDROID_HOME}/ndk/18.1.5063045" >> "${HOME}/.bashrc"
invoke_tests "XamarinNDK" invoke_tests "XamarinNDK"

View File

@@ -1,5 +1,4 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh source ~/utils/utils.sh
source ~/utils/xamarin-utils.sh source ~/utils/xamarin-utils.sh

View File

@@ -1,10 +1,5 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
invoke_tests() { source $HOME/.bashrc
local TEST_FILE="$1" pwsh -Command "Import-Module '$HOME/image-generation/helpers/Tests.Helpers.psm1' -DisableNameChecking
local TEST_NAME="$2" Invoke-PesterTests -TestFile \"$1\" -TestName \"$2\""
source $HOME/.bashrc
pwsh -Command "Import-Module '$HOME/image-generation/helpers/Tests.Helpers.psm1' -DisableNameChecking
Invoke-PesterTests -TestFile \"$TEST_FILE\" -TestName \"$TEST_NAME\""
}