parent
c7346bfdba
commit
c7d1890aaa
|
@ -191,7 +191,7 @@ If the commit reverts a previous commit, it should begin with `revert: `, follow
|
||||||
Must be one of the following:
|
Must be one of the following:
|
||||||
|
|
||||||
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
|
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
|
||||||
* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
|
* **ci**: Changes to our CI configuration files and scripts (example scopes: Circle, BrowserStack, SauceLabs)
|
||||||
* **docs**: Documentation only changes
|
* **docs**: Documentation only changes
|
||||||
* **feat**: A new feature
|
* **feat**: A new feature
|
||||||
* **fix**: A bug fix
|
* **fix**: A bug fix
|
||||||
|
|
|
@ -23,15 +23,6 @@ module.exports = function(config) {
|
||||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||||
},
|
},
|
||||||
|
|
||||||
customLaunchers: {
|
|
||||||
// From the CLI. Not used here but interesting
|
|
||||||
// chrome setup for travis CI using chromium
|
|
||||||
Chrome_travis_ci: {
|
|
||||||
base: 'Chrome',
|
|
||||||
flags: ['--no-sandbox']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
files: [
|
files: [
|
||||||
// System.js for module loading
|
// System.js for module loading
|
||||||
'node_modules/systemjs/dist/system.src.js',
|
'node_modules/systemjs/dist/system.src.js',
|
||||||
|
|
|
@ -23,15 +23,6 @@ module.exports = function(config) {
|
||||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||||
},
|
},
|
||||||
|
|
||||||
customLaunchers: {
|
|
||||||
// From the CLI. Not used here but interesting
|
|
||||||
// chrome setup for travis CI using chromium
|
|
||||||
Chrome_travis_ci: {
|
|
||||||
base: 'Chrome',
|
|
||||||
flags: ['--no-sandbox']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
files: [
|
files: [
|
||||||
// System.js for module loading
|
// System.js for module loading
|
||||||
'node_modules/systemjs/dist/system.src.js',
|
'node_modules/systemjs/dist/system.src.js',
|
||||||
|
|
|
@ -99,7 +99,7 @@ Continuous integration (CI) servers let you set up your project repository so th
|
||||||
There are paid CI services like Circle CI and Travis CI, and you can also host your own for free using Jenkins and others.
|
There are paid CI services like Circle CI and Travis CI, and you can also host your own for free using Jenkins and others.
|
||||||
Although Circle CI and Travis CI are paid services, they are provided free for open source projects.
|
Although Circle CI and Travis CI are paid services, they are provided free for open source projects.
|
||||||
You can create a public project on GitHub and add these services without paying.
|
You can create a public project on GitHub and add these services without paying.
|
||||||
Contributions to the Angular repo are automatically run through a whole suite of Circle CI and Travis CI tests.
|
Contributions to the Angular repo are automatically run through a whole suite of Circle CI tests.
|
||||||
|
|
||||||
This article explains how to configure your project to run Circle CI and Travis CI, and also update your test configuration to be able to run tests in the Chrome browser in either environment.
|
This article explains how to configure your project to run Circle CI and Travis CI, and also update your test configuration to be able to run tests in the Chrome browser in either environment.
|
||||||
|
|
||||||
|
|
|
@ -23,13 +23,6 @@ const LIGHTHOUSE_FLAGS = {logLevel: 'info'};
|
||||||
const SKIPPED_HTTPS_AUDITS = ['redirects-http'];
|
const SKIPPED_HTTPS_AUDITS = ['redirects-http'];
|
||||||
const VIEWER_URL = 'https://googlechrome.github.io/lighthouse/viewer/';
|
const VIEWER_URL = 'https://googlechrome.github.io/lighthouse/viewer/';
|
||||||
|
|
||||||
|
|
||||||
// Specify the path and flags for Chrome on Travis.
|
|
||||||
if (process.env.TRAVIS) {
|
|
||||||
process.env.LIGHTHOUSE_CHROMIUM_PATH = process.env.CHROME_BIN;
|
|
||||||
CHROME_LAUNCH_OPTS.chromeFlags = ['--no-sandbox'];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Be less verbose on CI.
|
// Be less verbose on CI.
|
||||||
if (process.env.CI) {
|
if (process.env.CI) {
|
||||||
LIGHTHOUSE_FLAGS.logLevel = 'error';
|
LIGHTHOUSE_FLAGS.logLevel = 'error';
|
||||||
|
|
|
@ -25,14 +25,8 @@ module.exports = function (config) {
|
||||||
colors: true,
|
colors: true,
|
||||||
logLevel: config.LOG_INFO,
|
logLevel: config.LOG_INFO,
|
||||||
autoWatch: true,
|
autoWatch: true,
|
||||||
browsers: ['CustomChrome'],
|
browsers: ['Chrome'],
|
||||||
browserNoActivityTimeout: 60000,
|
browserNoActivityTimeout: 60000,
|
||||||
singleRun: false,
|
singleRun: false,
|
||||||
customLaunchers: {
|
|
||||||
CustomChrome: {
|
|
||||||
base: 'Chrome',
|
|
||||||
flags: process.env.TRAVIS && ['--no-sandbox']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,11 +10,6 @@ exports.config = {
|
||||||
suite: 'full',
|
suite: 'full',
|
||||||
capabilities: {
|
capabilities: {
|
||||||
browserName: 'chrome',
|
browserName: 'chrome',
|
||||||
// For Travis
|
|
||||||
chromeOptions: {
|
|
||||||
binary: process.env.CHROME_BIN,
|
|
||||||
args: ['--no-sandbox']
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
directConnect: true,
|
directConnect: true,
|
||||||
framework: 'jasmine',
|
framework: 'jasmine',
|
||||||
|
|
|
@ -10,11 +10,6 @@ exports.config = {
|
||||||
],
|
],
|
||||||
capabilities: {
|
capabilities: {
|
||||||
browserName: 'chrome',
|
browserName: 'chrome',
|
||||||
// For Travis
|
|
||||||
chromeOptions: {
|
|
||||||
binary: process.env.CHROME_BIN,
|
|
||||||
args: ['--no-sandbox']
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
directConnect: true,
|
directConnect: true,
|
||||||
baseUrl: 'http://localhost:4200/',
|
baseUrl: 'http://localhost:4200/',
|
||||||
|
|
|
@ -21,7 +21,7 @@ See the [README.md](cli-patches/README.md) for more details.
|
||||||
Many of the documentation pages contain snippets of code examples. We extract these snippets from real
|
Many of the documentation pages contain snippets of code examples. We extract these snippets from real
|
||||||
working example applications, which are stored in subfolders of the `/aio/content/examples` folder. Each
|
working example applications, which are stored in subfolders of the `/aio/content/examples` folder. Each
|
||||||
example can be built and run independently. Each example also provides e2e specs, which are run as part
|
example can be built and run independently. Each example also provides e2e specs, which are run as part
|
||||||
of our Travis build tasks, to verify that the examples continue to work as expected, as changes are made
|
of our CI build tasks, to verify that the examples continue to work as expected, as changes are made
|
||||||
to the core Angular libraries.
|
to the core Angular libraries.
|
||||||
|
|
||||||
In order to build, run and test these examples independently we need to install dependencies into their
|
In order to build, run and test these examples independently we need to install dependencies into their
|
||||||
|
|
|
@ -10,11 +10,6 @@ exports.config = {
|
||||||
],
|
],
|
||||||
capabilities: {
|
capabilities: {
|
||||||
'browserName': 'chrome',
|
'browserName': 'chrome',
|
||||||
// For Travis CI only
|
|
||||||
chromeOptions: {
|
|
||||||
binary: process.env.CHROME_BIN,
|
|
||||||
args: ['--no-sandbox']
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
directConnect: true,
|
directConnect: true,
|
||||||
baseUrl: 'http://localhost:4200/',
|
baseUrl: 'http://localhost:4200/',
|
||||||
|
|
|
@ -21,11 +21,6 @@ exports.config = {
|
||||||
// Capabilities to be passed to the webdriver instance.
|
// Capabilities to be passed to the webdriver instance.
|
||||||
capabilities: {
|
capabilities: {
|
||||||
'browserName': 'chrome',
|
'browserName': 'chrome',
|
||||||
// For Travis
|
|
||||||
chromeOptions: {
|
|
||||||
binary: process.env.CHROME_BIN,
|
|
||||||
args: ['--no-sandbox']
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Framework to use. Jasmine is recommended.
|
// Framework to use. Jasmine is recommended.
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
// and BrowserStack (BS).
|
// and BrowserStack (BS).
|
||||||
// If the target is set to null, then the browser is not run anywhere during CI.
|
// If the target is set to null, then the browser is not run anywhere during CI.
|
||||||
// If a category becomes empty (e.g. BS and required), then the corresponding job must be commented
|
// If a category becomes empty (e.g. BS and required), then the corresponding job must be commented
|
||||||
// out in Travis configuration.
|
// out in the CI configuration.
|
||||||
var CIconfiguration = {
|
var CIconfiguration = {
|
||||||
'Chrome': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
'Chrome': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
||||||
'Firefox': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
'Firefox': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
||||||
|
|
|
@ -136,13 +136,13 @@ http://github.com/angular/core-builds.
|
||||||
|
|
||||||
You may find that your un-merged change needs some validation from external participants.
|
You may find that your un-merged change needs some validation from external participants.
|
||||||
Rather than requiring them to pull your Pull Request and build Angular locally, you can
|
Rather than requiring them to pull your Pull Request and build Angular locally, you can
|
||||||
publish the `*-builds` snapshots just like our Travis build does.
|
publish the `*-builds` snapshots just like our CircleCI build does.
|
||||||
|
|
||||||
First time, you need to create the github repositories:
|
First time, you need to create the github repositories:
|
||||||
|
|
||||||
``` shell
|
``` shell
|
||||||
$ export TOKEN=[get one from https://github.com/settings/tokens]
|
$ export TOKEN=[get one from https://github.com/settings/tokens]
|
||||||
$ CREATE_REPOS=1 TRAVIS= ./scripts/ci/publish-build-artifacts.sh [github username]
|
$ CREATE_REPOS=1 ./scripts/ci/publish-build-artifacts.sh [github username]
|
||||||
```
|
```
|
||||||
|
|
||||||
For subsequent snapshots, just run
|
For subsequent snapshots, just run
|
||||||
|
|
|
@ -27,10 +27,4 @@ export function main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const isBazel = location.pathname.indexOf('/all/') !== 0;
|
main();
|
||||||
// isBazel needed while 'scripts/ci/test-e2e.sh test.e2e.protractor-e2e' is run
|
|
||||||
// on Travis
|
|
||||||
// TODO: port remaining protractor e2e tests to bazel protractor_web_test_suite rule
|
|
||||||
if (isBazel) {
|
|
||||||
main();
|
|
||||||
}
|
|
||||||
|
|
|
@ -10,23 +10,6 @@
|
||||||
// as this could exit node if the help script should be printed.
|
// as this could exit node if the help script should be printed.
|
||||||
require('./dist/all/e2e_util/e2e_util').readCommandLine();
|
require('./dist/all/e2e_util/e2e_util').readCommandLine();
|
||||||
|
|
||||||
var BROWSER_OPTIONS = {
|
|
||||||
LocalChrome: {
|
|
||||||
'browserName': 'chrome',
|
|
||||||
|
|
||||||
// Enables concurrent testing. Currently runs four e2e files in parallel.
|
|
||||||
shardTestFiles: true,
|
|
||||||
maxInstances: 4,
|
|
||||||
},
|
|
||||||
ChromeOnTravis: {
|
|
||||||
browserName: 'chrome',
|
|
||||||
chromeOptions: {
|
|
||||||
'args': ['--no-sandbox'],
|
|
||||||
'binary': process.env.CHROME_BIN,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.config = {
|
exports.config = {
|
||||||
onPrepare: function() { beforeEach(function() { browser.ignoreSynchronization = false; }); },
|
onPrepare: function() { beforeEach(function() { browser.ignoreSynchronization = false; }); },
|
||||||
allScriptsTimeout: 11000,
|
allScriptsTimeout: 11000,
|
||||||
|
@ -36,7 +19,12 @@ exports.config = {
|
||||||
'**/key_events/**', // can't tell why this is failing
|
'**/key_events/**', // can't tell why this is failing
|
||||||
'**/sourcemap/**' // fails only on travis
|
'**/sourcemap/**' // fails only on travis
|
||||||
],
|
],
|
||||||
capabilities: process.env.TRAVIS ? BROWSER_OPTIONS.ChromeOnTravis : BROWSER_OPTIONS.LocalChrome,
|
capabilities: {
|
||||||
|
'browserName': 'chrome',
|
||||||
|
// Enables concurrent testing. Currently runs four e2e files in parallel.
|
||||||
|
shardTestFiles: true,
|
||||||
|
maxInstances: 4,
|
||||||
|
},
|
||||||
directConnect: true,
|
directConnect: true,
|
||||||
baseUrl: 'http://localhost:8000/',
|
baseUrl: 'http://localhost:8000/',
|
||||||
framework: 'jasmine2',
|
framework: 'jasmine2',
|
||||||
|
|
|
@ -13,28 +13,16 @@ require('reflect-metadata');
|
||||||
|
|
||||||
Error.stackTraceLimit = 9999;
|
Error.stackTraceLimit = 9999;
|
||||||
|
|
||||||
var BROWSER_OPTIONS = {
|
|
||||||
LocalChrome: {
|
|
||||||
'browserName': 'chrome',
|
|
||||||
|
|
||||||
// Enables concurrent testing. Currently runs four e2e files in parallel.
|
|
||||||
shardTestFiles: true,
|
|
||||||
maxInstances: 4,
|
|
||||||
},
|
|
||||||
ChromeOnTravis: {
|
|
||||||
browserName: 'chrome',
|
|
||||||
chromeOptions: {
|
|
||||||
'args': ['--no-sandbox'],
|
|
||||||
'binary': process.env.CHROME_BIN,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.config = {
|
exports.config = {
|
||||||
onPrepare: function() { beforeEach(function() { browser.ignoreSynchronization = false; }); },
|
onPrepare: function() { beforeEach(function() { browser.ignoreSynchronization = false; }); },
|
||||||
allScriptsTimeout: 11000,
|
allScriptsTimeout: 11000,
|
||||||
specs: ['dist/examples/**/e2e_test/*_spec.js'],
|
specs: ['dist/examples/**/e2e_test/*_spec.js'],
|
||||||
capabilities: process.env.TRAVIS ? BROWSER_OPTIONS.ChromeOnTravis : BROWSER_OPTIONS.LocalChrome,
|
capabilities: {
|
||||||
|
'browserName': 'chrome',
|
||||||
|
// Enables concurrent testing. Currently runs four e2e files in parallel.
|
||||||
|
shardTestFiles: true,
|
||||||
|
maxInstances: 4,
|
||||||
|
},
|
||||||
directConnect: true,
|
directConnect: true,
|
||||||
baseUrl: 'http://localhost:8001/',
|
baseUrl: 'http://localhost:8001/',
|
||||||
framework: 'jasmine2',
|
framework: 'jasmine2',
|
||||||
|
|
|
@ -17,7 +17,7 @@ const isBazel = !!process.env.RUNFILES;
|
||||||
const BASE = isBazel ? 'angular/modules' : 'dist/all';
|
const BASE = isBazel ? 'angular/modules' : 'dist/all';
|
||||||
require(`./${BASE}/e2e_util/perf_util`).readCommandLine();
|
require(`./${BASE}/e2e_util/perf_util`).readCommandLine();
|
||||||
|
|
||||||
var CHROME_OPTIONS = {
|
const CHROME_OPTIONS = {
|
||||||
'args': ['--js-flags=--expose-gc', '--no-sandbox', '--headless', '--disable-dev-shm-usage'],
|
'args': ['--js-flags=--expose-gc', '--no-sandbox', '--headless', '--disable-dev-shm-usage'],
|
||||||
'perfLoggingPrefs': {
|
'perfLoggingPrefs': {
|
||||||
'traceCategories':
|
'traceCategories':
|
||||||
|
@ -25,8 +25,11 @@ var CHROME_OPTIONS = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var BROWSER_CAPS = {
|
const config = {
|
||||||
LocalChrome: {
|
onPrepare: function() { beforeEach(function() { browser.ignoreSynchronization = false; }); },
|
||||||
|
restartBrowserBetweenTests: true,
|
||||||
|
allScriptsTimeout: 11000,
|
||||||
|
capabilities: {
|
||||||
'browserName': 'chrome',
|
'browserName': 'chrome',
|
||||||
chromeOptions: CHROME_OPTIONS,
|
chromeOptions: CHROME_OPTIONS,
|
||||||
loggingPrefs: {
|
loggingPrefs: {
|
||||||
|
@ -34,30 +37,6 @@ var BROWSER_CAPS = {
|
||||||
browser: 'ALL',
|
browser: 'ALL',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ChromeOnTravis: {
|
|
||||||
browserName: 'chrome',
|
|
||||||
chromeOptions: mergeInto(CHROME_OPTIONS, {
|
|
||||||
'binary': process.env.CHROME_BIN,
|
|
||||||
}),
|
|
||||||
loggingPrefs: {
|
|
||||||
performance: 'ALL',
|
|
||||||
browser: 'ALL',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function mergeInto(src, target) {
|
|
||||||
for (var prop in src) {
|
|
||||||
target[prop] = src[prop];
|
|
||||||
}
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
const config = {
|
|
||||||
onPrepare: function() { beforeEach(function() { browser.ignoreSynchronization = false; }); },
|
|
||||||
restartBrowserBetweenTests: true,
|
|
||||||
allScriptsTimeout: 11000,
|
|
||||||
capabilities: process.env.TRAVIS ? BROWSER_CAPS.ChromeOnTravis : BROWSER_CAPS.LocalChrome,
|
|
||||||
directConnect: true,
|
directConnect: true,
|
||||||
framework: 'jasmine2',
|
framework: 'jasmine2',
|
||||||
jasmineNodeOpts: {
|
jasmineNodeOpts: {
|
||||||
|
|
|
@ -51,7 +51,7 @@ addTimestamp() {
|
||||||
payloadData="$payloadData\"timestamp\": $timestamp, "
|
payloadData="$payloadData\"timestamp\": $timestamp, "
|
||||||
}
|
}
|
||||||
|
|
||||||
# Write travis commit message to global variable `$payloadData`.
|
# Write the commit message for the current CI commit range to global variable `$payloadData`.
|
||||||
# $1: string - The commit range for this build (in `<SHA-1>...<SHA-2>` format).
|
# $1: string - The commit range for this build (in `<SHA-1>...<SHA-2>` format).
|
||||||
addMessage() {
|
addMessage() {
|
||||||
commitRange="$1"
|
commitRange="$1"
|
||||||
|
|
|
@ -2,7 +2,7 @@ All of our npm dependencies are locked via the `yarn.lock` file for the followin
|
||||||
|
|
||||||
- our project has lots of dependencies which update at unpredictable times, so it's important that
|
- our project has lots of dependencies which update at unpredictable times, so it's important that
|
||||||
we update them explicitly once in a while rather than implicitly when any of us runs `yarn install`
|
we update them explicitly once in a while rather than implicitly when any of us runs `yarn install`
|
||||||
- locked dependencies allow us to reuse yarn cache on travis, significantly speeding up our builds
|
- locked dependencies allow us to reuse yarn cache on CircleCI, significantly speeding up our builds
|
||||||
(by 5 minutes or more)
|
(by 5 minutes or more)
|
||||||
- locked dependencies allow us to detect when node_modules folder is out of date after a branch switch
|
- locked dependencies allow us to detect when node_modules folder is out of date after a branch switch
|
||||||
which allows us to build the project with the correct dependencies every time
|
which allows us to build the project with the correct dependencies every time
|
||||||
|
|
Loading…
Reference in New Issue