[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

@@ -24,3 +24,11 @@ sudo "/Library/Application Support/VMware Tools/vmware-resolutionSet" 1176 885
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

@@ -37,3 +37,6 @@ sudo rm -rf ~/utils ~/image-generation /tmp/*
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"

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"

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"

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..."

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

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

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..."

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...

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

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

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"

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"

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"

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"

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"

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"

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...

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"

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

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\""
}