ci: refactor browser tests (#1804)

This commit is contained in:
Niklas von Hertzen 2019-04-10 21:09:08 -07:00 committed by GitHub
parent b89458611b
commit a7d881019b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 111 additions and 349 deletions

View File

@ -11,7 +11,7 @@ insert_final_newline = true
indent_style = space indent_style = space
indent_size = 4 indent_size = 4
[{azure-pipelines.yml,package.json}] [{azure-pipelines.yml,package.json, ci/*.yml}]
# The indent size used in the `package.json` file cannot be changed # The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516 # https://github.com/npm/npm/pull/3180#issuecomment-16336516
indent_size = 2 indent_size = 2

View File

@ -73,358 +73,68 @@ jobs:
inputs: inputs:
PathtoPublish: 'www/public' PathtoPublish: 'www/public'
artifactName: docs artifactName: docs
- job: Browser_Tests_Linux_Firefox_Stable
- template: ci/browser-tests.yml
parameters:
name: Browser_Tests_Linux_Firefox_Stable
displayName: Linux Firefox Stable displayName: Linux Firefox Stable
pool: vmImage: 'ubuntu-16.04'
vmImage: 'Ubuntu-16.04' targetBrowser: Firefox_Stable
variables: xvfb: true
TARGET_BROWSER: Firefox_Stable
dependsOn: Build - template: ci/browser-tests.yml
condition: succeeded() parameters:
steps: name: Browser_Tests_Linux_Chrome_Stable
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: Npm@0
inputs:
command: install
- task: DownloadBuildArtifacts@0
displayName: 'Download library'
inputs:
artifactName: dist
downloadPath: $(System.DefaultWorkingDirectory)
- task: DownloadBuildArtifacts@0
displayName: 'Download testrunner'
inputs:
artifactName: build
downloadPath: $(System.DefaultWorkingDirectory)
- script: Xvfb :99 &
displayName: 'Start Xvfb'
- script: DISPLAY=:99 npm run karma
displayName: 'Run Firefox tests - Firefox Stable'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: 'tmp/junit/*.xml'
- task: PublishBuildArtifacts@1
displayName: Upload Screenshots
condition: succeededOrFailed()
inputs:
PathtoPublish: 'tmp/reftests'
artifactName: ReftestResults
- job: Browser_Tests_Linux_Chrome_Stable
displayName: Linux Chrome Stable displayName: Linux Chrome Stable
pool: vmImage: 'ubuntu-16.04'
vmImage: 'Ubuntu-16.04' targetBrowser: Chrome_Stable
variables: xvfb: true
TARGET_BROWSER: Chrome_Stable
dependsOn: Build - template: ci/browser-tests.yml
condition: succeeded() parameters:
steps: name: Browser_Tests_OSX_Safari_IOS_9
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: Npm@0
inputs:
command: install
- task: DownloadBuildArtifacts@0
displayName: 'Download library'
inputs:
artifactName: dist
downloadPath: $(System.DefaultWorkingDirectory)
- task: DownloadBuildArtifacts@0
displayName: 'Download testrunner'
inputs:
artifactName: build
downloadPath: $(System.DefaultWorkingDirectory)
- script: Xvfb :99 &
displayName: 'Start Xvfb'
- script: DISPLAY=:99 npm run karma
displayName: 'Run Chrome tests - Chrome Stable'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: 'tmp/junit/*.xml'
- task: PublishBuildArtifacts@1
displayName: Upload Screenshots
condition: succeededOrFailed()
inputs:
PathtoPublish: 'tmp/reftests'
artifactName: ReftestResults
- job: Browser_Tests_OSX_Safari_IOS_9
displayName: iOS Simulator Safari 9 displayName: iOS Simulator Safari 9
pool:
vmImage: 'macOS-10.13' vmImage: 'macOS-10.13'
variables: targetBrowser: Safari_IOS_9
TARGET_BROWSER: Safari_IOS_9
dependsOn: Build - template: ci/browser-tests.yml
condition: succeeded() parameters:
steps: name: Browser_Tests_OSX_Safari_IOS_10
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: Npm@0
inputs:
command: install
- task: DownloadBuildArtifacts@0
displayName: 'Download library'
inputs:
artifactName: dist
downloadPath: $(System.DefaultWorkingDirectory)
- task: DownloadBuildArtifacts@0
displayName: 'Download testrunner'
inputs:
artifactName: build
downloadPath: $(System.DefaultWorkingDirectory)
- script: npm run karma
displayName: 'Run Safari tests - Safari IOS'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: 'tmp/junit/*.xml'
- task: PublishBuildArtifacts@1
displayName: Upload Screenshots
condition: succeededOrFailed()
inputs:
PathtoPublish: 'tmp/reftests'
artifactName: ReftestResults
- job: Browser_Tests_OSX_Safari_IOS_10
displayName: iOS Simulator Safari 10 displayName: iOS Simulator Safari 10
pool:
vmImage: 'macOS-10.13' vmImage: 'macOS-10.13'
variables: targetBrowser: Safari_IOS_10
TARGET_BROWSER: Safari_IOS_10
dependsOn: Build - template: ci/browser-tests.yml
condition: succeeded() parameters:
steps: name: Browser_Tests_OSX_Safari_IOS_11
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: Npm@0
inputs:
command: install
- task: DownloadBuildArtifacts@0
displayName: 'Download library'
inputs:
artifactName: dist
downloadPath: $(System.DefaultWorkingDirectory)
- task: DownloadBuildArtifacts@0
displayName: 'Download testrunner'
inputs:
artifactName: build
downloadPath: $(System.DefaultWorkingDirectory)
- script: npm run karma
displayName: 'Run Safari tests - Safari IOS'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: 'tmp/junit/*.xml'
- task: PublishBuildArtifacts@1
displayName: Upload Screenshots
condition: succeededOrFailed()
inputs:
PathtoPublish: 'tmp/reftests'
artifactName: ReftestResults
- job: Browser_Tests_OSX_Safari_IOS_11
displayName: iOS Simulator Safari 11 displayName: iOS Simulator Safari 11
pool:
vmImage: 'macOS-10.13' vmImage: 'macOS-10.13'
variables: targetBrowser: Safari_IOS_11
TARGET_BROWSER: Safari_IOS_11
dependsOn: Build - template: ci/browser-tests.yml
condition: succeeded() parameters:
steps: name: Browser_Tests_OSX_Safari_Stable
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: Npm@0
inputs:
command: install
- task: DownloadBuildArtifacts@0
displayName: 'Download library'
inputs:
artifactName: dist
downloadPath: $(System.DefaultWorkingDirectory)
- task: DownloadBuildArtifacts@0
displayName: 'Download testrunner'
inputs:
artifactName: build
downloadPath: $(System.DefaultWorkingDirectory)
- script: npm run karma
displayName: 'Run Safari tests - Safari IOS'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: 'tmp/junit/*.xml'
- task: PublishBuildArtifacts@1
displayName: Upload Screenshots
condition: succeededOrFailed()
inputs:
PathtoPublish: 'tmp/reftests'
artifactName: ReftestResults
- job: Browser_Tests_OSX_Safari_Stable
displayName: OSX Safari Stable displayName: OSX Safari Stable
pool:
vmImage: 'macOS-10.13' vmImage: 'macOS-10.13'
variables: targetBrowser: Safari_Stable
TARGET_BROWSER: Safari_Stable
dependsOn: Build - template: ci/browser-tests.yml
condition: succeeded() parameters:
steps: name: Browser_Tests_Windows_IE9
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: Npm@0
inputs:
command: install
- task: DownloadBuildArtifacts@0
displayName: 'Download library'
inputs:
artifactName: dist
downloadPath: $(System.DefaultWorkingDirectory)
- task: DownloadBuildArtifacts@0
displayName: 'Download testrunner'
inputs:
artifactName: build
downloadPath: $(System.DefaultWorkingDirectory)
- script: npm run karma
displayName: 'Run Safari tests - Safari Stable'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: 'tmp/junit/*.xml'
- task: PublishBuildArtifacts@1
displayName: Upload Screenshots
condition: succeededOrFailed()
inputs:
PathtoPublish: 'tmp/reftests'
artifactName: ReftestResults
- job: Browser_Tests_Windows_IE9
displayName: Windows Internet Explorer 9 (Emulated) displayName: Windows Internet Explorer 9 (Emulated)
pool:
vmImage: 'vs2017-win2016' vmImage: 'vs2017-win2016'
variables: targetBrowser: IE_9
TARGET_BROWSER: IE_9
dependsOn: Build - template: ci/browser-tests.yml
condition: succeeded() parameters:
steps: name: Browser_Tests_Windows_IE10
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: Npm@0
inputs:
command: install
- task: DownloadBuildArtifacts@0
displayName: 'Download library'
inputs:
artifactName: dist
downloadPath: $(System.DefaultWorkingDirectory)
- task: DownloadBuildArtifacts@0
displayName: 'Download testrunner'
inputs:
artifactName: build
downloadPath: $(System.DefaultWorkingDirectory)
- script: npm run karma
displayName: 'Run Internet Explorer tests - IE 9'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: 'tmp/junit/*.xml'
- task: PublishBuildArtifacts@1
displayName: Upload Screenshots
condition: succeededOrFailed()
inputs:
PathtoPublish: 'tmp/reftests'
artifactName: ReftestResults
- job: Browser_Tests_Windows_IE10
displayName: Windows Internet Explorer 10 (Emulated) displayName: Windows Internet Explorer 10 (Emulated)
pool:
vmImage: 'vs2017-win2016' vmImage: 'vs2017-win2016'
variables: targetBrowser: IE_10
TARGET_BROWSER: IE_10
dependsOn: Build - template: ci/browser-tests.yml
condition: succeeded() parameters:
steps: name: Browser_Tests_Windows_IE11
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: Npm@0
inputs:
command: install
- task: DownloadBuildArtifacts@0
displayName: 'Download library'
inputs:
artifactName: dist
downloadPath: $(System.DefaultWorkingDirectory)
- task: DownloadBuildArtifacts@0
displayName: 'Download testrunner'
inputs:
artifactName: build
downloadPath: $(System.DefaultWorkingDirectory)
- script: npm run karma
displayName: 'Run Internet Explorer tests - IE 10'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: 'tmp/junit/*.xml'
- task: PublishBuildArtifacts@1
displayName: Upload Screenshots
condition: succeededOrFailed()
inputs:
PathtoPublish: 'tmp/reftests'
artifactName: ReftestResults
- job: Browser_Tests_Windows_IE11
displayName: Windows Internet Explorer 11 displayName: Windows Internet Explorer 11
pool:
vmImage: 'vs2017-win2016' vmImage: 'vs2017-win2016'
variables: targetBrowser: IE_11
TARGET_BROWSER: IE_11
dependsOn: Build
condition: succeeded()
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: Npm@0
inputs:
command: install
- task: DownloadBuildArtifacts@0
displayName: 'Download library'
inputs:
artifactName: dist
downloadPath: $(System.DefaultWorkingDirectory)
- task: DownloadBuildArtifacts@0
displayName: 'Download testrunner'
inputs:
artifactName: build
downloadPath: $(System.DefaultWorkingDirectory)
- script: npm run karma
displayName: 'Run Internet Explorer tests - IE 11'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: 'tmp/junit/*.xml'
- task: PublishBuildArtifacts@1
displayName: Upload Screenshots
condition: succeededOrFailed()
inputs:
PathtoPublish: 'tmp/reftests'
artifactName: ReftestResults

52
ci/browser-tests.yml Normal file
View File

@ -0,0 +1,52 @@
parameters:
name: ''
vmImage: ''
targetBrowser: ''
xvfb: false
jobs:
- job: ${{ parameters.name }}
displayName: ${{ parameters.displayName }}
pool:
vmImage: ${{ parameters.vmImage }}
variables:
TARGET_BROWSER: ${{ parameters.targetBrowser }}
dependsOn: Build
condition: succeeded()
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: Npm@0
inputs:
command: install
- task: DownloadBuildArtifacts@0
displayName: 'Download library'
inputs:
artifactName: dist
downloadPath: $(System.DefaultWorkingDirectory)
- task: DownloadBuildArtifacts@0
displayName: 'Download testrunner'
inputs:
artifactName: build
downloadPath: $(System.DefaultWorkingDirectory)
- ${{ if not(eq(parameters.xvfb, 'true')) }}:
- script: npm run karma
displayName: 'Run browser tests'
- ${{ if eq(parameters.xvfb, 'true') }}:
- script: Xvfb :99 &
displayName: 'Start Xvfb'
- script: DISPLAY=:99 npm run karma
displayName: 'Run browser tests'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: 'tmp/junit/*.xml'
- task: PublishBuildArtifacts@1
displayName: Upload Screenshots
condition: succeededOrFailed()
inputs:
PathtoPublish: 'tmp/reftests'
artifactName: ReftestResults