[macOS] Pester tests invocation after install - 2. (#2429)

* [macOS] Fail Pester tests on error

* return it back

* added new tests

* added new tests for Macos part2

* fixed nitpicks

* vsmac changes

* remove toolcache fron high sierra
This commit is contained in:
Darii Nurgaleev
2021-01-20 14:11:00 +07:00
committed by GitHub
parent c47ccfbf9a
commit 03ce901f42
12 changed files with 74 additions and 53 deletions

View File

@@ -1,5 +1,6 @@
#!/bin/bash -e -o pipefail
source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
echo Installing Rustup...
brew_smart_install "rustup-init"
@@ -16,3 +17,5 @@ cargo install bindgen cbindgen cargo-audit cargo-outdated
echo Cleanup Cargo registry cached data...
rm -rf $CARGO_HOME/registry/*
invoke_tests "Rust"

View File

@@ -1,5 +1,5 @@
#!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh
echo "Install SwiftLint"
@@ -7,3 +7,5 @@ swiftlintUrl=$(curl -s "https://api.github.com/repos/realm/SwiftLint/releases/la
download_with_retries $swiftlintUrl "/tmp" "SwiftLint.pkg"
sudo installer -pkg /tmp/SwiftLint.pkg -target /
rm -rf /tmp/SwiftLint.pkg
invoke_tests "Linters" "SwiftLint"

View File

@@ -4,7 +4,6 @@
# and installs them onto the system
#
###########################################################################
SOURCE_URL="https://vstsagenttools.blob.core.windows.net/tools"
PACKAGES_DIR=/tmp/hostedtoolcache
@@ -23,4 +22,4 @@ for package in $packages; do
pushd $(dirname $package)
npm install
popd
done;
done;

View File

@@ -3,7 +3,7 @@
## Team: CI-Build
## Desc: Install toolset
################################################################################
Import-Module "~/image-generation/helpers/Tests.Helpers.psm1"
Import-Module "~/image-generation/helpers/Common.Helpers.psm1"
Function Get-ToolcacheFromToolset {
@@ -57,4 +57,6 @@ foreach ($tool in $tools) {
exit 1
}
}
}
}
Invoke-PesterTests "Toolcache"

View File

@@ -1,5 +1,5 @@
#!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh
# Set env variable for vcpkg
@@ -12,3 +12,5 @@ $VCPKG_INSTALLATION_ROOT/bootstrap-vcpkg.sh
$VCPKG_INSTALLATION_ROOT/vcpkg integrate install
chmod -R 0777 $VCPKG_INSTALLATION_ROOT
ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin
invoke_tests "Common" "vcpkg"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e -o pipefail
source ~/utils/utils.sh
source ~/utils/xamarin-utils.sh
source ~/utils/invoke-tests.sh
VSMAC_VERSION=$(get_toolset_value '.xamarin.vsmac')
if [ $VSMAC_VERSION == "latest" ]; then
@@ -25,4 +25,7 @@ tar cf - "./Visual Studio.app" | tar xf - -C /Applications/
popd
sudo hdiutil detach "$TMPMOUNT"
sudo rm -rf "$TMPMOUNT"
sudo rm -rf "$TMPMOUNT"
invoke_tests "Common" "VSMac"

View File

@@ -62,4 +62,6 @@ fi
# Latest versions of NDK doesn't include GCC, NDK r18 does
echo "Installing ndk r18B..."
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"

View File

@@ -1,5 +1,5 @@
#!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
source ~/utils/utils.sh
source ~/utils/xamarin-utils.sh
@@ -88,3 +88,5 @@ sudo rm -rf "$TMPMOUNT"
PREFERENCES_XAMARIN_DIR="${HOME}/Library/Preferences/Xamarin"
mkdir -p $PREFERENCES_XAMARIN_DIR
/usr/libexec/PlistBuddy -c "add :AppleSdkRoot string /Applications/Xcode_${DEFAULT_XCODE_VERSION}.app" $PREFERENCES_XAMARIN_DIR/Settings.plist
invoke_tests "Xamarin"

View File

@@ -41,4 +41,5 @@ Switch-Xcode -Version $defaultXcode
New-Item -Path "/Applications/Xcode.app" -ItemType SymbolicLink -Value (Get-XcodeRootPath -Version $defaultXcode) | Out-Null
Write-Host "Setting environment variables 'XCODE_<VERSION>_DEVELOPER_DIR'"
Set-XcodeDeveloperDirEnvironmentVariables -XcodeList $xcodeVersions.link
Set-XcodeDeveloperDirEnvironmentVariables -XcodeList $xcodeVersions.link

View File

@@ -166,38 +166,6 @@ Describe "Homebrew" {
}
}
Describe "Rust" -Skip:($os.IsHighSierra) {
It "Rustup is installed" {
"rustup --version" | Should -ReturnZeroExitCode
}
It "Rustc is installed" {
"rustc --version" | Should -ReturnZeroExitCode
}
It "Cargo is installed" {
"cargo --version" | Should -ReturnZeroExitCode
}
Context "Cargo dependencies" {
It "bindgen" {
"bindgen --version" | Should -ReturnZeroExitCode
}
It "cbindgen" {
"cbindgen --version" | Should -ReturnZeroExitCode
}
It "Cargo audit" {
"cargo audit --version" | Should -ReturnZeroExitCode
}
It "Cargo outdated" {
"cargo outdated --version" | Should -ReturnZeroExitCode
}
}
}
Describe "GCC" -Skip:($os.IsHighSierra) {
$testCases = @("8", "9", "10") | ForEach-Object { @{Version = $_} }
@@ -240,15 +208,6 @@ Describe "Newman" -Skip:($os.IsHighSierra -or $os.IsMojave) {
}
}
Describe "Visual Studio For Mac" {
It "VS4Mac is installed" {
$vsPath = "/Applications/Visual Studio.app"
$vstoolPath = Join-Path $vsPath "Contents/MacOS/vstool"
$vsPath | Should -Exist
$vstoolPath | Should -Exist
}
}
Describe "AWS" {
It "AWS CLI" {
"aws --version" | Should -ReturnZeroExitCode
@@ -314,4 +273,13 @@ Describe "CocoaPods" {
It "CocoaPods" {
"pod --version" | Should -ReturnZeroExitCode
}
}
Describe "VSMac" {
It "VS4Mac is installed" {
$vsPath = "/Applications/Visual Studio.app"
$vstoolPath = Join-Path $vsPath "Contents/MacOS/vstool"
$vsPath | Should -Exist
$vstoolPath | Should -Exist
}
}

View File

@@ -2,7 +2,7 @@ Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking
$os = Get-OSVersion
Describe "Linters" {
Describe "SwiftLint" {
It "SwiftLint" -Skip:($os.IsHighSierra) {
"swiftlint version" | Should -ReturnZeroExitCode
}

View File

@@ -0,0 +1,37 @@
$os = Get-OSVersion
Describe "Rust" -Skip:($os.IsHighSierra) {
Context "Rust" {
It "Rustup is installed" {
"rustup --version" | Should -ReturnZeroExitCode
}
It "Rustc is installed" {
"rustc --version" | Should -ReturnZeroExitCode
}
}
Context "Cargo" {
It "Cargo is installed" {
"cargo --version" | Should -ReturnZeroExitCode
}
}
Context "Cargo dependencies" {
It "bindgen" {
"bindgen --version" | Should -ReturnZeroExitCode
}
It "cbindgen" {
"cbindgen --version" | Should -ReturnZeroExitCode
}
It "Cargo audit" {
"cargo audit --version" | Should -ReturnZeroExitCode
}
It "Cargo outdated" {
"cargo outdated --version" | Should -ReturnZeroExitCode
}
}
}