Skip to content

Commit f3d7a3a

Browse files
gtm-nayanRich HarriseltigerchinoRich-Harrisbenmccann
authored
chore: speed up CI a bit (hopefully) (#9731)
Co-authored-by: Rich Harris <[email protected]> Co-authored-by: Tee Ming <[email protected]> Co-authored-by: Rich Harris <[email protected]> Co-authored-by: Ben McCann <[email protected]>
1 parent 8fd646b commit f3d7a3a

File tree

23 files changed

+148
-109
lines changed

23 files changed

+148
-109
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ jobs:
5959
- run: pnpm playwright install ${{ matrix.e2e-browser }}
6060
- run: pnpm run sync-all
6161
- run: pnpm test:kit
62+
- name: Print flaky test report
63+
run: node scripts/print-flaky-test-report.js
6264
- name: Archive test results
6365
if: failure()
6466
shell: bash
@@ -115,6 +117,8 @@ jobs:
115117
- run: pnpm playwright install ${{ matrix.e2e-browser }}
116118
- run: pnpm run sync-all
117119
- run: pnpm test:cross-platform:${{ matrix.mode }}
120+
- name: Print flaky test report
121+
run: node scripts/print-flaky-test-report.js
118122
- name: Archive test results
119123
if: failure()
120124
shell: bash

packages/kit/test/apps/basics/src/routes/load/cache-control/bust/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
}
1212
</script>
1313

14-
<p>Count is {data.count}</p>
14+
<p class="counter">Count is {data.count}</p>
1515
<button on:click={update}>update</button>

packages/kit/test/apps/basics/src/routes/load/cache-control/bust/count/+server.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { json } from '@sveltejs/kit';
2-
import { count } from '../state.js';
32

4-
export function GET({ setHeaders }) {
3+
export function GET({ setHeaders, cookies }) {
54
setHeaders({ 'cache-control': 'public, max-age=4', age: '2' });
5+
6+
const count = +(cookies.get('cache-control-bust-count') ?? 0);
7+
68
return json({ count });
79
}
810

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { json } from '@sveltejs/kit';
2-
import { increment } from '../state.js';
32

4-
export function GET() {
5-
increment();
3+
export function GET({ cookies }) {
4+
cookies.set(
5+
'cache-control-bust-count',
6+
+(cookies.get('cache-control-bust-count') ?? 0) + 1 + '',
7+
{ path: '/' }
8+
);
9+
610
return json({});
711
}

packages/kit/test/apps/basics/src/routes/load/cache-control/bust/state.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/kit/test/apps/basics/src/routes/load/cache-control/default/+page.svelte

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
/** @type {import('./$types').PageData} */
55
export let data;
66
7+
let ticker = 0;
78
async function update() {
9+
ticker += 1;
810
await fetch('/load/cache-control/default/increment');
9-
invalidate('/load/cache-control/default/count');
11+
await invalidate('/load/cache-control/default/count');
12+
ticker += 1;
1013
}
1114
</script>
1215

13-
<p>Count is {data.count}</p>
14-
<button on:click={update}>update</button>
16+
<p class="counter">Count is {data.count}</p>
17+
<button on:click={update} data-ticker={ticker}>update</button>

packages/kit/test/apps/basics/src/routes/load/cache-control/default/count/+server.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { json } from '@sveltejs/kit';
2-
import { count } from '../state.js';
32

4-
export function GET({ setHeaders }) {
3+
export function GET({ setHeaders, cookies }) {
54
setHeaders({ 'cache-control': 'public, max-age=4', age: '2' });
5+
6+
const count = +(cookies.get('cache-control-default-count') ?? 0);
7+
68
return json({ count });
79
}
810

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { json } from '@sveltejs/kit';
2-
import { increment } from '../state.js';
32

4-
export function GET() {
5-
increment();
3+
export function GET({ cookies }) {
4+
cookies.set(
5+
'cache-control-default-count',
6+
+(cookies.get('cache-control-default-count') ?? 0) + 1 + '',
7+
{ path: '/' }
8+
);
9+
610
return json({});
711
}

packages/kit/test/apps/basics/src/routes/load/cache-control/default/state.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/kit/test/apps/basics/src/routes/load/cache-control/force/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
}
1111
</script>
1212

13-
<p>Count is {data.count}</p>
13+
<p class="counter">Count is {data.count}</p>
1414
<button on:click={update}>update</button>

0 commit comments

Comments
 (0)