forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(build): support multiple configurable browsers for e2e and p…
…erf tests Also includes browser configuration for Android
- Loading branch information
Showing
19 changed files
with
226 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
module.exports = { | ||
auth: { | ||
"private_key_id": "1234", | ||
"private_key": "-----BEGIN PRIVATE KEY-----SOME PRIVATE KEY-----END PRIVATE KEY-----\n", | ||
"client_email": "[email protected]", | ||
"client_id": "SOME_ID", | ||
"type": "service_account" | ||
}, | ||
projectId: 'angular-perf', | ||
datasetId: 'benchmarks' | ||
"private_key_id": "1234", | ||
"private_key": "-----BEGIN PRIVATE KEY-----SOME PRIVATE KEY-----END PRIVATE KEY-----\n", | ||
"client_email": "[email protected]", | ||
"client_id": "SOME_ID", | ||
"type": "service_account" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,2 @@ | ||
// load traceur runtime as our tests are written in es6 | ||
require('traceur/bin/traceur-runtime.js'); | ||
|
||
var config = exports.config = { | ||
|
||
specs: ['dist/cjs/**/*_spec.js'], | ||
|
||
// Disable waiting for Angular as we don't have an integration layer yet... | ||
// TODO(tbosch): Implement a proper debugging API for Ng2.0, remove this here | ||
// and the sleeps in all tests. | ||
onPrepare: function() { | ||
browser.ignoreSynchronization = true; | ||
var _get = browser.get; | ||
var sleepInterval = process.env.TRAVIS ? 5000 : 2000; | ||
browser.get = function() { | ||
var result = _get.apply(this, arguments); | ||
browser.sleep(sleepInterval); | ||
return result; | ||
} | ||
}, | ||
|
||
jasmineNodeOpts: { | ||
showColors: true, | ||
defaultTimeoutInterval: 30000 | ||
} | ||
}; | ||
|
||
if (process.env.TRAVIS) { | ||
config.capabilities = { | ||
name: 'Dartium', | ||
browserName: 'chrome', | ||
chromeOptions: { | ||
'binary': process.env.DARTIUM | ||
}, | ||
loggingPrefs: { | ||
performance: 'ALL' | ||
} | ||
}; | ||
} else { | ||
config.capabilities = { | ||
browserName: 'chrome', | ||
loggingPrefs: { | ||
performance: 'ALL' | ||
} | ||
}; | ||
} | ||
var config = exports.config = require('./protractor-shared.js').config; | ||
config.specs = ['dist/cjs/**/*_spec.js']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
var config = exports.config = require('./protractor-perf-shared.js').config; | ||
config.params.lang = 'dart'; | ||
config.baseUrl = 'http://localhost:8002/'; | ||
config.params.lang = 'dart'; | ||
// TODO: remove this line when largetable dart has been added | ||
config.exclude = config.exclude || []; | ||
config.exclude.push('dist/cjs/e2e_test/benchmarks_external/e2e_test/largetable_perf.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
var config = exports.config = require('./protractor-perf-shared.js').config; | ||
config.params.lang = 'js'; | ||
config.baseUrl = 'http://localhost:8001/'; | ||
|
||
config.params.lang = 'js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,33 @@ | ||
var config = exports.config = require('./protractor-shared.js').config; | ||
// load traceur runtime as our tests are written in es6 | ||
require('traceur/bin/traceur-runtime.js'); | ||
|
||
var cloudReporterConfig; | ||
try { | ||
cloudReporterConfig = require('./perf-cloud-secret.js'); | ||
} catch (e) { | ||
cloudReporterConfig = null; | ||
if (process.env.CLOUD_SECRET_PATH) { | ||
console.log('using cloud reporter!'); | ||
cloudReporterConfig = { | ||
auth: require(process.env.CLOUD_SECRET_PATH), | ||
projectId: 'angular-perf', | ||
datasetId: 'benchmarks' | ||
}; | ||
} | ||
|
||
var config = exports.config = { | ||
|
||
specs: ['dist/cjs/**/*_perf.js'], | ||
|
||
params: { | ||
benchmark: { | ||
// size of the sample to take | ||
sampleSize: 20, | ||
timeout: 20000, | ||
metrics: ['script', 'render', 'gcAmount', 'gcAmountInScript', 'gcTime'], | ||
// forces a gc after every run | ||
forceGc: false, | ||
reporters: [ | ||
require('./dist/cjs/tools/benchpress/src/console_reporter.js'), | ||
cloudReporterConfig ? require('./dist/cjs/tools/benchpress/src/cloud_reporter.js') : null, | ||
], | ||
cloudReporter: cloudReporterConfig | ||
} | ||
}, | ||
|
||
// Disable waiting for Angular as we don't have an integration layer yet... | ||
// TODO(tbosch): Implement a proper debugging API for Ng2.0, remove this here | ||
// and the sleeps in all tests. | ||
onPrepare: function() { | ||
browser.ignoreSynchronization = true; | ||
var _get = browser.get; | ||
var sleepInterval = process.env.TRAVIS ? 5000 : 2000; | ||
browser.get = function() { | ||
var result = _get.apply(this, arguments); | ||
browser.sleep(sleepInterval); | ||
return result; | ||
} | ||
}, | ||
|
||
jasmineNodeOpts: { | ||
showColors: true, | ||
defaultTimeoutInterval: 30000 | ||
config.specs = ['dist/cjs/**/*_perf.js']; | ||
config.params = { | ||
benchmark: { | ||
// size of the sample to take | ||
sampleSize: 20, | ||
timeout: 20000, | ||
metrics: ['script', 'render', 'gcAmount', 'gcAmountInScript', 'gcTime'], | ||
// forces a gc after every run | ||
forceGc: false, | ||
reporters: [ | ||
require('./dist/cjs/tools/benchpress/src/console_reporter.js'), | ||
cloudReporterConfig ? require('./dist/cjs/tools/benchpress/src/cloud_reporter.js') : null, | ||
], | ||
cloudReporter: cloudReporterConfig, | ||
scaling: [{ | ||
browserName: /chrome/, value: 0.5 | ||
}] | ||
} | ||
}; | ||
|
||
// TODO: add real mobile devices via a cloud provider that supports appium | ||
if (process.env.TRAVIS) { | ||
config.capabilities = { | ||
name: 'Dartium', | ||
browserName: 'chrome', | ||
chromeOptions: { | ||
'binary': process.env.DARTIUM, | ||
'args': ['--js-flags=--expose-gc'] | ||
}, | ||
loggingPrefs: { | ||
performance: 'ALL' | ||
} | ||
}; | ||
} else { | ||
config.capabilities = { | ||
browserName: 'chrome', | ||
chromeOptions: { | ||
'args': ['--js-flags=--expose-gc'] | ||
}, | ||
loggingPrefs: { | ||
performance: 'ALL' | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// load traceur runtime as our tests are written in es6 | ||
require('traceur/bin/traceur-runtime.js'); | ||
var cmdArgs = require('minimist')(process.argv); | ||
var cmdLineBrowsers = cmdArgs.browsers ? cmdArgs.browsers.split(',') : []; | ||
|
||
var config = exports.config = { | ||
// Disable waiting for Angular as we don't have an integration layer yet... | ||
// TODO(tbosch): Implement a proper debugging API for Ng2.0, remove this here | ||
// and the sleeps in all tests. | ||
onPrepare: function() { | ||
browser.ignoreSynchronization = true; | ||
var _get = browser.get; | ||
var sleepInterval = process.env.TRAVIS || process.env.JENKINS_URL ? 5000 : 2000; | ||
browser.get = function() { | ||
var result = _get.apply(this, arguments); | ||
browser.sleep(sleepInterval); | ||
return result; | ||
} | ||
}, | ||
|
||
jasmineNodeOpts: { | ||
showColors: true, | ||
defaultTimeoutInterval: 30000 | ||
} | ||
}; | ||
|
||
var POSSIBLE_CAPS = { | ||
Dartium: { | ||
name: 'Dartium', | ||
browserName: 'chrome', | ||
chromeOptions: { | ||
'binary': process.env.DARTIUM, | ||
'args': ['--js-flags=--expose-gc'] | ||
}, | ||
loggingPrefs: { | ||
performance: 'ALL' | ||
} | ||
}, | ||
ChromeDesktop: { | ||
browserName: 'chrome', | ||
chromeOptions: { | ||
'args': ['--js-flags=--expose-gc'] | ||
}, | ||
loggingPrefs: { | ||
performance: 'ALL' | ||
} | ||
}, | ||
ChromeAndroid: { | ||
browserName: 'chrome', | ||
chromeOptions: { | ||
androidPackage: 'com.android.chrome', | ||
'args': ['--js-flags=--expose-gc'] | ||
}, | ||
loggingPrefs: { | ||
performance: 'ALL' | ||
} | ||
} | ||
}; | ||
if (cmdLineBrowsers.length) { | ||
config.multiCapabilities = cmdLineBrowsers.map(function(browserName) { | ||
var caps = POSSIBLE_CAPS[browserName]; | ||
if (!caps) { | ||
throw new Error('Not configured browser name: '+browserName); | ||
} | ||
return caps; | ||
}); | ||
} else { | ||
config.multiCapabilities = [POSSIBLE_CAPS.ChromeDesktop]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo ============================================================================= | ||
# go to project dir | ||
SCRIPT_DIR=$(dirname $0) | ||
source $SCRIPT_DIR/env_dart.sh | ||
cd $SCRIPT_DIR/../.. | ||
|
||
./node_modules/.bin/gulp build | ||
|
||
pub install |
0
scripts/env.sh → scripts/ci/env_dart.sh
100644 → 100755
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [[ $PERF_BROWSERS =~ .*Android.* || $E2E_BROWSERS =~ .*Android.* ]] | ||
then | ||
adb usb | ||
adb wait-for-device devices | ||
adb reverse tcp:8001 tcp:8001 | ||
adb reverse tcp:8002 tcp:8002 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo ============================================================================= | ||
# go to project dir | ||
SCRIPT_DIR=$(dirname $0) | ||
source $SCRIPT_DIR/env_dart.sh | ||
cd $SCRIPT_DIR/../.. | ||
|
||
./node_modules/.bin/webdriver-manager update | ||
|
||
function killServer () { | ||
kill $serverPid | ||
} | ||
|
||
./node_modules/.bin/gulp serve.js.prod serve.js.dart2js& | ||
serverPid=$! | ||
|
||
trap killServer EXIT | ||
|
||
if [[ $PERF_BROWSERS =~ .*Android.* ]] | ||
then | ||
adb usb | ||
adb wait-for-device | ||
adb reverse tcp:8001 tcp:8001 | ||
adb reverse tcp:8002 tcp:8002 | ||
fi | ||
|
||
./node_modules/.bin/protractor protractor-e2e-js.conf.js --browsers=$E2E_BROWSERS | ||
./node_modules/.bin/protractor protractor-e2e-dart2js.conf.js --browsers=$E2E_BROWSERS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo ============================================================================= | ||
# go to project dir | ||
SCRIPT_DIR=$(dirname $0) | ||
source $SCRIPT_DIR/env_dart.sh | ||
cd $SCRIPT_DIR/../.. | ||
|
||
./node_modules/.bin/webdriver-manager update | ||
|
||
function killServer () { | ||
kill $serverPid | ||
} | ||
|
||
./node_modules/.bin/gulp serve.js.prod serve.js.dart2js& | ||
serverPid=$! | ||
|
||
trap killServer EXIT | ||
|
||
./node_modules/.bin/protractor protractor-perf-js.conf.js --browsers=$PERF_BROWSERS | ||
./node_modules/.bin/protractor protractor-perf-dart2js.conf.js --browsers=$PERF_BROWSERS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo ============================================================================= | ||
# go to project dir | ||
SCRIPT_DIR=$(dirname $0) | ||
source $SCRIPT_DIR/env_dart.sh | ||
cd $SCRIPT_DIR/../.. | ||
|
||
./node_modules/karma/bin/karma start karma-js.conf \ | ||
--reporters=dots \ | ||
--browsers=$KARMA_BROWSERS --single-run | ||
./node_modules/karma/bin/karma start karma-dart.conf \ | ||
--reporters=dots \ | ||
--browsers=$KARMA_BROWSERS --single-run |
Oops, something went wrong.