Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge 1676293 into 44d1273
Browse files Browse the repository at this point in the history
  • Loading branch information
daviwil committed Oct 10, 2018
2 parents 44d1273 + 1676293 commit e626c28
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 12 deletions.
111 changes: 111 additions & 0 deletions .vsts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
jobs:
- job: Linux
pool:
vmImage: ubuntu-16.04
variables:
display: ":99"
steps:
- bash: |
curl -s -L "https://atom.io/download/deb?channel=dev" \
-H 'Accept: application/octet-stream' \
-o 'atom-amd64.deb'
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
sudo apt-get update && sudo apt-get install -yyq libgconf-2-4 build-essential git libsecret-1-dev
dpkg-deb -x atom-amd64.deb /tmp/atom
displayName: install Atom
- bash: /tmp/atom/usr/share/atom-dev/resources/app/apm/bin/apm ci
displayName: install dependencies
- bash: /tmp/atom/usr/bin/atom-dev --test test/
displayName: run tests
continueOnError: true
env:
TEST_JUNIT_XML_PATH: $(Agent.HomeDirectory)/test-results.xml
FORCE_COLOR: 0
- task: PublishTestResults@2
inputs:
testResultsFormat: JUnit
testResultsFiles: $(Agent.HomeDirectory)/test-results.xml
testRunTitle: Linux

- job: MacOS
pool:
vmImage: macos-10.13
steps:
- bash: |
set -x
curl -s -L "https://atom.io/download/mac?channel=dev" \
-H 'Accept: application/octet-stream' \
-o "atom.zip"
mkdir -p /tmp/atom
unzip -q atom.zip -d /tmp/atom
displayName: install Atom
- bash: /tmp/atom/Atom\ Dev.app/Contents/Resources/app/apm/bin/apm ci
displayName: install dependencies
- bash: /tmp/atom/Atom\ Dev.app/Contents/Resources/app/atom.sh --test test/
displayName: run tests
continueOnError: true
env:
TEST_JUNIT_XML_PATH: $(Agent.HomeDirectory)/test-results.xml
FORCE_COLOR: 0
- task: PublishTestResults@2
inputs:
testResultsFormat: JUnit
testResultsFiles: $(Agent.HomeDirectory)/test-results.xml
testRunTitle: MacOS

- job: Windows
pool:
vmImage: vs2015-win2012r2
steps:
- powershell: |
Set-StrictMode -Version Latest
$script:ATOMROOT = "$env:AGENT_HOMEDIRECTORY/atom"
Write-Host "Downloading latest Atom release"
$source = "https://atom.io/download/windows_zip?channel=dev"
$destination = "atom.zip"
(New-Object System.Net.WebClient).DownloadFile($source, $destination)
Expand-Archive -Path "atom.zip" -DestinationPath $script:ATOMROOT
displayName: install Atom
- powershell: |
Set-StrictMode -Version Latest
$script:ATOMROOT = "$env:AGENT_HOMEDIRECTORY/atom"
$script:APM_SCRIPT_PATH = "$script:ATOMROOT\Atom Dev\resources\app\apm\bin\apm.cmd"
Write-Host "Installing package dependencies"
& "$script:APM_SCRIPT_PATH" ci
if ($LASTEXITCODE -ne 0) {
Write-Host "Dependency installation failed"
$host.SetShouldExit($LASTEXITCODE)
exit
}
displayName: install dependencies
- powershell: |
Set-StrictMode -Version Latest
$script:ATOMROOT = "$env:AGENT_HOMEDIRECTORY/atom"
$script:ATOM_SCRIPT_PATH = "$script:ATOMROOT\Atom Dev\resources\cli\atom.cmd"
$env:ELECTRON_NO_ATTACH_CONSOLE = "true"
[Environment]::SetEnvironmentVariable("ELECTRON_NO_ATTACH_CONSOLE", "true", "User")
$env:ELECTRON_ENABLE_LOGGING = "YES"
[Environment]::SetEnvironmentVariable("ELECTRON_ENABLE_LOGGING", "YES", "User")
Write-Host "Running tests"
& "$script:ATOM_SCRIPT_PATH" --test test 2>&1 | %{ "$_" }
if ($LASTEXITCODE -ne 0) {
Write-Host "Specs Failed"
$host.SetShouldExit($LASTEXITCODE)
exit
}
displayName: run tests
continueOnError: true
env:
TEST_JUNIT_XML_PATH: $(Agent.HomeDirectory)/test-results.xml
FORCE_COLOR: 0
- task: PublishTestResults@2
inputs:
testResultsFormat: JUnit
testResultsFiles: $(Agent.HomeDirectory)/test-results.xml
testRunTitle: Windows
59 changes: 59 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"mkdirp": "0.5.1",
"mocha": "^5.2.0",
"mocha-appveyor-reporter": "0.4.1",
"mocha-junit-reporter": "1.18.0",
"mocha-multi-reporters": "^1.1.7",
"mocha-stress": "1.0.0",
"node-fetch": "2.2.0",
Expand Down
17 changes: 5 additions & 12 deletions test/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,11 @@ module.exports = createRunner({

if (process.env.TEST_JUNIT_XML_PATH) {
mocha.reporter(require('mocha-multi-reporters'), {
reportersEnabled: 'xunit, list',
xunitReporterOptions: {
output: process.env.TEST_JUNIT_XML_PATH,
},
});
} else if (process.env.APPVEYOR_API_URL) {
mocha.reporter(require('mocha-appveyor-reporter'));
} else if (process.env.CIRCLECI === 'true') {
mocha.reporter(require('mocha-multi-reporters'), {
reportersEnabled: 'xunit, list',
xunitReporterOptions: {
output: path.join('test-results', 'mocha', 'test-results.xml'),
reportersEnabled: 'junit, list',
junitReporterOptions: {
mochaFile: process.env.TEST_JUNIT_XML_PATH,
useFullSuiteTitle: true,
suiteTitleSeparedBy: ' / ',
},
});
}
Expand Down

0 comments on commit e626c28

Please sign in to comment.