From fba69b2a9f64f2eef4bedadf4468f985dc73d390 Mon Sep 17 00:00:00 2001 From: usernamealreadyis Date: Fri, 1 Jan 2016 23:52:39 +0700 Subject: [PATCH 01/12] Create clone.git --- clone/clone.git | 1 + 1 file changed, 1 insertion(+) create mode 100644 clone/clone.git diff --git a/clone/clone.git b/clone/clone.git new file mode 100644 index 000000000000..312130412634 --- /dev/null +++ b/clone/clone.git @@ -0,0 +1 @@ +~ $ git@gist.github.com:51ca261c09faafb90c0a.git From 9d28147acb4052c30cb11de08fd8b41ceb05f89d Mon Sep 17 00:00:00 2001 From: Hank Duan Date: Mon, 28 Dec 2015 17:47:49 -0800 Subject: [PATCH 02/12] fix(benchpress): fix flake memory was not allocated to be high enough, resulting in partial results to be clipped, and therefore failing the assertions Closes #6161 --- modules/benchpress/src/firefox_extension/lib/main.ts | 2 +- modules/benchpress/test/firefox_extension/spec.ts | 1 + scripts/ci/test_e2e_js.sh | 5 +---- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/benchpress/src/firefox_extension/lib/main.ts b/modules/benchpress/src/firefox_extension/lib/main.ts index f6214ea001f9..b56dde8f238b 100644 --- a/modules/benchpress/src/firefox_extension/lib/main.ts +++ b/modules/benchpress/src/firefox_extension/lib/main.ts @@ -54,7 +54,7 @@ mod.PageMod({ contentScriptFile: data.url('installed_script.js'), onAttach: worker => { worker.port.on('startProfiler', - (timeStarted) => profiler.start(/* = profiler memory */ 1000000, 0.1, + (timeStarted) => profiler.start(/* = profiler memory */ 3000000, 0.1, ['leaf', 'js', 'stackwalk', 'gc'], timeStarted)); worker.port.on('stopProfiler', () => profiler.stop()); worker.port.on('getProfile', diff --git a/modules/benchpress/test/firefox_extension/spec.ts b/modules/benchpress/test/firefox_extension/spec.ts index 454f7c1cb558..9b9cf24bc217 100644 --- a/modules/benchpress/test/firefox_extension/spec.ts +++ b/modules/benchpress/test/firefox_extension/spec.ts @@ -24,6 +24,7 @@ describe('firefox extension', function() { browser.executeScript('window.startProfiler()') .then(function() { console.log('started measuring perf'); }); + browser.executeAsyncScript('setTimeout(arguments[0], 1000);'); browser.executeScript('window.forceGC()'); browser.executeAsyncScript('var cb = arguments[0]; window.getProfile(cb);') diff --git a/scripts/ci/test_e2e_js.sh b/scripts/ci/test_e2e_js.sh index 6a4047076be8..449a8a423f63 100755 --- a/scripts/ci/test_e2e_js.sh +++ b/scripts/ci/test_e2e_js.sh @@ -30,8 +30,5 @@ fi ./node_modules/.bin/protractor protractor-js.conf.js $OPTIONS ./node_modules/.bin/protractor protractor-js.conf.js $OPTIONS --benchmark --dryrun -# TODO(tbosch): tests for benchpress on firefox are disabled -# as they are very flake. Enable once https://github.com/angular/angular/issues/5611 -# is resolved. -# ./node_modules/.bin/protractor dist/js/cjs/benchpress/test/firefox_extension/conf.js +./node_modules/.bin/protractor dist/js/cjs/benchpress/test/firefox_extension/conf.js From a038bb9ae3a3464ba1f46c1adaabdcdc774577a0 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Tue, 15 Dec 2015 15:58:04 -0800 Subject: [PATCH 03/12] fix(router): preserve specificity for redirects Previously when comparing which of multiple possible routes to choose in an ambiguous case, we looked at the specificity of the target of redirect matches rather than the original match. This meant that if a redirect used a whilecard, but redirected to a target that was a static path, we'd cound the static path's specificity instead of the wildcard. This change stores the specificity of the redirect on the RedirectInstruction. Closes #5933 --- modules/angular2/src/router/instruction.ts | 4 +++- modules/angular2/src/router/route_registry.ts | 2 +- .../integration/impl/fixture_components.ts | 6 ++++++ .../router/integration/redirect_route_spec.ts | 21 ++++++++++++++++++- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/modules/angular2/src/router/instruction.ts b/modules/angular2/src/router/instruction.ts index 815745bd920d..817e91a56da0 100644 --- a/modules/angular2/src/router/instruction.ts +++ b/modules/angular2/src/router/instruction.ts @@ -281,9 +281,11 @@ export class UnresolvedInstruction extends Instruction { export class RedirectInstruction extends ResolvedInstruction { constructor(component: ComponentInstruction, child: Instruction, - auxInstruction: {[key: string]: Instruction}) { + auxInstruction: {[key: string]: Instruction}, private _specificity: string) { super(component, child, auxInstruction); } + + get specificity(): string { return this._specificity; } } diff --git a/modules/angular2/src/router/route_registry.ts b/modules/angular2/src/router/route_registry.ts index dbf757f4a779..5750396c29ed 100644 --- a/modules/angular2/src/router/route_registry.ts +++ b/modules/angular2/src/router/route_registry.ts @@ -205,7 +205,7 @@ export class RouteRegistry { var instruction = this.generate(candidate.redirectTo, ancestorInstructions.concat([null])); return new RedirectInstruction(instruction.component, instruction.child, - instruction.auxInstruction); + instruction.auxInstruction, candidate.specificity); } })); diff --git a/modules/angular2/test/router/integration/impl/fixture_components.ts b/modules/angular2/test/router/integration/impl/fixture_components.ts index 075213bdf67b..5777bf163bda 100644 --- a/modules/angular2/test/router/integration/impl/fixture_components.ts +++ b/modules/angular2/test/router/integration/impl/fixture_components.ts @@ -10,6 +10,12 @@ import { } from 'angular2/router'; import {PromiseWrapper} from 'angular2/src/facade/async'; +@Component({selector: 'goodbye-cmp', template: `{{farewell}}`}) +export class GoodbyeCmp { + farewell: string; + constructor() { this.farewell = 'goodbye'; } +} + @Component({selector: 'hello-cmp', template: `{{greeting}}`}) export class HelloCmp { greeting: string; diff --git a/modules/angular2/test/router/integration/redirect_route_spec.ts b/modules/angular2/test/router/integration/redirect_route_spec.ts index 4c2f195b3dc4..963fc78e3067 100644 --- a/modules/angular2/test/router/integration/redirect_route_spec.ts +++ b/modules/angular2/test/router/integration/redirect_route_spec.ts @@ -25,7 +25,7 @@ import { } from 'angular2/src/router/route_config_decorator'; import {TEST_ROUTER_PROVIDERS, RootCmp, compile} from './util'; -import {HelloCmp, RedirectToParentCmp} from './impl/fixture_components'; +import {HelloCmp, GoodbyeCmp, RedirectToParentCmp} from './impl/fixture_components'; var cmpInstanceCount; var childCmpInstanceCount; @@ -117,5 +117,24 @@ export function main() { async.done(); }); })); + + + it('should not redirect when redirect is less specific than other matching routes', + inject([AsyncTestCompleter, Location], (async, location) => { + compile(tcb) + .then((rtc) => {rootTC = rtc}) + .then((_) => rtr.config([ + new Route({path: '/foo', component: HelloCmp, name: 'Hello'}), + new Route({path: '/:param', component: GoodbyeCmp, name: 'Goodbye'}), + new Redirect({path: '/*rest', redirectTo: ['/Hello']}) + ])) + .then((_) => rtr.navigateByUrl('/bye')) + .then((_) => { + rootTC.detectChanges(); + expect(rootTC.debugElement.nativeElement).toHaveText('goodbye'); + expect(location.urlChanges).toEqual(['/bye']); + async.done(); + }); + })); }); } From b44d36cf955acd81a3e7285ab0e1acbffe8c8dcc Mon Sep 17 00:00:00 2001 From: vsavkin Date: Wed, 16 Dec 2015 15:30:29 -0800 Subject: [PATCH 04/12] fix(forms): fix SelectControlValueAccessor not to call onChange twice Closes #5969 --- .../forms/directives/select_control_value_accessor.ts | 6 +----- modules/angular2/test/common/forms/integration_spec.ts | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/angular2/src/common/forms/directives/select_control_value_accessor.ts b/modules/angular2/src/common/forms/directives/select_control_value_accessor.ts index 230631ddfd7e..2fe527af139e 100644 --- a/modules/angular2/src/common/forms/directives/select_control_value_accessor.ts +++ b/modules/angular2/src/common/forms/directives/select_control_value_accessor.ts @@ -36,11 +36,7 @@ export class NgSelectOption { */ @Directive({ selector: 'select[ngControl],select[ngFormControl],select[ngModel]', - host: { - '(change)': 'onChange($event.target.value)', - '(input)': 'onChange($event.target.value)', - '(blur)': 'onTouched()' - }, + host: {'(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()'}, bindings: [SELECT_VALUE_ACCESSOR] }) export class SelectControlValueAccessor implements ControlValueAccessor { diff --git a/modules/angular2/test/common/forms/integration_spec.ts b/modules/angular2/test/common/forms/integration_spec.ts index 763532012f7c..a2d66e5a08ff 100644 --- a/modules/angular2/test/common/forms/integration_spec.ts +++ b/modules/angular2/test/common/forms/integration_spec.ts @@ -348,7 +348,7 @@ export function main() { expect(sfOption.nativeElement.selected).toBe(true); select.nativeElement.value = 'NYC'; - dispatchEvent(select.nativeElement, "change"); + dispatchEvent(select.nativeElement, "input"); expect(fixture.debugElement.componentInstance.form.value).toEqual({"city": 'NYC'}); expect(sfOption.nativeElement.selected).toBe(false); From 4291758079ca6b312ec8f5b274ead5a8c2f79494 Mon Sep 17 00:00:00 2001 From: mlaval Date: Thu, 10 Dec 2015 14:40:00 +0100 Subject: [PATCH 05/12] build(sauce/bs): make some browsers required in CI Closes #5795 --- .travis.yml | 10 +++--- browser-providers.conf.js | 62 ++++++++++++++++++++++++++------- gulpfile.js | 13 +++++-- karma-js.conf.js | 4 +-- scripts/ci/build_and_test.sh | 6 ++-- scripts/ci/test_browserstack.sh | 4 ++- scripts/ci/test_saucelabs.sh | 4 ++- 7 files changed, 78 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 80d9d7540a51..ec2f2e19121d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,8 +37,10 @@ env: # Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete. - MODE=dart DART_CHANNEL=stable DART_VERSION=$DART_STABLE_VERSION - MODE=dart DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION - - MODE=saucelabs DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION - - MODE=browserstack DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION + - MODE=saucelabs_required DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION + - MODE=browserstack_required DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION + - MODE=saucelabs_optional DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION + - MODE=browserstack_optional DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION - MODE=dart_experimental DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION - MODE=js DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION - MODE=router DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION @@ -48,8 +50,8 @@ env: matrix: allow_failures: - - env: "MODE=saucelabs DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION" - - env: "MODE=browserstack DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION" + - env: "MODE=saucelabs_optional DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION" + - env: "MODE=browserstack_optional DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION" - env: "MODE=dart_experimental DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION" # TODO(alxhub): remove when dartdoc #1039 is in dev channel - env: "MODE=dart DART_CHANNEL=dev DART_VERSION=$DART_DEV_VERSION" diff --git a/browser-providers.conf.js b/browser-providers.conf.js index 5fb1028370fd..37877ce5403f 100644 --- a/browser-providers.conf.js +++ b/browser-providers.conf.js @@ -1,3 +1,32 @@ +// Unique place to configure the browsers which are used in the different CI jobs in Sauce Labs (SL) and BrowserStack (BS). +// 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 out in Travis configuration. +var CIconfiguration = { + 'Chrome': { unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}}, + 'Firefox': { unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}}, + 'ChromeBeta': { unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}}, + 'FirefoxBeta': { unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}}, + 'ChromeDev': { unitTest: {target: null, required: true}, e2e: {target: null, required: true}}, + 'FirefoxDev': { unitTest: {target: null, required: true}, e2e: {target: null, required: true}}, + 'IE9': { unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}}, + 'IE10': { unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}}, + 'IE11': { unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}}, + 'Edge': { unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}}, + 'Android4.1': { unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}}, + 'Android4.2': { unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}}, + 'Android4.3': { unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}}, + 'Android4.4': { unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}}, + 'Android5': { unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}}, + 'Safari7': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}}, + 'Safari8': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}}, + 'Safari9': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}}, + 'iOS7': { unitTest: {target: 'BS', required: true}, e2e: {target: null, required: true}}, + 'iOS8': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}}, + // TODO(mlaval): iOS9 deactivated as not reliable, reactivate after https://github.com/angular/angular/issues/5408 + 'iOS9': { unitTest: {target: null, required: false}, e2e: {target: null, required: true}}, + 'WindowsPhone': { unitTest: {target: 'BS', required: false}, e2e: {target: null, required: true}} +}; + var customLaunchers = { 'DartiumWithWebPlatform': { base: 'Dartium', @@ -47,7 +76,7 @@ var customLaunchers = { platform: 'OS X 10.10', version: '8' }, - 'SL_SAFARI9.0': { + 'SL_SAFARI9': { base: 'SauceLabs', browserName: 'safari', platform: 'OS X 10.11', @@ -119,7 +148,7 @@ var customLaunchers = { platform: 'Linux', version: '4.4' }, - 'SL_ANDROID5.1': { + 'SL_ANDROID5': { base: 'SauceLabs', browserName: 'android', platform: 'Linux', @@ -239,21 +268,18 @@ var customLaunchers = { } }; -// iOS9 deactivated as not reliable in both providers -// TODO(mlaval): reactivate after https://github.com/angular/angular/issues/5408 - var sauceAliases = { 'ALL': Object.keys(customLaunchers).filter(function(item) {return customLaunchers[item].base == 'SauceLabs';}), - 'DESKTOP': ['SL_CHROME', 'SL_FIREFOX', 'SL_IE9', 'SL_IE10', 'SL_IE11', 'SL_EDGE', 'SL_SAFARI7', 'SL_SAFARI8', 'SL_SAFARI9.0'], - 'MOBILE': ['SL_ANDROID4.1', 'SL_ANDROID4.2', 'SL_ANDROID4.3', 'SL_ANDROID4.4', 'SL_ANDROID5.1', 'SL_IOS7', 'SL_IOS8', 'SL_IOS9'], - 'ANDROID': ['SL_ANDROID4.1', 'SL_ANDROID4.2', 'SL_ANDROID4.3', 'SL_ANDROID4.4', 'SL_ANDROID5.1'], + 'DESKTOP': ['SL_CHROME', 'SL_FIREFOX', 'SL_IE9', 'SL_IE10', 'SL_IE11', 'SL_EDGE', 'SL_SAFARI7', 'SL_SAFARI8', 'SL_SAFARI9'], + 'MOBILE': ['SL_ANDROID4.1', 'SL_ANDROID4.2', 'SL_ANDROID4.3', 'SL_ANDROID4.4', 'SL_ANDROID5', 'SL_IOS7', 'SL_IOS8', 'SL_IOS9'], + 'ANDROID': ['SL_ANDROID4.1', 'SL_ANDROID4.2', 'SL_ANDROID4.3', 'SL_ANDROID4.4', 'SL_ANDROID5'], 'IE': ['SL_IE9', 'SL_IE10', 'SL_IE11'], 'IOS': ['SL_IOS7', 'SL_IOS8', 'SL_IOS9'], - 'SAFARI': ['SL_SAFARI7', 'SL_SAFARI8', 'SL_SAFARI9.0'], + 'SAFARI': ['SL_SAFARI7', 'SL_SAFARI8', 'SL_SAFARI9'], 'BETA': ['SL_CHROMEBETA', 'SL_FIREFOXBETA'], 'DEV': ['SL_CHROMEDEV', 'SL_FIREFOXDEV'], - 'CI': ['SL_CHROME',' SL_FIREFOX', 'SL_CHROMEDEV', 'SL_FIREFOXBETA', 'SL_IE9', 'SL_IE10', 'SL_IE11', 'SL_EDGE', - 'SL_ANDROID4.1', 'SL_ANDROID4.2', 'SL_ANDROID4.3', 'SL_ANDROID4.4', 'SL_ANDROID5.1'] + 'CI_REQUIRED': buildConfiguration('unitTest', 'SL', true), + 'CI_OPTIONAL': buildConfiguration('unitTest', 'SL', false) }; var browserstackAliases = { @@ -264,7 +290,8 @@ var browserstackAliases = { 'IE': ['BS_IE9', 'BS_IE10', 'BS_IE11'], 'IOS': ['BS_IOS7', 'BS_IOS8', 'BS_IOS9'], 'SAFARI': ['BS_SAFARI7', 'BS_SAFARI8', 'BS_SAFARI9'], - 'CI': ['BS_SAFARI7', 'BS_SAFARI8', 'BS_SAFARI9', 'BS_IOS7', 'BS_IOS8', 'BS_WINDOWSPHONE'] + 'CI_REQUIRED': buildConfiguration('unitTest', 'BS', true), + 'CI_OPTIONAL': buildConfiguration('unitTest', 'BS', false) }; module.exports = { @@ -277,3 +304,14 @@ if (process.env.TRAVIS) { process.env.SAUCE_ACCESS_KEY = process.env.SAUCE_ACCESS_KEY.split('').reverse().join(''); process.env.BROWSER_STACK_ACCESS_KEY = process.env.BROWSER_STACK_ACCESS_KEY.split('').reverse().join(''); } + +function buildConfiguration(type, target, required) { + return Object.keys(CIconfiguration) + .filter((item) => { + var conf = CIconfiguration[item][type]; + return conf.required === required && conf.target === target; + }) + .map((item) => { + return target + '_' + item.toUpperCase(); + }); +} diff --git a/gulpfile.js b/gulpfile.js index fc8f207995f2..6d2b0aaa0b6d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -720,12 +720,19 @@ gulp.task('test.unit.js/ci', function(done) { }); gulp.task('test.unit.js.sauce/ci', function(done) { - launchKarmaWithExternalBrowsers(['dots', 'saucelabs'], browserProvidersConf.sauceAliases.CI, - done); + var browsers = browserProvidersConf.sauceAliases.CI_REQUIRED; + if (cliArgs.mode && cliArgs.mode == 'saucelabs_optional') { + browsers = browserProvidersConf.sauceAliases.CI_OPTIONAL; + } + launchKarmaWithExternalBrowsers(['dots', 'saucelabs'], browsers, done); }); gulp.task('test.unit.js.browserstack/ci', function(done) { - launchKarmaWithExternalBrowsers(['dots'], browserProvidersConf.browserstackAliases.CI, done); + var browsers = browserProvidersConf.browserstackAliases.CI_REQUIRED; + if (cliArgs.mode && cliArgs.mode == 'browserstack_optional') { + browsers = browserProvidersConf.browserstackAliases.CI_OPTIONAL; + } + launchKarmaWithExternalBrowsers(['dots'], browsers, done); }); gulp.task('test.unit.dart/ci', function(done) { diff --git a/karma-js.conf.js b/karma-js.conf.js index b407d1c12065..f2b1375d1b5d 100644 --- a/karma-js.conf.js +++ b/karma-js.conf.js @@ -79,7 +79,7 @@ module.exports = function(config) { if (process.env.TRAVIS) { var buildId = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')'; - if (process.env.MODE === 'saucelabs') { + if (process.env.MODE.startsWith('saucelabs')) { config.sauceLabs.build = buildId; config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER; @@ -89,7 +89,7 @@ module.exports = function(config) { config.transports = ['polling']; } - if (process.env.MODE === 'browserstack') { + if (process.env.MODE.startsWith('browserstack')) { config.browserStack.build = buildId; config.browserStack.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER; } diff --git a/scripts/ci/build_and_test.sh b/scripts/ci/build_and_test.sh index 0d4c9ce449fe..02ab2c8844c0 100755 --- a/scripts/ci/build_and_test.sh +++ b/scripts/ci/build_and_test.sh @@ -10,8 +10,10 @@ cd $SCRIPT_DIR/../.. if [ "$MODE" = "dart_experimental" ]; then ${SCRIPT_DIR}/build_$MODE.sh -elif [ "$MODE" = "saucelabs" ] || [ "$MODE" = "browserstack" ] ; then - ${SCRIPT_DIR}/test_$MODE.sh +elif [[ $MODE = saucelabs* ]] ; then + ${SCRIPT_DIR}/test_saucelabs.sh $MODE +elif [[ $MODE = browserstack* ]] ; then + ${SCRIPT_DIR}/test_browserstack.sh $MODE elif [ "$MODE" = "lint" ]; then ./node_modules/.bin/gulp static-checks elif [ "$MODE" = "build_only" ]; then diff --git a/scripts/ci/test_browserstack.sh b/scripts/ci/test_browserstack.sh index 9f6c3a834b41..fe918f84dcf5 100755 --- a/scripts/ci/test_browserstack.sh +++ b/scripts/ci/test_browserstack.sh @@ -1,6 +1,8 @@ #!/bin/bash set -e +MODE=$1 + echo ============================================================================= # go to project dir SCRIPT_DIR=$(dirname $0) @@ -9,4 +11,4 @@ cd $SCRIPT_DIR/../.. ./scripts/browserstack/start_tunnel.sh ./scripts/browserstack/waitfor_tunnel.sh ./node_modules/.bin/gulp build.js.dev -./node_modules/.bin/gulp test.unit.js.browserstack/ci +./node_modules/.bin/gulp test.unit.js.browserstack/ci --mode=$MODE diff --git a/scripts/ci/test_saucelabs.sh b/scripts/ci/test_saucelabs.sh index e57c378209c8..8cb59495a990 100755 --- a/scripts/ci/test_saucelabs.sh +++ b/scripts/ci/test_saucelabs.sh @@ -1,6 +1,8 @@ #!/bin/bash set -e +MODE=$1 + echo ============================================================================= # go to project dir SCRIPT_DIR=$(dirname $0) @@ -9,4 +11,4 @@ cd $SCRIPT_DIR/../.. ./scripts/sauce/sauce_connect_setup.sh ./scripts/sauce/sauce_connect_block.sh ./node_modules/.bin/gulp build.js.dev -./node_modules/.bin/gulp test.unit.js.sauce/ci \ No newline at end of file +./node_modules/.bin/gulp test.unit.js.sauce/ci --mode=$MODE From 0b6e75a85eb9b6c14eb0399dd19994d9088827c0 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Sun, 3 Jan 2016 09:18:33 -0800 Subject: [PATCH 06/12] chore(ci): cleanup artifact upload This is no longer needed for g3sync. Closes #6232 --- .travis.yml | 21 --------------------- scripts/ci/build_and_test.sh | 1 - 2 files changed, 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec2f2e19121d..4199ab17b6e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -111,24 +111,3 @@ notifications: slack: secure: EP4MzZ8JMyNQJ4S3cd5LEPWSMjC7ZRdzt3veelDiOeorJ6GwZfCDHncR+4BahDzQAuqyE/yNpZqaLbwRWloDi15qIUsm09vgl/1IyNky1Sqc6lEknhzIXpWSalo4/T9ZP8w870EoDvM/UO+LCV99R3wS8Nm9o99eLoWVb2HIUu0= -deploy: - - provider: gcs - # This is for project angular-github-babysitter - access_key_id: GOOGIOQTDBEOPBUAWFZQ - secret_access_key: - secure: "MEDggllZ5fw4wI9CEUi8WR6jKsKXqdRF/DLxSNC2JpzM5RlVeBm0uqjntYT1Cf1dASvQ2/+vZCUikL/3A48NcoEYRHXGmxu8D6t/SvleQD8Xv434xFOdsa2QqP/HiCtqCLOI5jJz1JVoB5nNyKKZ33ogTUL1LV1TfcrAioyizW8=" - # this bucket has a lifecycle to delete after 90 days: - # $ echo '{"rule": [{"action": {"type": "Delete"}, "condition": {"age": 90}}]}' > lifecycle.json - # $ gsutil lifecycle set lifecycle.json gs://angular2-snapshots - bucket: angular2-snapshots - # don't delete generated files - skip_cleanup: true - # serve to public at https://storage.googleapis.com/angular2-snapshots/SHA/dist.tgz - acl: public-read - # upload the .tgz archive created in scripts/ci/build_and_test.sh - local-dir: deploy - # create a "subdirectory" for each commit - upload-dir: $TRAVIS_COMMIT - on: - repo: angular/angular - condition: "$MODE = build_only" diff --git a/scripts/ci/build_and_test.sh b/scripts/ci/build_and_test.sh index 02ab2c8844c0..35ffaf648333 100755 --- a/scripts/ci/build_and_test.sh +++ b/scripts/ci/build_and_test.sh @@ -19,7 +19,6 @@ elif [ "$MODE" = "lint" ]; then elif [ "$MODE" = "build_only" ]; then ${SCRIPT_DIR}/build_js.sh ${SCRIPT_DIR}/build_dart.sh - mkdir deploy; tar -czpf deploy/dist.tgz -C dist . elif [ "$MODE" = "payload" ]; then source ${SCRIPT_DIR}/env_dart.sh ./node_modules/.bin/gulp test.payload.dart/ci From a08f50badd4397e897192e08909838dd6725fe32 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Tue, 29 Dec 2015 17:01:10 -0800 Subject: [PATCH 07/12] chore(build): allow to run examples and benchmarks without bundles The bundles will only be used if the flag `--useBundles` is passed to `gulp build.js`. --- gulpfile.js | 31 ++++++----- scripts/ci/build_js.sh | 2 +- tools/broccoli/angular_builder.ts | 7 ++- tools/broccoli/html-replace/SCRIPTS.html | 54 +++++++++++++------ .../html-replace/SCRIPTS_benchmarks.html | 52 +++++++++++++----- tools/broccoli/trees/browser_tree.ts | 15 ++++-- 6 files changed, 113 insertions(+), 48 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 6d2b0aaa0b6d..1415c67128df 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -369,7 +369,7 @@ function proxyServeDart() { // ------------------ // web servers -gulp.task('serve.js.dev', ['build.js'], function(neverDone) { +gulp.task('serve.js.dev', ['build.js.dev'], function(neverDone) { var watch = require('./tools/build/watch'); watch('modules/**', {ignoreInitial: true}, '!broccoli.js.dev'); @@ -980,15 +980,19 @@ gulp.task('!build.tools', function() { gulp.task('broccoli.js.dev', ['build.tools'], function(done) { runSequence('!broccoli.js.dev', sequenceComplete(done)); }); -gulp.task( - '!broccoli.js.dev', - () => angularBuilder.rebuildBrowserDevTree( - {generateEs6: generateEs6, projects: cliArgsProjects, noTypeChecks: cliArgs.noTypeChecks})); +gulp.task('!broccoli.js.dev', () => angularBuilder.rebuildBrowserDevTree({ + generateEs6: generateEs6, + projects: cliArgsProjects, + noTypeChecks: cliArgs.noTypeChecks, + useBundles: cliArgs.useBundles +})); -gulp.task( - '!broccoli.js.prod', - () => angularBuilder.rebuildBrowserProdTree( - {generateEs6: generateEs6, projects: cliArgsProjects, noTypeChecks: cliArgs.noTypeChecks})); +gulp.task('!broccoli.js.prod', () => angularBuilder.rebuildBrowserProdTree({ + generateEs6: generateEs6, + projects: cliArgsProjects, + noTypeChecks: cliArgs.noTypeChecks, + useBundles: cliArgs.useBundles +})); gulp.task('build.js.dev', ['build/clean.js'], function(done) { runSequence('broccoli.js.dev', 'build.css.material', sequenceComplete(done)); @@ -1011,9 +1015,12 @@ var firstBuildJsCjs = true; * private task */ gulp.task('!build.js.cjs', function() { - return angularBuilder - .rebuildNodeTree( - {generateEs6: generateEs6, projects: cliArgsProjects, noTypeChecks: cliArgs.noTypeChecks}) + return angularBuilder.rebuildNodeTree({ + generateEs6: generateEs6, + projects: cliArgsProjects, + noTypeChecks: cliArgs.noTypeChecks, + useBundles: cliArgs.useBundles + }) .then(function() { if (firstBuildJsCjs) { firstBuildJsCjs = false; diff --git a/scripts/ci/build_js.sh b/scripts/ci/build_js.sh index 7e9d7ff7379c..78d5b5939347 100755 --- a/scripts/ci/build_js.sh +++ b/scripts/ci/build_js.sh @@ -8,4 +8,4 @@ SCRIPT_DIR=$(dirname $0) source $SCRIPT_DIR/env_dart.sh cd $SCRIPT_DIR/../.. -node --max-old-space-size=2000 ./node_modules/.bin/gulp build.js \ No newline at end of file +node --max-old-space-size=2000 ./node_modules/.bin/gulp build.js --useBundles diff --git a/tools/broccoli/angular_builder.ts b/tools/broccoli/angular_builder.ts index 66a857b6d0ad..032278a9d048 100644 --- a/tools/broccoli/angular_builder.ts +++ b/tools/broccoli/angular_builder.ts @@ -15,6 +15,7 @@ type Options = { projects: ProjectMap; noTypeChecks: boolean; generateEs6: boolean; +useBundles: boolean; } ; @@ -73,7 +74,8 @@ export class AngularBuilder { sourceMaps: true, projects: opts.projects, noTypeChecks: opts.noTypeChecks, - generateEs6: opts.generateEs6 + generateEs6: opts.generateEs6, + useBundles: opts.useBundles }, path.join(this.outputPath, 'js', 'dev')); return new broccoli.Builder(tree); @@ -88,7 +90,8 @@ export class AngularBuilder { sourceMaps: false, projects: opts.projects, noTypeChecks: opts.noTypeChecks, - generateEs6: opts.generateEs6 + generateEs6: opts.generateEs6, + useBundles: opts.useBundles }, path.join(this.outputPath, 'js', 'prod')); return new broccoli.Builder(tree); diff --git a/tools/broccoli/html-replace/SCRIPTS.html b/tools/broccoli/html-replace/SCRIPTS.html index 6f7bea55fb97..2195c9ac9e49 100644 --- a/tools/broccoli/html-replace/SCRIPTS.html +++ b/tools/broccoli/html-replace/SCRIPTS.html @@ -1,26 +1,48 @@ - - - - - - - -