|
| 1 | +var config = exports.config = require('./protractor-shared.js').config; |
1 | 2 | // load traceur runtime as our tests are written in es6 |
2 | 3 | require('traceur/bin/traceur-runtime.js'); |
3 | 4 |
|
4 | 5 | var cloudReporterConfig; |
5 | | -try { |
6 | | - cloudReporterConfig = require('./perf-cloud-secret.js'); |
7 | | -} catch (e) { |
8 | | - cloudReporterConfig = null; |
| 6 | +if (process.env.CLOUD_SECRET_PATH) { |
| 7 | + console.log('using cloud reporter!'); |
| 8 | + cloudReporterConfig = { |
| 9 | + auth: require(process.env.CLOUD_SECRET_PATH), |
| 10 | + projectId: 'angular-perf', |
| 11 | + datasetId: 'benchmarks' |
| 12 | + }; |
9 | 13 | } |
10 | 14 |
|
11 | | -var config = exports.config = { |
12 | | - |
13 | | - specs: ['dist/cjs/**/*_perf.js'], |
14 | | - |
15 | | - params: { |
16 | | - benchmark: { |
17 | | - // size of the sample to take |
18 | | - sampleSize: 20, |
19 | | - timeout: 20000, |
20 | | - metrics: ['script', 'render', 'gcAmount', 'gcAmountInScript', 'gcTime'], |
21 | | - // forces a gc after every run |
22 | | - forceGc: false, |
23 | | - reporters: [ |
24 | | - require('./dist/cjs/tools/benchpress/src/console_reporter.js'), |
25 | | - cloudReporterConfig ? require('./dist/cjs/tools/benchpress/src/cloud_reporter.js') : null, |
26 | | - ], |
27 | | - cloudReporter: cloudReporterConfig |
28 | | - } |
29 | | - }, |
30 | | - |
31 | | - // Disable waiting for Angular as we don't have an integration layer yet... |
32 | | - // TODO(tbosch): Implement a proper debugging API for Ng2.0, remove this here |
33 | | - // and the sleeps in all tests. |
34 | | - onPrepare: function() { |
35 | | - browser.ignoreSynchronization = true; |
36 | | - var _get = browser.get; |
37 | | - var sleepInterval = process.env.TRAVIS ? 5000 : 2000; |
38 | | - browser.get = function() { |
39 | | - var result = _get.apply(this, arguments); |
40 | | - browser.sleep(sleepInterval); |
41 | | - return result; |
42 | | - } |
43 | | - }, |
44 | | - |
45 | | - jasmineNodeOpts: { |
46 | | - showColors: true, |
47 | | - defaultTimeoutInterval: 30000 |
| 15 | +config.specs = ['dist/cjs/**/*_perf.js']; |
| 16 | +config.params = { |
| 17 | + benchmark: { |
| 18 | + // size of the sample to take |
| 19 | + sampleSize: 20, |
| 20 | + timeout: 20000, |
| 21 | + metrics: ['script', 'render', 'gcAmount', 'gcAmountInScript', 'gcTime'], |
| 22 | + // forces a gc after every run |
| 23 | + forceGc: false, |
| 24 | + reporters: [ |
| 25 | + require('./dist/cjs/tools/benchpress/src/console_reporter.js'), |
| 26 | + cloudReporterConfig ? require('./dist/cjs/tools/benchpress/src/cloud_reporter.js') : null, |
| 27 | + ], |
| 28 | + cloudReporter: cloudReporterConfig, |
| 29 | + scaling: [{ |
| 30 | + browserName: /chrome/, value: 0.5 |
| 31 | + }] |
48 | 32 | } |
49 | 33 | }; |
50 | | - |
51 | | -// TODO: add real mobile devices via a cloud provider that supports appium |
52 | | -if (process.env.TRAVIS) { |
53 | | - config.capabilities = { |
54 | | - name: 'Dartium', |
55 | | - browserName: 'chrome', |
56 | | - chromeOptions: { |
57 | | - 'binary': process.env.DARTIUM, |
58 | | - 'args': ['--js-flags=--expose-gc'] |
59 | | - }, |
60 | | - loggingPrefs: { |
61 | | - performance: 'ALL' |
62 | | - } |
63 | | - }; |
64 | | -} else { |
65 | | - config.capabilities = { |
66 | | - browserName: 'chrome', |
67 | | - chromeOptions: { |
68 | | - 'args': ['--js-flags=--expose-gc'] |
69 | | - }, |
70 | | - loggingPrefs: { |
71 | | - performance: 'ALL' |
72 | | - } |
73 | | - }; |
74 | | -} |
0 commit comments