Fix CI issues
This commit is contained in:
Родитель
e394460fd6
Коммит
56c4b499ee
|
@ -3,6 +3,43 @@ set -ex
|
|||
|
||||
# Script used by the Azure DevOps build agent to start the packager and web socket server
|
||||
|
||||
# Wait for the package to start
|
||||
waitForPackager() {
|
||||
local -i max_attempts=60
|
||||
local -i attempt_num=1
|
||||
|
||||
until curl -s http://localhost:8081/status | grep "packager-status:running" -q; do
|
||||
if (( attempt_num == max_attempts )); then
|
||||
echo "Packager did not respond in time. No more attempts left."
|
||||
exit 1
|
||||
else
|
||||
(( attempt_num++ ))
|
||||
echo "Packager did not respond. Retrying for attempt number $attempt_num..."
|
||||
sleep 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Packager is ready!"
|
||||
}
|
||||
|
||||
waitForWebSocketServer() {
|
||||
local -i max_attempts=60
|
||||
local -i attempt_num=1
|
||||
|
||||
until curl -s http://localhost:5555 | grep "Upgrade Required" -q; do
|
||||
if (( attempt_num == max_attempts )); then
|
||||
echo "WebSocket Server did not respond in time. No more attempts left."
|
||||
exit 1
|
||||
else
|
||||
(( attempt_num++ ))
|
||||
echo "WebSocket Server did not respond. Retrying for attempt number $attempt_num..."
|
||||
sleep 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "WebSocket Server is ready!"
|
||||
}
|
||||
|
||||
THIS_DIR=$PWD
|
||||
|
||||
# AppleScript can't be invoked from Azure DevOps Mojave agents until the following ticket is resolved: https://dev.azure.com/mseng/AzureDevOps/_workitems/edit/1513729
|
||||
|
@ -17,8 +54,10 @@ COMMAND="$TMPDIR/launchPackager.command"
|
|||
echo "cd ${THIS_DIR}; export SERVERS_NO_WAIT=1; ./scripts/launchPackager.command" > "$COMMAND"
|
||||
chmod +x "$COMMAND"
|
||||
open "$COMMAND"
|
||||
waitForPackager
|
||||
|
||||
COMMAND="$TMPDIR/launchWebSocketServer.command"
|
||||
echo "cd ${THIS_DIR}; export SERVERS_NO_WAIT=1; ./IntegrationTests/launchWebSocketServer.command" > "$COMMAND"
|
||||
chmod +x "$COMMAND"
|
||||
open "$COMMAND"
|
||||
waitForWebSocketServer
|
||||
|
|
|
@ -28,7 +28,7 @@ jobs:
|
|||
timeoutInMinutes: 60
|
||||
cancelTimeoutInMinutes: 5
|
||||
steps:
|
||||
- template: templates/apple-node-setup.yml
|
||||
- template: templates/apple-tools-setup.yml
|
||||
- template: templates/apple-xcode-select.yml
|
||||
parameters:
|
||||
slice_name: $(slice_name)
|
||||
|
|
|
@ -59,7 +59,7 @@ jobs:
|
|||
displayName: Set dist-tag to v0.x-stable
|
||||
condition: and(ne(variables['Build.SourceBranchName'], 'main'), ne(variables['Build.SourceBranchName'], variables.latestStableBranch))
|
||||
|
||||
- template: templates/apple-node-setup.yml
|
||||
- template: templates/apple-tools-setup.yml
|
||||
|
||||
- task: CmdLine@2
|
||||
displayName: yarn install
|
||||
|
|
|
@ -3,7 +3,7 @@ parameters:
|
|||
xcode_version: ''
|
||||
|
||||
steps:
|
||||
- template: apple-node-setup.yml
|
||||
- template: apple-tools-setup.yml
|
||||
|
||||
# Task Group: Xcode select proper version
|
||||
- template: apple-xcode-select.yml
|
||||
|
|
|
@ -10,11 +10,7 @@ parameters:
|
|||
use_fabric: ''
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
rm -rf $(Build.Repository.LocalPath)/DerivedData
|
||||
displayName: 'Clean DerivedData'
|
||||
|
||||
- template: apple-node-setup.yml
|
||||
- template: apple-tools-setup.yml
|
||||
|
||||
# Task Group: Xcode select proper version
|
||||
- template: apple-xcode-select.yml
|
||||
|
@ -32,7 +28,8 @@ steps:
|
|||
inputs:
|
||||
script: |
|
||||
cd packages/rn-tester
|
||||
pod install
|
||||
bundle install
|
||||
bundle exec pod install
|
||||
env:
|
||||
USE_FABRIC: $(use_fabric)
|
||||
|
||||
|
@ -45,21 +42,31 @@ steps:
|
|||
|
||||
- bash: |
|
||||
echo Preparing the packager for platform $PLATFORM
|
||||
curl --retry-connrefused --connect-timeout 5 --max-time 10 --retry 10 --retry-delay 5 --retry-max-time 120 "http://localhost:8081/packages/rn-tester/js/RNTesterApp.${PLATFORM}.bundle?platform=${PLATFORM}&dev=true" -o /dev/null
|
||||
curl --retry-connrefused --connect-timeout 5 --max-time 10 --retry 10 --retry-delay 5 --retry-max-time 120 "http://localhost:8081/packages/rn-tester/js/RNTesterApp.${PLATFORM}.bundle?platform=${PLATFORM}&dev=true&minify=false" -o /dev/null
|
||||
curl --retry-connrefused --connect-timeout 5 --max-time 10 --retry 10 --retry-delay 5 --retry-max-time 120 "http://localhost:8081/IntegrationTests/IntegrationTestsApp.bundle?platform=${PLATFORM}&dev=true" -o /dev/null
|
||||
curl --retry-connrefused --connect-timeout 5 --max-time 10 --retry 10 --retry-delay 5 --retry-max-time 120 "http://localhost:8081/IntegrationTests/RCTRootViewIntegrationTestApp.bundle?platform=${PLATFORM}&dev=true" -o /dev/null
|
||||
env:
|
||||
PLATFORM: ${{ parameters.packager_platform }}
|
||||
displayName: 'curl the packager'
|
||||
|
||||
- template: apple-xcode-build.yml
|
||||
parameters:
|
||||
xcode_sdk: ${{ parameters.xcode_sdk }}
|
||||
xcode_configuration: ${{ parameters.xcode_configuration }}
|
||||
xcode_workspacePath: packages/rn-tester/RNTesterPods.xcworkspace
|
||||
xcode_scheme: ${{ parameters.xcode_scheme }}
|
||||
xcode_actions: ${{ parameters.xcode_actions }}
|
||||
xcode_useXcpretty: true
|
||||
xcode_destination: ${{ parameters.xcode_destination }}
|
||||
xcode_extraArgs: -retry-tests-on-failure -test-iterations 2
|
||||
- task: Xcode@5
|
||||
displayName: 'Xcode ${{ parameters.xcode_actions }} ${{ parameters.xcode_configuration }} ${{ parameters.xcode_sdk }} ${{ parameters.xcode_scheme }}'
|
||||
inputs:
|
||||
actions: '${{ parameters.xcode_actions }}'
|
||||
configuration: ${{ parameters.xcode_configuration }}
|
||||
sdk: ${{ parameters.xcode_sdk }}
|
||||
xcWorkspacePath: packages/rn-tester/RNTesterPods.xcworkspace
|
||||
scheme: ${{ parameters.xcode_scheme }}
|
||||
xcodeVersion: default
|
||||
signingOption: auto
|
||||
packageApp: false
|
||||
teamId: '$(XCodeSigningMicrosoftTeamID)'
|
||||
args: '-destination "${{ parameters.xcode_destination }}" ONLY_ACTIVE_ARCH=YES -verbose -derivedDataPath DerivedData ${{ parameters.xcode_extraArgs }}'
|
||||
exportPath: '$(agent.builddirectory)/output/${{ parameters.xcode_sdk }}/${{ parameters.xcode_configuration }}'
|
||||
useXcpretty: ${{ parameters.xcode_useXcpretty }}
|
||||
publishJUnitResults: ${{ parameters.xcode_useXcpretty }}
|
||||
xctoolReporter: 'junit:test-results.xml'
|
||||
|
||||
- task: ShellScript@2
|
||||
displayName: 'Cleanup packager and WebSocket test server'
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
#
|
||||
# Task Group: Brew install node version
|
||||
#
|
||||
steps:
|
||||
- script: 'brew bundle'
|
||||
displayName: 'brew bundle'
|
||||
|
||||
# Brew can't access user data for node
|
||||
- script: sudo chown -R $(whoami) /usr/local/*
|
||||
displayName: 'fix node permissions'
|
||||
|
||||
- script: brew link node@16 --overwrite --force
|
||||
displayName: 'ensure node 16'
|
|
@ -0,0 +1,12 @@
|
|||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSource: 'fromFile' # 'spec' | 'fromFile'. Required. Source of version. Default: spec.
|
||||
versionFilePath: '.node-version'
|
||||
|
||||
- task: UseRubyVersion@0
|
||||
inputs:
|
||||
versionSpec: '>= 2.7'
|
||||
|
||||
- script: 'brew bundle'
|
||||
displayName: 'brew bundle'
|
|
@ -1,28 +0,0 @@
|
|||
parameters:
|
||||
xcode_sdk: ''
|
||||
xcode_configuration: ''
|
||||
xcode_workspacePath: ''
|
||||
xcode_scheme: ''
|
||||
xcode_actions: ''
|
||||
xcode_useXcpretty: false
|
||||
xcode_destination: ''
|
||||
xcode_extraArgs: ''
|
||||
|
||||
steps:
|
||||
- task: Xcode@5
|
||||
displayName: 'Xcode ${{ parameters.xcode_actions }} ${{ parameters.xcode_configuration }} ${{ parameters.xcode_sdk }} ${{ parameters.xcode_scheme }}'
|
||||
inputs:
|
||||
actions: '${{ parameters.xcode_actions }}'
|
||||
configuration: ${{ parameters.xcode_configuration }}
|
||||
sdk: ${{ parameters.xcode_sdk }}
|
||||
xcWorkspacePath: ${{ parameters.xcode_workspacePath }}
|
||||
scheme: ${{ parameters.xcode_scheme }}
|
||||
xcodeVersion: default
|
||||
signingOption: auto
|
||||
packageApp: false
|
||||
teamId: '$(XCodeSigningMicrosoftTeamID)'
|
||||
args: '-destination "${{ parameters.xcode_destination }}" ONLY_ACTIVE_ARCH=YES -verbose -derivedDataPath DerivedData ${{ parameters.xcode_extraArgs }}'
|
||||
exportPath: '$(agent.builddirectory)/output/${{ parameters.xcode_sdk }}/${{ parameters.xcode_configuration }}'
|
||||
useXcpretty: ${{ parameters.xcode_useXcpretty }}
|
||||
publishJUnitResults: ${{ parameters.xcode_useXcpretty }}
|
||||
xctoolReporter: 'junit:test-results.xml'
|
|
@ -9,7 +9,7 @@ steps:
|
|||
submodules: false # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
|
||||
persistCredentials: false # set to 'true' to leave the OAuth token in the Git config after the initial fetch
|
||||
|
||||
- template: apple-node-setup.yml
|
||||
- template: apple-tools-setup.yml
|
||||
|
||||
# First do a build of the local package, since we point the cli at the local files, it needs to be pre-built
|
||||
- task: CmdLine@2
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
variables:
|
||||
VmImageApple: internal-macos12
|
||||
slice_name: 'Xcode_14.0.1'
|
||||
xcode_version: '/Applications/Xcode_14.0.1.app'
|
||||
slice_name: 'Xcode_14.2'
|
||||
xcode_version: '/Applications/Xcode_14.2.app'
|
||||
|
|
1
Brewfile
1
Brewfile
|
@ -1,2 +1 @@
|
|||
brew "node@16"
|
||||
brew "watchman"
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
# [macOS] Keep this file around to help Azure Pipelines run the Websocket integration test
|
||||
|
||||
# Set terminal title
|
||||
echo -en "\033]0;Web Socket Test Server\a"
|
||||
clear
|
||||
|
||||
THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
|
||||
pushd "$THIS_DIR"
|
||||
./websocket_integration_test_server.js
|
||||
popd
|
||||
|
||||
echo "Process terminated. Press <enter> to close the window"
|
||||
read
|
Загрузка…
Ссылка в новой задаче