Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT / DON'T MERGE] Add back compat checking for data consistency #1986

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
89 changes: 86 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,94 @@ jobs:
parameters:
androidAppHostingSdkGitPath: git://$(AndroidAppHostingSdkGitPath)

- job: E2ETestIOS
displayName: 'E2E Test - IOS'
- job: E2ETestIOSDev
displayName: 'E2E Test - IOS DEV'
pool:
vmImage: 'internal-macos12'
steps:
- template: tools/yaml-templates/ios-test.yml
- template: tools/yaml-templates/build-app-host-ios.yml
parameters:
iOSAppHostingSdkGitPath: git://$(IOSAppHostingSdkGitPath)

- bash: /usr/bin/xcodebuild
-configuration Release
-workspace /Users/runner/work/1/iOSHost/$(IOSSdkWorkspace).xcworkspace
-scheme $(IOSSdkScheme)
-sdk iphonesimulator
-parallel-testing-enabled YES
-parallel-testing-worker-count 2
-destination 'platform=iOS Simulator,name=iPhone 14 Pro,OS=16.2'
-screenshot-enabled="YES"
-test-iterations 3
-retry-tests-on-failure
-quiet
-resultBundlePath TestResults
test > report.out 2>&1

if [[ $? == 0 ]];
then
echo "E2E Test passes successfully";
exit 0;
else
echo "E2E Test failed";
exit 1;
fi;
displayName: 'iOS UI/E2E Tests'
workingDirectory: '$(Agent.BuildDirectory)/iOSHost'

- template: tools/yaml-templates/build-test-publish-ios.yml

- job: E2ETestIOSBackCompat
displayName: 'E2E Test - IOS Back Compat'
pool:
vmImage: 'internal-macos12'
steps:
- template: tools/yaml-templates/build-app-host-ios.yml
parameters:
iOSAppHostingSdkGitPath: git://$(IOSAppHostingSdkGitPath2)

- bash: |
pwd
sudo pip3 install selenium
displayName: Run pip install selenium for scraping
workingDirectory: '$(Agent.BuildDirectory)/iOSHost'

- bash: |
pnpm install
displayName: 'Install BCAET tool'
workingDirectory: '$(Agent.BuildDirectory)/iOSHost/backcompattool'

- bash: |
pnpm test:e2e 2>&1
displayName: 'Generate test files on latest version Teams-JS Library'
workingDirectory: '$(Agent.BuildDirectory)/iOSHost/backcompattool'

- bash:
/usr/bin/xcodebuild
-configuration Release
-workspace /Users/runner/work/1/iOSHost/$(IOSSdkWorkspace).xcworkspace
-scheme $(IOSSdkScheme)
-sdk iphonesimulator
-parallel-testing-enabled YES
-parallel-testing-worker-count 2
-destination 'platform=iOS Simulator,name=iPhone 14 Pro,OS=16.2'
-screenshot-enabled="YES"
-test-iterations 3
-retry-tests-on-failure
-quiet
-resultBundlePath TestResults
test > report.out
# test > report.out 2>&1

# if [[ $? == 0 ]];
# then
# echo "E2E Test passes successfully";
# exit 0;
# else
# echo "E2E Test failed";
# exit 1;
# fi;
displayName: 'iOS UI/E2E Tests'
workingDirectory: '$(Agent.BuildDirectory)/iOSHost'

- template: tools/yaml-templates/build-test-publish-ios.yml
78 changes: 78 additions & 0 deletions tools/yaml-templates/build-app-host-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
parameters:
- name: 'iOSAppHostingSdkGitPath'
default: none
type: string

steps:
- checkout: self
- checkout: ${{ parameters.iOSAppHostingSdkGitPath }}
path: iOSHost
persistCredentials: true

- bash: git checkout kx/test_npmrc
displayName: switch to testing branch
workingDirectory: '$(Agent.BuildDirectory)/iOSHost'

- task: InstallSSHKey@0
displayName: 'Install an SSH key for OneDSTelemetry'
inputs:
knownHostsEntry: 'github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg='
sshPublicKey: '$(OneDSTelemetryKey)'
sshKeySecureFile: 'ios_host_sdk_dev_1ds_key'

- bash: |
sudo gem install cocoapods
displayName: Install Cocoapods
workingDirectory: '$(Agent.BuildDirectory)/iOSHost'

- bash: |
pod install > /dev/null
displayName: Run Cocoapods - pod install
workingDirectory: '$(Agent.BuildDirectory)/iOSHost'

- bash: |
brew install xctesthtmlreport
displayName: 'Install XCTestHtmlReport for publishing result'
workingDirectory: '$(System.DefaultWorkingDirectory)'

- task: NodeTool@0
inputs:
versionSpec: '14.x'
displayName: 'Install Node.js'

# Cache task is used to create a cache of files which won't change between jobs, task, or steps.
# In this task below a unique identifier(fingerprint) is created for the cache name, usually it's
# 'command_name | operating_system | lockfile'
# in our case it is 'pnpm | "$(Agent.OS)" | $(ClientSdkProjectDirectory)/pnpm-lock.yaml'
# and for the path is the directory which needs to be cached.
# Here `node_modules` are cached which are dowloaded from the scoped/private registry to build the mono-repo.
- task: Cache@2
inputs:
key: 'pnpm | "$(Agent.OS)" | $(ClientSdkProjectDirectory)/pnpm-lock.yaml'
path: $(Pipeline.Workspace)/.pnpm-store
displayName: Cache pnpm

- script: |
corepack enable
corepack prepare pnpm@7.30.1 --activate
pnpm config set store-dir $(Pipeline.Workspace)/.pnpm-store
displayName: 'Setup pnpm'

- script: |
pnpm install
displayName: 'Install client sdk dependencies'
workingDirectory: '$(ClientSdkProjectDirectory)'

- script: |
pnpm build-force-blazor
displayName: 'Build client sdk'
workingDirectory: '$(ClientSdkProjectDirectory)'

- bash: 'nohup pnpm start-test-app &'
displayName: 'Run sample test app in background'
workingDirectory: '$(ClientSdkProjectDirectory)'

- bash: cd ~/Library/Preferences
defaults write com.apple.iphonesimulator SlowMotionAnimation -bool NO
displayName: 'Disable Slow Animation'
workingDirectory: '$(System.DefaultWorkingDirectory)'
24 changes: 24 additions & 0 deletions tools/yaml-templates/build-test-publish-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
steps:
- bash: xchtmlreport -r TestResults -j > /dev/null

if [[ $? == 0 ]];
then
echo "Test report has been generated successfully.";
exit 0;
else
echo "Test report generating process failed for some reasons.";
exit 1;
fi;
displayName: 'Generate E2E test report'
workingDirectory: '$(Agent.BuildDirectory)/iOSHost'
condition: succeededOrFailed()

- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '**/*.junit'
failTaskOnFailedTests: false
testRunTitle: 'E2E Tests - iOS'
searchFolder: '$(Agent.BuildDirectory)/iOSHost'
mergeTestResults: true
condition: always()