Update syncing script to be able to build binary for commit set with owned commits.
[WebKit.git] / Websites / perf.webkit.org / unit-tests / resources / mock-v3-models.js
1 'use strict';
2
3 var MockModels = {
4     inject: function () {
5         beforeEach(function () {
6             AnalysisTask._fetchAllPromise = null;
7             AnalysisTask.clearStaticMap();
8             CommitLog.clearStaticMap();
9             Metric.clearStaticMap();
10             Platform.clearStaticMap();
11             Repository.clearStaticMap();
12             CommitSet.clearStaticMap();
13             Test.clearStaticMap();
14             TestGroup.clearStaticMap();
15             BuildRequest.clearStaticMap();
16             Triggerable.clearStaticMap();
17
18             MockModels.osx = Repository.ensureSingleton(9, {name: 'OS X'});
19             MockModels.ios = Repository.ensureSingleton(22, {name: 'iOS'});
20             MockModels.webkit = Repository.ensureSingleton(11, {name: 'WebKit', url: 'http://trac.webkit.org/changeset/$1'});
21             MockModels.ownedWebkit = Repository.ensureSingleton(191, {name: 'WebKit', url: 'http://trac.webkit.org/changeset/$1', owner: 9});
22             MockModels.sharedRepository = Repository.ensureSingleton(16, {name: 'Shared'});
23             MockModels.ownerRepository = Repository.ensureSingleton(111, {name: 'Owner Repository'});
24             MockModels.ownedRepository = Repository.ensureSingleton(112, {name: 'Owned Repository', owner: 111});
25             MockModels.webkitGit = Repository.ensureSingleton(17, {name: 'WebKit-Git'});
26             MockModels.builder = new Builder(176, {name: 'WebKit Perf Builder', buildUrl: 'http://build.webkit.org/builders/$builderName/$buildNumber'});
27
28             MockModels.someTest = Test.ensureSingleton(1, {name: 'Some test'});
29             MockModels.someMetric = Metric.ensureSingleton(2884, {name: 'Some metric', test: MockModels.someTest});
30             MockModels.somePlatform = Platform.ensureSingleton(65, {name: 'Some platform', metrics: [MockModels.someMetric]});
31
32             MockModels.speedometer = Test.ensureSingleton(1928, {name: 'Speedometer'});
33             MockModels.jetstream = Test.ensureSingleton(1886, {name: 'JetStream'});
34             MockModels.dromaeo = Test.ensureSingleton(2022, {name: 'Dromaeo'});
35             MockModels.domcore = Test.ensureSingleton(2023, {name: 'DOM Core Tests', parentId: 2022});
36
37             MockModels.iphone = Platform.ensureSingleton(12, {name: 'iPhone', metrics: []});
38             MockModels.ipad = Platform.ensureSingleton(13, {name: 'iPad', metrics: []});
39             MockModels.iOS10iPhone = Platform.ensureSingleton(14, {name: 'iOS 10 iPhone', metrics: []});
40
41             MockModels.plt = Test.ensureSingleton(844, {name: 'Page Load Test'});
42             MockModels.iPadPLT = Test.ensureSingleton(1444, {name: 'PLT-iPad'});
43             MockModels.iPhonePLT = Test.ensureSingleton(1500, {name: 'PLT-iPhone'});
44             MockModels.pltMean = Metric.ensureSingleton(1158, {name: 'Time', aggregator: 'Arithmetic', test: MockModels.plt});
45             MockModels.elCapitan = Platform.ensureSingleton(31, {name: 'El Capitan', metrics: [MockModels.pltMean]});
46
47             MockModels.osRepositoryGroup = new TriggerableRepositoryGroup(31, {
48                 name: 'ios',
49                 repositories: [{repository: MockModels.ios}]
50             });
51             MockModels.svnRepositoryGroup = new TriggerableRepositoryGroup(32, {
52                 name: 'ios-svn-webkit',
53                 repositories: [{repository: MockModels.ios}, {repository: MockModels.webkit, acceptsPatch: true}, {repository: MockModels.sharedRepository}],
54                 acceptsCustomRoots: true,
55             });
56             MockModels.gitRepositoryGroup = new TriggerableRepositoryGroup(33, {
57                 name: 'ios-git-webkit',
58                 repositories: [{repository: MockModels.ios}, {repository: MockModels.webkitGit}, {repository: MockModels.sharedRepository}]
59             });
60             MockModels.svnRepositoryWithOwnedRepositoryGroup = new TriggerableRepositoryGroup(34, {
61                 name: 'ios-svn-webkit-with-owned-commit',
62                 repositories: [{repository: MockModels.ios}, {repository: MockModels.webkit, acceptsPatch: true}, {repository: MockModels.ownerRepository}],
63                 acceptsCustomRoots: true,
64             });
65             MockModels.triggerable = new Triggerable(3, {name: 'build-webkit',
66                 repositoryGroups: [MockModels.osRepositoryGroup, MockModels.svnRepositoryGroup, MockModels.gitRepositoryGroup, MockModels.svnRepositoryWithOwnedRepositoryGroup],
67                 configurations: [{test: MockModels.iPhonePLT, platform: MockModels.iphone}]});
68
69         });
70     }
71 }
72
73 if (typeof module != 'undefined')
74     module.exports.MockModels = MockModels;