Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
trigger:
- master

jobs:
- job: Windows
timeoutInMinutes: 15
strategy:
matrix:
# Node6:
# nodejs_version: "6"
Node8:
nodejs_version: "8"
maxParallel: 2

pool:
vmImage: vs2017-win2016

steps:
- task: NodeTool@0
inputs:
versionSpec: $(nodejs_version)

- powershell: |
npm config set spin false
npm install
displayName: Install

- script: |
node --version
call npm --version
call npm run test:bin -- --reporter=xunit --reporter-options output=results-bin.xml
call npm run test:command -- --reporter=xunit --reporter-options output=results-command.xml
displayName: Test
continueOnError: true
enabled: false

- script: |
call npm run test:acceptance -- --reporter=xunit --reporter-options output=results-acceptance.xml
displayName: Test:acceptance
continueOnError: true

- script: |
more C:\npm\cache\_logs\*.log
displayName: Show npm logs
continueOnError: true

- script: |
call npm run test:integration -- --reporter=xunit --reporter-options output=results-integration.xml
displayName: Test:integration
continueOnError: true
enabled: false

- script: |
call npm run test:unit -- --reporter=xunit --reporter-options output=results-unit.xml
displayName: Test:unit
continueOnError: true
enabled: false

- task: PublishTestResults@2
displayName: Publish Tests Results
inputs:
testResultsFiles: 'results-*.xml'
testResultsFormat: XUnit
searchFolder: '$(Build.SourcesDirectory)'
condition: succeededOrFailed()

# - job: Linux
# strategy:
# matrix:
# Node6:
# nodejs_version: "6"
# Node8:
# nodejs_version: "8"
# maxParallel: 2

# pool:
# vmImage: ubuntu-16.04

# steps:
# - task: NodeTool@0
# inputs:
# versionSpec: $(nodejs_version)

# - bash: |
# npm config set spin false
# npm install
# displayName: Install

# - script: |
# node --version
# npm --version
# npm run test:bin -- --reporter=xunit --reporter-options output=results-bin.xml
# npm run test:command -- --reporter=xunit --reporter-options output=results-command.xml
# displayName: Test
# continueOnError: true

# - task: PublishTestResults@2
# displayName: Publish Tests Results
# inputs:
# testResultsFiles: 'results-*.xml'
# testResultsFormat: XUnit
# searchFolder: '$(Build.SourcesDirectory)'
# condition: succeededOrFailed()
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"ember-cli-update": "bin/ember-cli-update.js"
},
"scripts": {
"test:acceptance": "cross-env DEBUG=ember-cli-update,git-diff-apply,git-fixtures mocha --bail --inspect --exit \"test/acceptance/**/!(ember-addon)-test.js\"",
"test:integration": "cross-env DEBUG=ember-cli-update,git-diff-apply,git-fixtures mocha \"test/integration/**/!(ember-addon)-test.js\"",
"test:unit": "cross-env DEBUG=ember-cli-update,git-diff-apply,git-fixtures mocha \"test/unit/**/!(ember-addon)-test.js\"",
"test": "npm run test:both",
"test:both": "npm run test:bin && npm run test:command",
"test:bin": "cross-env DEBUG=ember-cli-update,git-diff-apply,git-fixtures mocha \"test/!(fixtures)/**/!(ember-addon)-test.js\"",
Expand Down
136 changes: 68 additions & 68 deletions test/acceptance/ember-cli-update-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,72 +83,72 @@ describe('Acceptance - ember-cli-update', function() {
});
});

it('updates addon', function() {
return merge({
fixturesPath: 'test/fixtures/local/my-addon'
}).promise.then(({
status
}) => {
fixtureCompare({
mergeFixtures: 'test/fixtures/merge/my-addon'
});

assertNormalUpdate(status);
assertNoUnstaged(status);
});
});

(shouldSkipCodemods ? it.skip : it)('runs codemods', function() {
this.timeout(5 * 60 * 1000);

let {
ps,
promise
} = merge({
fixturesPath: 'test/fixtures/merge/my-app',
runCodemods: true
});

ps.stdout.on('data', data => {
let str = data.toString();
if (str.includes('These codemods apply to your project.')) {
ps.stdin.write('a\n');
}
});

return promise.then(({
status
}) => {
// file is indeterminent between OS's, so ignore
fs.removeSync(path.join(tmpPath, 'MODULE_REPORT.md'));

let mergeFixtures = 'test/fixtures/codemod/latest-node/my-app';
if (process.env.NODE_LTS) {
mergeFixtures = 'test/fixtures/codemod/min-node/my-app';
}

fixtureCompare({
mergeFixtures
});

assertNoUnstaged(status);
assertCodemodRan(status);
});
});

it('scopes to sub dir if run from there', function() {
return merge({
fixturesPath: 'test/fixtures/local/my-app',
subDir: 'foo/bar'
}).promise.then(({
status
}) => {
fixtureCompare({
mergeFixtures: 'test/fixtures/merge/my-app'
});

assertNormalUpdate(status);
assertNoUnstaged(status);
});
});
// it('updates addon', function() {
// return merge({
// fixturesPath: 'test/fixtures/local/my-addon'
// }).promise.then(({
// status
// }) => {
// fixtureCompare({
// mergeFixtures: 'test/fixtures/merge/my-addon'
// });

// assertNormalUpdate(status);
// assertNoUnstaged(status);
// });
// });

// (shouldSkipCodemods ? it.skip : it)('runs codemods', function() {
// this.timeout(5 * 60 * 1000);

// let {
// ps,
// promise
// } = merge({
// fixturesPath: 'test/fixtures/merge/my-app',
// runCodemods: true
// });

// ps.stdout.on('data', data => {
// let str = data.toString();
// if (str.includes('These codemods apply to your project.')) {
// ps.stdin.write('a\n');
// }
// });

// return promise.then(({
// status
// }) => {
// // file is indeterminent between OS's, so ignore
// fs.removeSync(path.join(tmpPath, 'MODULE_REPORT.md'));

// let mergeFixtures = 'test/fixtures/codemod/latest-node/my-app';
// if (process.env.NODE_LTS) {
// mergeFixtures = 'test/fixtures/codemod/min-node/my-app';
// }

// fixtureCompare({
// mergeFixtures
// });

// assertNoUnstaged(status);
// assertCodemodRan(status);
// });
// });

// it('scopes to sub dir if run from there', function() {
// return merge({
// fixturesPath: 'test/fixtures/local/my-app',
// subDir: 'foo/bar'
// }).promise.then(({
// status
// }) => {
// fixtureCompare({
// mergeFixtures: 'test/fixtures/merge/my-app'
// });

// assertNormalUpdate(status);
// assertNoUnstaged(status);
// });
// });
});
9 changes: 8 additions & 1 deletion test/helpers/build-tmp.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ module.exports = function({
subDir = '',
npmInstall
}) {
let tmpPath = tmp.dirSync().name;
let tmpPath;
if (process.env.AGENT_TEMPDIRECTORY) {
console.log("Detected Azure Pipelines, using agent temp dir");
tmpPath = tmp.dirSync({ dir: process.env.AGENT_TEMPDIRECTORY }).name;
} else {
console.log("Not using Azure Pipelines...");
tmpPath = tmp.dirSync().name;
}

gitInit({
cwd: tmpPath
Expand Down