Skip to content

Commit d9468a6

Browse files
committed
build: change size to "medium" and "small"
There are several warnings about tests whose specified size is too big. These tests shards run under 300s and thus `medium` is more appropiate.
1 parent 7da683d commit d9468a6

File tree

3 files changed

+59
-56
lines changed

3 files changed

+59
-56
lines changed

modules/testing/builder/src/builder-harness.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export class BuilderHarness<T> {
263263
}
264264

265265
const logs: logging.LogEntry[] = [];
266-
context.logger.subscribe((e) => logs.push(e));
266+
const logger$ = context.logger.subscribe((e) => logs.push(e));
267267

268268
return observableFrom(this.schemaRegistry.compile(this.builderInfo.optionSchema)).pipe(
269269
mergeMap((validator) => validator(targetOptions)),
@@ -302,6 +302,7 @@ export class BuilderHarness<T> {
302302
}),
303303
finalize(() => {
304304
this.watcherNotifier = undefined;
305+
logger$.unsubscribe();
305306

306307
for (const teardown of context.teardowns) {
307308
// eslint-disable-next-line @typescript-eslint/no-floating-promises

packages/angular/build/BUILD.bazel

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,23 +291,23 @@ ts_project(
291291

292292
jasmine_test(
293293
name = "application_integration_tests",
294-
size = "large",
294+
size = "medium",
295295
data = [":application_integration_test_lib"],
296296
flaky = True,
297-
shard_count = 20,
297+
shard_count = 25,
298298
)
299299

300300
jasmine_test(
301301
name = "dev-server_integration_tests",
302-
size = "large",
302+
size = "medium",
303303
data = [":dev-server_integration_test_lib"],
304304
flaky = True,
305305
shard_count = 10,
306306
)
307307

308308
jasmine_test(
309309
name = "karma_integration_tests",
310-
size = "large",
310+
size = "medium",
311311
data = [":karma_integration_test_lib"],
312312
env = {
313313
# TODO: Replace Puppeteer downloaded browsers with Bazel-managed browsers,
@@ -320,9 +320,9 @@ jasmine_test(
320320

321321
jasmine_test(
322322
name = "unit-test_integration_tests",
323-
size = "large",
323+
size = "small",
324324
data = [":unit-test_integration_test_lib"],
325-
shard_count = 10,
325+
shard_count = 5,
326326
)
327327

328328
genrule(

packages/angular/build/src/builders/application/tests/options/polyfills_spec.ts

Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -16,71 +16,73 @@ const testsVariants: [suitName: string, baseUrl: string | undefined][] = [
1616
];
1717

1818
describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
19-
for (const [suitName, baseUrl] of testsVariants) {
20-
describe(suitName, () => {
21-
beforeEach(async () => {
22-
await harness.modifyFile('tsconfig.json', (content) => {
23-
const tsconfig = JSON.parse(content);
24-
tsconfig.compilerOptions.baseUrl = baseUrl;
25-
26-
return JSON.stringify(tsconfig);
27-
});
28-
});
29-
30-
it('uses a provided TypeScript file', async () => {
31-
harness.useTarget('build', {
32-
...BASE_OPTIONS,
33-
polyfills: ['src/polyfills.ts'],
19+
describe('Option: polyfills', () => {
20+
for (const [suitName, baseUrl] of testsVariants) {
21+
describe(suitName, () => {
22+
beforeEach(async () => {
23+
await harness.modifyFile('tsconfig.json', (content) => {
24+
const tsconfig = JSON.parse(content);
25+
tsconfig.compilerOptions.baseUrl = baseUrl;
26+
27+
return JSON.stringify(tsconfig);
28+
});
3429
});
3530

36-
const { result } = await harness.executeOnce();
31+
it('uses a provided TypeScript file', async () => {
32+
harness.useTarget('build', {
33+
...BASE_OPTIONS,
34+
polyfills: ['src/polyfills.ts'],
35+
});
3736

38-
expect(result?.success).toBe(true);
39-
40-
harness.expectFile('dist/browser/polyfills.js').toExist();
41-
});
37+
const { result } = await harness.executeOnce();
4238

43-
it('uses a provided JavaScript file', async () => {
44-
await harness.writeFile('src/polyfills.js', `console.log('main');`);
39+
expect(result?.success).toBe(true);
4540

46-
harness.useTarget('build', {
47-
...BASE_OPTIONS,
48-
polyfills: ['src/polyfills.js'],
41+
harness.expectFile('dist/browser/polyfills.js').toExist();
4942
});
5043

51-
const { result } = await harness.executeOnce();
44+
it('uses a provided JavaScript file', async () => {
45+
await harness.writeFile('src/polyfills.js', `console.log('main');`);
5246

53-
expect(result?.success).toBe(true);
47+
harness.useTarget('build', {
48+
...BASE_OPTIONS,
49+
polyfills: ['src/polyfills.js'],
50+
});
5451

55-
harness.expectFile('dist/browser/polyfills.js').content.toContain(`console.log("main")`);
56-
});
52+
const { result } = await harness.executeOnce();
53+
54+
expect(result?.success).toBe(true);
5755

58-
it('fails and shows an error when file does not exist', async () => {
59-
harness.useTarget('build', {
60-
...BASE_OPTIONS,
61-
polyfills: ['src/missing.ts'],
56+
harness.expectFile('dist/browser/polyfills.js').content.toContain(`console.log("main")`);
6257
});
6358

64-
const { result, logs } = await harness.executeOnce({ outputLogsOnFailure: false });
59+
it('fails and shows an error when file does not exist', async () => {
60+
harness.useTarget('build', {
61+
...BASE_OPTIONS,
62+
polyfills: ['src/missing.ts'],
63+
});
6564

66-
expect(result?.success).toBe(false);
67-
expect(logs).toContain(
68-
jasmine.objectContaining({ message: jasmine.stringMatching('Could not resolve') }),
69-
);
65+
const { result, logs } = await harness.executeOnce({ outputLogsOnFailure: false });
7066

71-
harness.expectFile('dist/browser/polyfills.js').toNotExist();
72-
});
67+
expect(result?.success).toBe(false);
68+
expect(logs).toContain(
69+
jasmine.objectContaining({ message: jasmine.stringMatching('Could not resolve') }),
70+
);
7371

74-
it('resolves module specifiers in array', async () => {
75-
harness.useTarget('build', {
76-
...BASE_OPTIONS,
77-
polyfills: ['zone.js', 'zone.js/testing'],
72+
harness.expectFile('dist/browser/polyfills.js').toNotExist();
7873
});
7974

80-
const { result } = await harness.executeOnce();
81-
expect(result?.success).toBeTrue();
82-
harness.expectFile('dist/browser/polyfills.js').toExist();
75+
it('resolves module specifiers in array', async () => {
76+
harness.useTarget('build', {
77+
...BASE_OPTIONS,
78+
polyfills: ['zone.js', 'zone.js/testing'],
79+
});
80+
81+
const { result } = await harness.executeOnce();
82+
expect(result?.success).toBeTrue();
83+
harness.expectFile('dist/browser/polyfills.js').toExist();
84+
});
8385
});
84-
});
85-
}
86+
}
87+
});
8688
});

0 commit comments

Comments
 (0)