test-base 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- test_base/__init__.py +20 -0
- test_base/adapters/__init__.py +354 -0
- test_base/adapters/base.py +263 -0
- test_base/adapters/canonical_json.py +1088 -0
- test_base/adapters/junit_xml.py +1272 -0
- test_base/api/__init__.py +0 -0
- test_base/api/app.py +314 -0
- test_base/api/deps.py +178 -0
- test_base/api/routes/__init__.py +0 -0
- test_base/api/routes/failures.py +104 -0
- test_base/api/routes/health.py +35 -0
- test_base/api/routes/imports.py +143 -0
- test_base/api/routes/queries.py +295 -0
- test_base/api/routes/retention.py +130 -0
- test_base/api/routes/runs.py +147 -0
- test_base/api/routes/server.py +65 -0
- test_base/api/routes/stream.py +117 -0
- test_base/api/schemas.py +390 -0
- test_base/api/security.py +183 -0
- test_base/cli/__init__.py +125 -0
- test_base/cli/commands/__init__.py +0 -0
- test_base/cli/commands/db.py +76 -0
- test_base/cli/commands/demo.py +103 -0
- test_base/cli/commands/formats.py +41 -0
- test_base/cli/commands/ingest.py +119 -0
- test_base/cli/commands/init.py +738 -0
- test_base/cli/commands/prune.py +146 -0
- test_base/cli/commands/publish.py +133 -0
- test_base/cli/commands/serve.py +118 -0
- test_base/cli/commands/token.py +97 -0
- test_base/cli/options.py +189 -0
- test_base/cli/render.py +223 -0
- test_base/config.py +519 -0
- test_base/demo/__init__.py +0 -0
- test_base/demo/evidence.py +447 -0
- test_base/demo/seed.py +628 -0
- test_base/domain/__init__.py +61 -0
- test_base/domain/events.py +422 -0
- test_base/domain/failures.py +327 -0
- test_base/domain/identity.py +205 -0
- test_base/domain/metrics.py +176 -0
- test_base/domain/models.py +947 -0
- test_base/domain/status.py +246 -0
- test_base/errors.py +136 -0
- test_base/logging.py +174 -0
- test_base/py.typed +0 -0
- test_base/sdk/__init__.py +28 -0
- test_base/sdk/client.py +607 -0
- test_base/service/__init__.py +0 -0
- test_base/service/bus.py +331 -0
- test_base/service/coalesce.py +133 -0
- test_base/service/imports.py +552 -0
- test_base/service/retention.py +640 -0
- test_base/service/runs.py +394 -0
- test_base/service/runtime.py +123 -0
- test_base/storage/__init__.py +41 -0
- test_base/storage/artifacts.py +347 -0
- test_base/storage/base.py +350 -0
- test_base/storage/db.py +595 -0
- test_base/storage/failures.py +321 -0
- test_base/storage/locks.py +104 -0
- test_base/storage/migrations/env.py +108 -0
- test_base/storage/migrations/script.py.mako +26 -0
- test_base/storage/migrations/versions/0001_initial.py +289 -0
- test_base/storage/migrations/versions/0002_retention_indexes.py +38 -0
- test_base/storage/migrations/versions/0003_postgresql_bigint.py +74 -0
- test_base/storage/migrations/versions/0004_run_shards.py +37 -0
- test_base/storage/migrations/versions/0005_failure_groups.py +206 -0
- test_base/storage/models.py +560 -0
- test_base/storage/repositories.py +2481 -0
- test_base/storage/uow.py +138 -0
- test_base/version.py +17 -0
- test_base/web/assets/css/app.css +3567 -0
- test_base/web/assets/favicon.svg +5 -0
- test_base/web/assets/js/00-util.js +829 -0
- test_base/web/assets/js/05-windows.js +551 -0
- test_base/web/assets/js/10-provider.js +396 -0
- test_base/web/assets/js/12-live-provider.js +804 -0
- test_base/web/assets/js/20-charts.js +715 -0
- test_base/web/assets/js/30-store.js +793 -0
- test_base/web/assets/js/40-components.js +2141 -0
- test_base/web/assets/js/42-timeline.js +629 -0
- test_base/web/assets/js/50-view-overview.js +747 -0
- test_base/web/assets/js/52-view-analytics.js +842 -0
- test_base/web/assets/js/53-view-suites.js +508 -0
- test_base/web/assets/js/54-view-metrics.js +438 -0
- test_base/web/assets/js/55-view-runs.js +244 -0
- test_base/web/assets/js/56-view-evidence.js +703 -0
- test_base/web/assets/js/57-view-failures.js +596 -0
- test_base/web/assets/js/60-view-run.js +788 -0
- test_base/web/assets/js/65-view-test.js +402 -0
- test_base/web/assets/js/70-view-settings.js +524 -0
- test_base/web/assets/js/75-view-help.js +554 -0
- test_base/web/assets/js/80-settings.js +99 -0
- test_base/web/assets/js/85-activity.js +727 -0
- test_base/web/assets/js/90-app.js +595 -0
- test_base/web/assets/manifest.json +70 -0
- test_base/web/index.html +210 -0
- test_base-0.1.1.dist-info/METADATA +285 -0
- test_base-0.1.1.dist-info/RECORD +103 -0
- test_base-0.1.1.dist-info/WHEEL +4 -0
- test_base-0.1.1.dist-info/entry_points.txt +6 -0
- test_base-0.1.1.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,793 @@
|
|
|
1
|
+
/* Test Base — the store: one state object, one place that talks to the provider.
|
|
2
|
+
*
|
|
3
|
+
* Views never call `fetch`, never call the provider and never keep their own
|
|
4
|
+
* copy of anything (ADR-0001 D1). They read `store.state` and re-render when
|
|
5
|
+
* the store says a section changed — so a view is a pure function of state, and
|
|
6
|
+
* the transport underneath it is somebody else's problem.
|
|
7
|
+
*
|
|
8
|
+
* The URL is the source of truth for filters. `#/runs?team=payments&page=2` is
|
|
9
|
+
* not a side effect of the filter bar — it *is* the filter bar's state, which
|
|
10
|
+
* is why a filtered view can be linked to, bookmarked and reloaded, and why the
|
|
11
|
+
* back button does the obvious thing.
|
|
12
|
+
*
|
|
13
|
+
* Two details worth keeping:
|
|
14
|
+
*
|
|
15
|
+
* - Every load carries a token. A slow overview request that lands after the
|
|
16
|
+
* user has already navigated to a run must not repaint the run page with
|
|
17
|
+
* stale data, and "the last response wins" is wrong when responses can
|
|
18
|
+
* overtake each other.
|
|
19
|
+
* - A live change notification is scoped. Events for run X do not reload the
|
|
20
|
+
* run page for Y; a `resync` reloads whatever is on screen, because after a
|
|
21
|
+
* resync we know nothing.
|
|
22
|
+
*/
|
|
23
|
+
(function (window) {
|
|
24
|
+
'use strict';
|
|
25
|
+
|
|
26
|
+
var TestBase = window.TestBase = window.TestBase || {};
|
|
27
|
+
var util = TestBase.util;
|
|
28
|
+
var windows = TestBase.windows;
|
|
29
|
+
|
|
30
|
+
//: Filter keys that survive navigation between views. `window` is a length
|
|
31
|
+
//: (`6h`, `30d`) or a range (`FROM..TO`) — see 05-windows.js.
|
|
32
|
+
var FILTER_KEYS = [
|
|
33
|
+
'project', 'team', 'component', 'test_type', 'environment', 'branch',
|
|
34
|
+
'status', 'q', 'window'
|
|
35
|
+
];
|
|
36
|
+
var DEFAULT_WINDOW = windows.DEFAULT_KEY;
|
|
37
|
+
var DEFAULT_PAGE_SIZE = 25;
|
|
38
|
+
|
|
39
|
+
/* The overview's live timeline looks back over one of these. Each is about
|
|
40
|
+
* sixty slots wide — `bin` is one slot, the time a bar stands for — and
|
|
41
|
+
* `tick` is how far apart the clock labels sit. The span rides in the URL as
|
|
42
|
+
* `span`, like a filter, so a timeline left on a wall screen survives a
|
|
43
|
+
* reload; unlike a filter it narrows only the timeline. */
|
|
44
|
+
var TIMELINE_SPANS = {
|
|
45
|
+
'15m': { key: '15m', label: '15 minutes', ms: 15 * 60000, bin: 15000, tick: 3 * 60000 },
|
|
46
|
+
'1h': { key: '1h', label: 'hour', ms: 3600000, bin: 60000, tick: 10 * 60000 },
|
|
47
|
+
'6h': { key: '6h', label: '6 hours', ms: 6 * 3600000, bin: 5 * 60000, tick: 3600000 },
|
|
48
|
+
'24h': { key: '24h', label: '24 hours', ms: 24 * 3600000, bin: 30 * 60000, tick: 3 * 3600000 }
|
|
49
|
+
};
|
|
50
|
+
var DEFAULT_TIMELINE_SPAN = '1h';
|
|
51
|
+
//: The most runs one timeline load asks for — the API's own page ceiling.
|
|
52
|
+
var TIMELINE_LIMIT = 500;
|
|
53
|
+
|
|
54
|
+
/* The routes that read the same thing: the portfolio overview plus the most
|
|
55
|
+
* recent finished runs, in full. Analytics asks that dataset why the suite
|
|
56
|
+
* fails; suites, metrics, screenshots, logs and coverage ask it what ran,
|
|
57
|
+
* what it cost and what it left behind. One loader, one cache, one loading
|
|
58
|
+
* state — seven pages that would otherwise each fetch the same five runs.
|
|
59
|
+
*
|
|
60
|
+
* `steps` is in the list because it is honest about being empty: it says how
|
|
61
|
+
* many runs it looked through before finding no step data, and that sentence
|
|
62
|
+
* needs the same runs as everything else. */
|
|
63
|
+
var DETAIL_ROUTES = {
|
|
64
|
+
analytics: true,
|
|
65
|
+
suites: true,
|
|
66
|
+
metrics: true,
|
|
67
|
+
steps: true,
|
|
68
|
+
screenshots: true,
|
|
69
|
+
logs: true,
|
|
70
|
+
coverage: true
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
function create(provider) {
|
|
74
|
+
var bus = util.emitter();
|
|
75
|
+
var tokens = {
|
|
76
|
+
overview: 0, runs: 0, run: 0, test: 0, analytics: 0, facets: 0, timeline: 0,
|
|
77
|
+
failures: 0, failure: 0, activity: 0
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
var state = {
|
|
81
|
+
providerKind: provider.kind,
|
|
82
|
+
capabilities: provider.capabilities,
|
|
83
|
+
status: provider.status,
|
|
84
|
+
statusDetail: null,
|
|
85
|
+
meta: provider.meta || null,
|
|
86
|
+
route: { name: 'overview', params: {}, query: {} },
|
|
87
|
+
filters: {},
|
|
88
|
+
facets: null,
|
|
89
|
+
overview: null,
|
|
90
|
+
runs: null,
|
|
91
|
+
run: null,
|
|
92
|
+
test: null,
|
|
93
|
+
analytics: null,
|
|
94
|
+
timeline: null,
|
|
95
|
+
failures: null,
|
|
96
|
+
failure: null,
|
|
97
|
+
// The activity panel's last day (see loadActivity). Not a page's data:
|
|
98
|
+
// it is beside every page, and no view reads it.
|
|
99
|
+
activity: null,
|
|
100
|
+
lastUpdated: null,
|
|
101
|
+
loading: {
|
|
102
|
+
overview: false, runs: false, run: false, test: false, analytics: false, timeline: false,
|
|
103
|
+
failures: false, failure: false, activity: false
|
|
104
|
+
},
|
|
105
|
+
errors: {
|
|
106
|
+
overview: null, runs: null, run: null, test: null, analytics: null, timeline: null,
|
|
107
|
+
failures: null, failure: null, activity: null
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
function emit(section) {
|
|
112
|
+
bus.emit('update', { section: section, state: state });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function touch() {
|
|
116
|
+
state.lastUpdated = new Date().toISOString();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* ------------------------------------------------------------ routing */
|
|
120
|
+
|
|
121
|
+
function filtersFromQuery(query) {
|
|
122
|
+
var filters = {};
|
|
123
|
+
for (var i = 0; i < FILTER_KEYS.length; i++) {
|
|
124
|
+
var key = FILTER_KEYS[i];
|
|
125
|
+
if (query[key] !== undefined && query[key] !== '') { filters[key] = query[key]; }
|
|
126
|
+
}
|
|
127
|
+
// Always set, and always one the API will take: a link from before
|
|
128
|
+
// `window` existed (`window_days=7`) opens as `7d`, and a hand-edited
|
|
129
|
+
// range the server would refuse opens as the default instead.
|
|
130
|
+
filters.window = windows.fromQuery(query).value;
|
|
131
|
+
return filters;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function parseRoute(hash) {
|
|
135
|
+
var parsed = util.parseHash(hash);
|
|
136
|
+
var segments = parsed.segments;
|
|
137
|
+
var head = segments[0] || 'overview';
|
|
138
|
+
if (head === 'runs' && segments[1]) {
|
|
139
|
+
return { name: 'run', params: { runId: segments[1] }, query: parsed.query };
|
|
140
|
+
}
|
|
141
|
+
if (head === 'runs') {
|
|
142
|
+
return { name: 'runs', params: {}, query: parsed.query };
|
|
143
|
+
}
|
|
144
|
+
if (head === 'tests' && segments[1]) {
|
|
145
|
+
return { name: 'test', params: { testId: segments[1] }, query: parsed.query };
|
|
146
|
+
}
|
|
147
|
+
if (head === 'tests') {
|
|
148
|
+
return { name: 'runs', params: {}, query: parsed.query };
|
|
149
|
+
}
|
|
150
|
+
if (head === 'failures' && segments[1]) {
|
|
151
|
+
return { name: 'failure', params: { fingerprint: segments[1] }, query: parsed.query };
|
|
152
|
+
}
|
|
153
|
+
if (head === 'failures') {
|
|
154
|
+
return { name: 'failures', params: {}, query: parsed.query };
|
|
155
|
+
}
|
|
156
|
+
if (DETAIL_ROUTES[head]) {
|
|
157
|
+
return { name: head, params: {}, query: parsed.query };
|
|
158
|
+
}
|
|
159
|
+
if (head === 'settings') {
|
|
160
|
+
return { name: 'settings', params: {}, query: parsed.query };
|
|
161
|
+
}
|
|
162
|
+
if (head === 'help') {
|
|
163
|
+
return { name: 'help', params: { section: segments[1] || null }, query: parsed.query };
|
|
164
|
+
}
|
|
165
|
+
return { name: 'overview', params: {}, query: parsed.query };
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function applyRoute(hash) {
|
|
169
|
+
var route = parseRoute(hash);
|
|
170
|
+
var previous = state.route;
|
|
171
|
+
state.route = route;
|
|
172
|
+
state.filters = filtersFromQuery(route.query);
|
|
173
|
+
emit('route');
|
|
174
|
+
|
|
175
|
+
var sameView = previous.name === route.name &&
|
|
176
|
+
previous.params.runId === route.params.runId &&
|
|
177
|
+
previous.params.testId === route.params.testId &&
|
|
178
|
+
previous.params.fingerprint === route.params.fingerprint;
|
|
179
|
+
|
|
180
|
+
if (route.name === 'overview') {
|
|
181
|
+
loadOverview();
|
|
182
|
+
loadTimeline();
|
|
183
|
+
} else if (DETAIL_ROUTES[route.name]) {
|
|
184
|
+
loadRunDetails();
|
|
185
|
+
} else if (route.name === 'runs') {
|
|
186
|
+
loadRuns();
|
|
187
|
+
} else if (route.name === 'run') {
|
|
188
|
+
loadRun(route.params.runId, { keepPrevious: sameView });
|
|
189
|
+
} else if (route.name === 'test') {
|
|
190
|
+
loadTest(route.params.testId, { keepPrevious: sameView });
|
|
191
|
+
} else if (route.name === 'failures') {
|
|
192
|
+
loadFailures();
|
|
193
|
+
} else if (route.name === 'failure') {
|
|
194
|
+
loadFailure(route.params.fingerprint, { keepPrevious: sameView });
|
|
195
|
+
}
|
|
196
|
+
return route;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Build a hash for the current view with `patch` applied to its query.
|
|
201
|
+
* A value of null removes the key — which is how "All teams" clears a
|
|
202
|
+
* filter rather than adding `team=`.
|
|
203
|
+
*/
|
|
204
|
+
function hashWith(patch, options) {
|
|
205
|
+
var route = (options && options.route) || state.route;
|
|
206
|
+
var query = {};
|
|
207
|
+
var keys = Object.keys(route.query || {});
|
|
208
|
+
var i;
|
|
209
|
+
for (i = 0; i < keys.length; i++) { query[keys[i]] = route.query[keys[i]]; }
|
|
210
|
+
var patchKeys = Object.keys(patch || {});
|
|
211
|
+
for (i = 0; i < patchKeys.length; i++) {
|
|
212
|
+
var value = patch[patchKeys[i]];
|
|
213
|
+
if (value === null || value === undefined || value === '') {
|
|
214
|
+
delete query[patchKeys[i]];
|
|
215
|
+
} else {
|
|
216
|
+
query[patchKeys[i]] = value;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// `window` replaces the old key; a link that still carries it would
|
|
220
|
+
// otherwise keep a second, contradicting window in the URL.
|
|
221
|
+
if (patch && Object.prototype.hasOwnProperty.call(patch, 'window')) {
|
|
222
|
+
delete query.window_days;
|
|
223
|
+
}
|
|
224
|
+
var segments;
|
|
225
|
+
if (options && options.segments) {
|
|
226
|
+
segments = options.segments;
|
|
227
|
+
} else if (route.name === 'run') {
|
|
228
|
+
segments = ['runs', route.params.runId];
|
|
229
|
+
} else if (route.name === 'test') {
|
|
230
|
+
segments = ['tests', route.params.testId];
|
|
231
|
+
} else if (route.name === 'runs') {
|
|
232
|
+
segments = ['runs'];
|
|
233
|
+
} else if (route.name === 'failure') {
|
|
234
|
+
segments = ['failures', route.params.fingerprint];
|
|
235
|
+
} else if (route.name === 'failures') {
|
|
236
|
+
segments = ['failures'];
|
|
237
|
+
} else if (DETAIL_ROUTES[route.name]) {
|
|
238
|
+
segments = [route.name];
|
|
239
|
+
} else {
|
|
240
|
+
segments = ['overview'];
|
|
241
|
+
}
|
|
242
|
+
return util.buildHash(segments, query);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* -------------------------------------------------------------- loads */
|
|
246
|
+
|
|
247
|
+
function begin(section) {
|
|
248
|
+
tokens[section] += 1;
|
|
249
|
+
state.loading[section] = true;
|
|
250
|
+
state.errors[section] = null;
|
|
251
|
+
emit(section);
|
|
252
|
+
return tokens[section];
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function settle(section, token, error) {
|
|
256
|
+
if (token !== tokens[section]) { return false; }
|
|
257
|
+
state.loading[section] = false;
|
|
258
|
+
state.errors[section] = error || null;
|
|
259
|
+
if (!error) { touch(); }
|
|
260
|
+
emit(section);
|
|
261
|
+
return true;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
function loadFacets() {
|
|
265
|
+
var token = ++tokens.facets;
|
|
266
|
+
return provider.getFacets().then(function (facets) {
|
|
267
|
+
if (token !== tokens.facets) { return; }
|
|
268
|
+
state.facets = facets;
|
|
269
|
+
emit('facets');
|
|
270
|
+
}, function (error) {
|
|
271
|
+
util.reportError('facets unavailable', error);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
function loadOverview() {
|
|
276
|
+
var token = begin('overview');
|
|
277
|
+
return provider.getOverview(state.filters).then(function (overview) {
|
|
278
|
+
if (token !== tokens.overview) { return; }
|
|
279
|
+
state.overview = overview;
|
|
280
|
+
settle('overview', token, null);
|
|
281
|
+
}, function (error) {
|
|
282
|
+
settle('overview', token, error);
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function timelineSpan() {
|
|
287
|
+
var key = state.route.query && state.route.query.span;
|
|
288
|
+
return TIMELINE_SPANS[key] || TIMELINE_SPANS[DEFAULT_TIMELINE_SPAN];
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* The runs the overview's live timeline draws: every run that started
|
|
293
|
+
* inside its span, under the same facet filters as the rest of the page.
|
|
294
|
+
*
|
|
295
|
+
* Its own section rather than part of the overview, for two reasons. The
|
|
296
|
+
* overview has to stay cheap enough to poll, and a day of runs is not.
|
|
297
|
+
* And the timeline is redrawn without the rest of the page: a live event
|
|
298
|
+
* moves its bars, and nothing else on the page should flicker for it.
|
|
299
|
+
*/
|
|
300
|
+
function loadTimeline() {
|
|
301
|
+
var token = begin('timeline');
|
|
302
|
+
var span = timelineSpan();
|
|
303
|
+
var filters = {};
|
|
304
|
+
var keys = Object.keys(state.filters);
|
|
305
|
+
for (var i = 0; i < keys.length; i++) { filters[keys[i]] = state.filters[keys[i]]; }
|
|
306
|
+
// The span is the timeline's window; the page's `window` is not.
|
|
307
|
+
delete filters.window;
|
|
308
|
+
// One slot of slack at the far end, so the bar sliding off the left edge
|
|
309
|
+
// is still drawn while it goes.
|
|
310
|
+
filters.since = new Date(Date.now() - span.ms - span.bin).toISOString();
|
|
311
|
+
filters.limit = TIMELINE_LIMIT;
|
|
312
|
+
return provider.listRuns(filters).then(function (result) {
|
|
313
|
+
if (token !== tokens.timeline) { return; }
|
|
314
|
+
var runs = result.runs || [];
|
|
315
|
+
state.timeline = {
|
|
316
|
+
span: span.key,
|
|
317
|
+
runs: runs,
|
|
318
|
+
truncated: typeof result.total === 'number' && result.total > runs.length
|
|
319
|
+
};
|
|
320
|
+
settle('timeline', token, null);
|
|
321
|
+
}, function (error) {
|
|
322
|
+
settle('timeline', token, error);
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function loadRuns() {
|
|
327
|
+
var token = begin('runs');
|
|
328
|
+
var query = state.route.query || {};
|
|
329
|
+
var limit = Math.max(1, Number(query.limit) || DEFAULT_PAGE_SIZE);
|
|
330
|
+
var page = Math.max(1, Number(query.page) || 1);
|
|
331
|
+
var filters = {};
|
|
332
|
+
var keys = Object.keys(state.filters);
|
|
333
|
+
for (var i = 0; i < keys.length; i++) { filters[keys[i]] = state.filters[keys[i]]; }
|
|
334
|
+
// The run list is paged, not windowed: it is every run, newest first,
|
|
335
|
+
// and the portfolio pages' `window` does not narrow it. Passing it
|
|
336
|
+
// through would leave the URL claiming a narrowing this page never
|
|
337
|
+
// shows, so it stays behind.
|
|
338
|
+
delete filters.window;
|
|
339
|
+
filters.limit = limit;
|
|
340
|
+
filters.offset = (page - 1) * limit;
|
|
341
|
+
filters.sort = query.sort || 'started_at';
|
|
342
|
+
filters.dir = query.dir || 'desc';
|
|
343
|
+
|
|
344
|
+
return provider.listRuns(filters).then(function (result) {
|
|
345
|
+
if (token !== tokens.runs) { return; }
|
|
346
|
+
state.runs = {
|
|
347
|
+
runs: result.runs || [],
|
|
348
|
+
total: result.total || 0,
|
|
349
|
+
page: page,
|
|
350
|
+
limit: limit,
|
|
351
|
+
offset: filters.offset,
|
|
352
|
+
exact: result.exact !== false,
|
|
353
|
+
// 'all' when the provider ordered the whole result set, 'page' when it
|
|
354
|
+
// could only order the rows it was handed. The view says which.
|
|
355
|
+
sorted: result.sorted || 'all',
|
|
356
|
+
sort: filters.sort,
|
|
357
|
+
dir: filters.dir
|
|
358
|
+
};
|
|
359
|
+
settle('runs', token, null);
|
|
360
|
+
}, function (error) {
|
|
361
|
+
settle('runs', token, error);
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function loadRun(runId, options) {
|
|
366
|
+
if (!runId) { return Promise.resolve(); }
|
|
367
|
+
var token = begin('run');
|
|
368
|
+
if (!options || !options.keepPrevious) { state.run = null; }
|
|
369
|
+
return provider.getRun(runId).then(function (detail) {
|
|
370
|
+
if (token !== tokens.run) { return; }
|
|
371
|
+
state.run = detail;
|
|
372
|
+
settle('run', token, null);
|
|
373
|
+
}, function (error) {
|
|
374
|
+
if (token === tokens.run) { state.run = null; }
|
|
375
|
+
settle('run', token, error);
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function loadTest(testId, options) {
|
|
380
|
+
if (!testId) { return Promise.resolve(); }
|
|
381
|
+
var token = begin('test');
|
|
382
|
+
if (!options || !options.keepPrevious) { state.test = null; }
|
|
383
|
+
return provider.getTest(testId).then(function (detail) {
|
|
384
|
+
if (token !== tokens.test) { return; }
|
|
385
|
+
state.test = detail;
|
|
386
|
+
settle('test', token, null);
|
|
387
|
+
}, function (error) {
|
|
388
|
+
if (token === tokens.test) { state.test = null; }
|
|
389
|
+
settle('test', token, error);
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/* ----------------------------------------------------------- failures */
|
|
394
|
+
|
|
395
|
+
//: Failure groups per page. Enough to see a week's distinct failures at
|
|
396
|
+
//: once; a list longer than this is a backlog, and it pages.
|
|
397
|
+
var FAILURE_PAGE_SIZE = 50;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* The portfolio filters as the failures API takes them: the facets as they
|
|
401
|
+
* are, and the window as the instants it stands for — the same bounds the
|
|
402
|
+
* detail pages read their runs with, so a group's counts and the rest of
|
|
403
|
+
* the dashboard describe the same runs.
|
|
404
|
+
*/
|
|
405
|
+
function windowedFilters() {
|
|
406
|
+
var filters = {};
|
|
407
|
+
var keys = Object.keys(state.filters);
|
|
408
|
+
for (var i = 0; i < keys.length; i++) { filters[keys[i]] = state.filters[keys[i]]; }
|
|
409
|
+
var span = windows.bounds(windows.parse(state.filters.window));
|
|
410
|
+
delete filters.window;
|
|
411
|
+
filters.since = new Date(span.start).toISOString();
|
|
412
|
+
if (span.fixedEnd) { filters.until = new Date(span.end).toISOString(); }
|
|
413
|
+
return filters;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function loadFailures() {
|
|
417
|
+
var token = begin('failures');
|
|
418
|
+
var query = state.route.query || {};
|
|
419
|
+
var page = Math.max(1, Number(query.page) || 1);
|
|
420
|
+
var options = {
|
|
421
|
+
triage: query.triage || null,
|
|
422
|
+
q: query.search || null,
|
|
423
|
+
sort: query.sort === 'occurrences' ? 'occurrences' : 'recent',
|
|
424
|
+
limit: FAILURE_PAGE_SIZE,
|
|
425
|
+
offset: (page - 1) * FAILURE_PAGE_SIZE
|
|
426
|
+
};
|
|
427
|
+
return provider.listFailures(windowedFilters(), options).then(function (result) {
|
|
428
|
+
if (token !== tokens.failures) { return; }
|
|
429
|
+
state.failures = {
|
|
430
|
+
groups: result.groups || [],
|
|
431
|
+
total: result.total || 0,
|
|
432
|
+
page: page,
|
|
433
|
+
limit: FAILURE_PAGE_SIZE,
|
|
434
|
+
triage: options.triage,
|
|
435
|
+
sort: options.sort,
|
|
436
|
+
search: options.q
|
|
437
|
+
};
|
|
438
|
+
settle('failures', token, null);
|
|
439
|
+
}, function (error) {
|
|
440
|
+
settle('failures', token, error);
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
function loadFailure(fingerprint, options) {
|
|
445
|
+
if (!fingerprint) { return Promise.resolve(); }
|
|
446
|
+
var token = begin('failure');
|
|
447
|
+
if (!options || !options.keepPrevious) { state.failure = null; }
|
|
448
|
+
return provider.getFailure(fingerprint, windowedFilters()).then(function (detail) {
|
|
449
|
+
if (token !== tokens.failure) { return; }
|
|
450
|
+
state.failure = detail;
|
|
451
|
+
settle('failure', token, null);
|
|
452
|
+
}, function (error) {
|
|
453
|
+
if (token === tokens.failure) { state.failure = null; }
|
|
454
|
+
settle('failure', token, error);
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Record a verdict, then read the group back rather than patching it in
|
|
460
|
+
* place: whether it now counts as regressed depends on the window, and
|
|
461
|
+
* only the server knows both.
|
|
462
|
+
*/
|
|
463
|
+
function triageFailure(fingerprint, changes) {
|
|
464
|
+
return provider.triageFailure(fingerprint, changes).then(function (group) {
|
|
465
|
+
if (state.route.name === 'failure' && state.route.params.fingerprint === fingerprint) {
|
|
466
|
+
loadFailure(fingerprint, { keepPrevious: true });
|
|
467
|
+
}
|
|
468
|
+
return group;
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
//: How many finished runs the detail pages read in full. Five is the
|
|
473
|
+
//: number at which "what keeps breaking" stops being one run's luck, and
|
|
474
|
+
//: it is also the point past which a live server is being asked for real
|
|
475
|
+
//: work to draw one page. The API answers them in parallel.
|
|
476
|
+
var ANALYTICS_RUNS = 5;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* The detail pages read the portfolio overview and the newest finished
|
|
480
|
+
* runs that match the filters, in full.
|
|
481
|
+
*
|
|
482
|
+
* In full is the point: failure taxonomy, suite hotspots, ownership and the
|
|
483
|
+
* slowest tests all need every attempt of every test, and no summary
|
|
484
|
+
* carries those. Five runs rather than the window's worth of them, because
|
|
485
|
+
* the questions this page answers are about what the suite is doing *now*
|
|
486
|
+
* and the cost of asking is one payload per run.
|
|
487
|
+
*
|
|
488
|
+
* Live runs are skipped deliberately: half a run's failures classified as
|
|
489
|
+
* if they were all of them is a wrong answer, not a partial one.
|
|
490
|
+
*/
|
|
491
|
+
function analyticsRunsFrom(candidates) {
|
|
492
|
+
var chosen = [];
|
|
493
|
+
for (var i = 0; i < candidates.length && chosen.length < ANALYTICS_RUNS; i++) {
|
|
494
|
+
if (candidates[i].is_live || !candidates[i].finished_at) { continue; }
|
|
495
|
+
chosen.push(candidates[i]);
|
|
496
|
+
}
|
|
497
|
+
return chosen;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Finished runs do not change. Their details are immutable once the run has
|
|
502
|
+
* ended, which is what makes them safe to keep — and what turns a live
|
|
503
|
+
* update on this page from five requests into none. A resync empties it,
|
|
504
|
+
* because after a resync we know nothing, including whether those runs
|
|
505
|
+
* still exist.
|
|
506
|
+
*/
|
|
507
|
+
var analyticsCache = {};
|
|
508
|
+
var ANALYTICS_CACHE_MAX = 20;
|
|
509
|
+
|
|
510
|
+
function cacheRun(detail) {
|
|
511
|
+
var keys = Object.keys(analyticsCache);
|
|
512
|
+
if (keys.length >= ANALYTICS_CACHE_MAX) { delete analyticsCache[keys[0]]; }
|
|
513
|
+
analyticsCache[String(detail.run.id)] = detail;
|
|
514
|
+
return detail;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
//: How many of the window's newest runs to look through for five finished
|
|
518
|
+
//: ones — the same twenty the overview's `recent_runs` carries.
|
|
519
|
+
var WINDOW_CANDIDATES = 20;
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* The newest runs inside the window, to choose the detail pages' runs from.
|
|
523
|
+
*
|
|
524
|
+
* Not the overview's `recent_runs`: those are the newest runs *regardless*
|
|
525
|
+
* of the window — right for the overview's own "recent runs", which should
|
|
526
|
+
* not go blank on a quiet afternoon, and wrong here, where a one-hour
|
|
527
|
+
* window drew its suites from runs five hours old and every window drew
|
|
528
|
+
* the same five. An overview the browser narrowed (any filter set) already
|
|
529
|
+
* fetched its runs inside the window; otherwise they are asked for here,
|
|
530
|
+
* by start time, as every other window in the dashboard is.
|
|
531
|
+
*/
|
|
532
|
+
function runsInWindow(overview) {
|
|
533
|
+
if (overview && overview.derived) {
|
|
534
|
+
return Promise.resolve(overview.recent_runs || []);
|
|
535
|
+
}
|
|
536
|
+
var span = windows.bounds(windows.parse(state.filters.window));
|
|
537
|
+
var filters = { limit: WINDOW_CANDIDATES, since: new Date(span.start).toISOString() };
|
|
538
|
+
if (span.fixedEnd) { filters.until = new Date(span.end).toISOString(); }
|
|
539
|
+
return provider.listRuns(filters).then(function (page) { return (page && page.runs) || []; });
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
function loadRunDetails() {
|
|
543
|
+
// The analytics section owns the loading state for the whole page: the
|
|
544
|
+
// overview it fetches is a dependency of this view, not a second view
|
|
545
|
+
// loading beside it, and two spinners for one page is one too many.
|
|
546
|
+
var token = begin('analytics');
|
|
547
|
+
return provider.getOverview(state.filters).then(function (overview) {
|
|
548
|
+
if (token !== tokens.analytics) { return null; }
|
|
549
|
+
state.overview = overview;
|
|
550
|
+
emit('overview');
|
|
551
|
+
return runsInWindow(overview);
|
|
552
|
+
}).then(function (candidates) {
|
|
553
|
+
if (candidates === null || token !== tokens.analytics) { return null; }
|
|
554
|
+
var summaries = analyticsRunsFrom(candidates);
|
|
555
|
+
if (!summaries.length) {
|
|
556
|
+
state.analytics = { summaries: [], runs: [], partial: false };
|
|
557
|
+
settle('analytics', token, null);
|
|
558
|
+
return null;
|
|
559
|
+
}
|
|
560
|
+
// One run that will not load must not cost the reader the other four,
|
|
561
|
+
// so every fetch resolves — to the detail, or to null — and the page
|
|
562
|
+
// says how many it is drawing.
|
|
563
|
+
return Promise.all(summaries.map(function (summary) {
|
|
564
|
+
var cached = analyticsCache[String(summary.id)];
|
|
565
|
+
if (cached) { return Promise.resolve(cached); }
|
|
566
|
+
return provider.getRun(summary.id).then(cacheRun, function (error) {
|
|
567
|
+
util.reportError('run ' + summary.id + ' did not load for analytics', error);
|
|
568
|
+
return null;
|
|
569
|
+
});
|
|
570
|
+
})).then(function (details) {
|
|
571
|
+
if (token !== tokens.analytics) { return null; }
|
|
572
|
+
var loaded = details.filter(Boolean);
|
|
573
|
+
state.analytics = {
|
|
574
|
+
summaries: summaries,
|
|
575
|
+
runs: loaded,
|
|
576
|
+
partial: loaded.length !== summaries.length
|
|
577
|
+
};
|
|
578
|
+
settle('analytics', token, loaded.length ? null : {
|
|
579
|
+
message: 'None of the recent runs could be loaded.',
|
|
580
|
+
code: 'analytics_unavailable'
|
|
581
|
+
});
|
|
582
|
+
return null;
|
|
583
|
+
});
|
|
584
|
+
}, function (error) {
|
|
585
|
+
settle('analytics', token, error);
|
|
586
|
+
return null;
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/* ----------------------------------------------------------- activity */
|
|
591
|
+
|
|
592
|
+
/* The activity panel — what is running, what just ran, how the last day
|
|
593
|
+
* has gone — sits beside every page, so it reads its own data rather than
|
|
594
|
+
* borrowing a page's: a page's window and filters are the reader's
|
|
595
|
+
* question about that page, and the panel answering it too would make the
|
|
596
|
+
* panel change every time a filter did.
|
|
597
|
+
*
|
|
598
|
+
* It is one overview of the last 24 hours. That endpoint already carries
|
|
599
|
+
* the live runs, the newest runs and an hourly trend, it is built to be
|
|
600
|
+
* asked for on every live change, and the server computes it once per
|
|
601
|
+
* change however many dashboards ask (test_base.service.coalesce). And it
|
|
602
|
+
* is asked for only while the panel is on screen: a reader who hid it
|
|
603
|
+
* costs the server nothing for it. */
|
|
604
|
+
var ACTIVITY_WINDOW = '24h';
|
|
605
|
+
var activityOn = false;
|
|
606
|
+
var started = false;
|
|
607
|
+
|
|
608
|
+
function loadActivity() {
|
|
609
|
+
var token = ++tokens.activity;
|
|
610
|
+
state.loading.activity = true;
|
|
611
|
+
return provider.getOverview({ window: ACTIVITY_WINDOW }).then(function (overview) {
|
|
612
|
+
if (token !== tokens.activity) { return; }
|
|
613
|
+
state.activity = overview;
|
|
614
|
+
state.loading.activity = false;
|
|
615
|
+
state.errors.activity = null;
|
|
616
|
+
// No `touch()`: "Updated" in the header is about the page, and the
|
|
617
|
+
// panel refreshing beside a page that did not is not the page updating.
|
|
618
|
+
emit('activity');
|
|
619
|
+
}, function (error) {
|
|
620
|
+
if (token !== tokens.activity) { return; }
|
|
621
|
+
state.loading.activity = false;
|
|
622
|
+
state.errors.activity = error;
|
|
623
|
+
emit('activity');
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/** The panel says whether it is on screen; while it is not, nothing loads. */
|
|
628
|
+
function setActivity(on) {
|
|
629
|
+
var next = !!on;
|
|
630
|
+
if (next === activityOn) { return; }
|
|
631
|
+
activityOn = next;
|
|
632
|
+
// Shown again after a while out of sight: what it last drew is stale.
|
|
633
|
+
if (activityOn && started) { refresh('activity'); }
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
function reloadCurrent() {
|
|
637
|
+
var route = state.route;
|
|
638
|
+
if (route.name === 'overview') { return Promise.all([loadOverview(), loadTimeline()]); }
|
|
639
|
+
if (DETAIL_ROUTES[route.name]) { return loadRunDetails(); }
|
|
640
|
+
if (route.name === 'runs') { return loadRuns(); }
|
|
641
|
+
if (route.name === 'run') { return loadRun(route.params.runId, { keepPrevious: true }); }
|
|
642
|
+
if (route.name === 'test') { return loadTest(route.params.testId, { keepPrevious: true }); }
|
|
643
|
+
if (route.name === 'failures') { return loadFailures(); }
|
|
644
|
+
if (route.name === 'failure') {
|
|
645
|
+
return loadFailure(route.params.fingerprint, { keepPrevious: true });
|
|
646
|
+
}
|
|
647
|
+
return Promise.resolve();
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/* ------------------------------------------------------- live updates */
|
|
651
|
+
|
|
652
|
+
/* A live change reloads what is on screen — one request per section at a
|
|
653
|
+
* time. While results stream in, changes arrive every second or two, and a
|
|
654
|
+
* load is not guaranteed to finish in that time: firing a fresh one per
|
|
655
|
+
* change piled requests up faster than they completed, until the browser's
|
|
656
|
+
* queue and the server's workers were both full and the page reported a
|
|
657
|
+
* 20-second timeout. Now a change that lands mid-load queues exactly one
|
|
658
|
+
* more load, read from the page as it is when that load starts. */
|
|
659
|
+
var inFlight = {};
|
|
660
|
+
var queued = {};
|
|
661
|
+
|
|
662
|
+
var LIVE_LOADERS = {
|
|
663
|
+
overview: function () { return loadOverview(); },
|
|
664
|
+
timeline: function () { return loadTimeline(); },
|
|
665
|
+
analytics: function () { return loadRunDetails(); },
|
|
666
|
+
runs: function () { return loadRuns(); },
|
|
667
|
+
run: function () { return loadRun(state.route.params.runId, { keepPrevious: true }); },
|
|
668
|
+
test: function () { return loadTest(state.route.params.testId, { keepPrevious: true }); },
|
|
669
|
+
failures: function () { return loadFailures(); },
|
|
670
|
+
failure: function () {
|
|
671
|
+
return loadFailure(state.route.params.fingerprint, { keepPrevious: true });
|
|
672
|
+
},
|
|
673
|
+
activity: function () { return loadActivity(); }
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
/** The sections a live change reloads on this route. */
|
|
677
|
+
function liveSections(route) {
|
|
678
|
+
var sections = [];
|
|
679
|
+
if (route.name === 'overview') {
|
|
680
|
+
sections = ['overview', 'timeline'];
|
|
681
|
+
} else if (DETAIL_ROUTES[route.name]) {
|
|
682
|
+
sections = ['analytics'];
|
|
683
|
+
} else if (route.name === 'runs' || route.name === 'run' || route.name === 'test' ||
|
|
684
|
+
route.name === 'failures' || route.name === 'failure') {
|
|
685
|
+
sections = [route.name];
|
|
686
|
+
}
|
|
687
|
+
// Beside every route, for as long as it is on screen.
|
|
688
|
+
if (activityOn) { sections.push('activity'); }
|
|
689
|
+
return sections;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
function refresh(section) {
|
|
693
|
+
if (inFlight[section]) {
|
|
694
|
+
queued[section] = true;
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
inFlight[section] = true;
|
|
698
|
+
var done = function () {
|
|
699
|
+
inFlight[section] = false;
|
|
700
|
+
if (!queued[section]) { return; }
|
|
701
|
+
queued[section] = false;
|
|
702
|
+
// Only if the page still shows it: a change that arrived while the
|
|
703
|
+
// overview loaded means nothing to a reader who has since opened a run.
|
|
704
|
+
if (liveSections(state.route).indexOf(section) >= 0) { refresh(section); }
|
|
705
|
+
};
|
|
706
|
+
var pending = null;
|
|
707
|
+
try {
|
|
708
|
+
pending = LIVE_LOADERS[section]();
|
|
709
|
+
} catch (err) {
|
|
710
|
+
util.reportError('live reload of ' + section + ' failed', err);
|
|
711
|
+
}
|
|
712
|
+
Promise.resolve(pending).then(done, done);
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
function onProviderMessage(message) {
|
|
716
|
+
if (message.type === 'status') {
|
|
717
|
+
state.status = message.status || provider.status;
|
|
718
|
+
state.statusDetail = message.detail || null;
|
|
719
|
+
emit('status');
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
if (message.type !== 'change') { return; }
|
|
723
|
+
var route = state.route;
|
|
724
|
+
var resync = message.reason === 'resync';
|
|
725
|
+
if (route.name === 'overview') {
|
|
726
|
+
refresh('overview');
|
|
727
|
+
// The timeline is the part of this page a live event is *for*: a run
|
|
728
|
+
// that just started is a new bar, a result that just landed a taller one.
|
|
729
|
+
refresh('timeline');
|
|
730
|
+
} else if (DETAIL_ROUTES[route.name]) {
|
|
731
|
+
// Cheap to repeat: the overview is one request and the finished runs it
|
|
732
|
+
// names are already cached, so a live update costs a run payload only
|
|
733
|
+
// when a run this page has never drawn appears.
|
|
734
|
+
if (resync) { analyticsCache = {}; }
|
|
735
|
+
refresh('analytics');
|
|
736
|
+
} else if (route.name === 'runs') {
|
|
737
|
+
refresh('runs');
|
|
738
|
+
} else if (route.name === 'run') {
|
|
739
|
+
var touched = (message.runIds || []).indexOf(String(route.params.runId)) >= 0;
|
|
740
|
+
if (touched || resync) { refresh('run'); }
|
|
741
|
+
} else if (route.name === 'test') {
|
|
742
|
+
refresh('test');
|
|
743
|
+
} else if (route.name === 'failures' || route.name === 'failure') {
|
|
744
|
+
// A new result may be a new occurrence — or a new group.
|
|
745
|
+
refresh(route.name);
|
|
746
|
+
}
|
|
747
|
+
// Whatever the page: a run that starts, moves or finishes is exactly
|
|
748
|
+
// what the activity panel is there to show.
|
|
749
|
+
if (activityOn) { refresh('activity'); }
|
|
750
|
+
if (resync) { loadFacets(); }
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
var store = {
|
|
754
|
+
state: state,
|
|
755
|
+
FILTER_KEYS: FILTER_KEYS,
|
|
756
|
+
DEFAULT_WINDOW: DEFAULT_WINDOW,
|
|
757
|
+
DEFAULT_PAGE_SIZE: DEFAULT_PAGE_SIZE,
|
|
758
|
+
TIMELINE_SPANS: TIMELINE_SPANS,
|
|
759
|
+
DEFAULT_TIMELINE_SPAN: DEFAULT_TIMELINE_SPAN,
|
|
760
|
+
ACTIVITY_WINDOW: ACTIVITY_WINDOW,
|
|
761
|
+
timelineSpan: timelineSpan,
|
|
762
|
+
on: function (fn) { return bus.on('update', fn); },
|
|
763
|
+
applyRoute: applyRoute,
|
|
764
|
+
parseRoute: parseRoute,
|
|
765
|
+
hashWith: hashWith,
|
|
766
|
+
loadFacets: loadFacets,
|
|
767
|
+
triageFailure: triageFailure,
|
|
768
|
+
setActivity: setActivity,
|
|
769
|
+
retryActivity: function () { refresh('activity'); },
|
|
770
|
+
reload: reloadCurrent,
|
|
771
|
+
retry: reloadCurrent,
|
|
772
|
+
provider: provider,
|
|
773
|
+
start: function () {
|
|
774
|
+
provider.subscribe(onProviderMessage);
|
|
775
|
+
if (provider.start) { provider.start(); }
|
|
776
|
+
state.status = provider.status;
|
|
777
|
+
started = true;
|
|
778
|
+
loadFacets();
|
|
779
|
+
applyRoute();
|
|
780
|
+
if (activityOn) { refresh('activity'); }
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
|
|
784
|
+
return store;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
TestBase.store = {
|
|
788
|
+
create: create,
|
|
789
|
+
FILTER_KEYS: FILTER_KEYS,
|
|
790
|
+
DETAIL_ROUTES: DETAIL_ROUTES,
|
|
791
|
+
TIMELINE_SPANS: TIMELINE_SPANS
|
|
792
|
+
};
|
|
793
|
+
})(window);
|