Skip to content

Commit 11eed01

Browse files
authored
ref: Refactor Integration Tests (#75)
Refactor integration tests to use Bun shell util as well as bun tests to actually build the apps via the CLI.
1 parent aa4ffc3 commit 11eed01

28 files changed

+748
-684
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const config = {
1414
"**/dist/**",
1515
"**/node_modules/**",
1616
"**/test-apps/**",
17+
"**/integration-tests/**/*.cjs",
1718
],
1819
parserOptions: {
1920
ecmaVersion: "latest",

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ jobs:
239239
name: Run Integration Tests (Node ${{ matrix.node-version }})
240240
needs: install
241241
runs-on: ubuntu-latest
242+
services:
243+
test-api:
244+
image: codecov/codecov-javascript-bundler-plugins-test-api
245+
ports:
246+
- 8000:8000
242247
strategy:
243248
fail-fast: false
244249
matrix:
@@ -283,7 +288,7 @@ jobs:
283288
run: pnpm run build
284289

285290
- name: Run e2e tests
286-
run: pnpm run test:e2e --maxWorkers=2
291+
run: pnpm run test:e2e
287292

288293
upload-build-stats-production:
289294
name: Build and upload ${{ matrix.example }} stats data to production
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
// Bun Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Generating rollup stats version 3 matches the snapshot 1`] = `
4+
{
5+
"assets": [
6+
{
7+
"name": "main-cc182ba1.js",
8+
"normalized": "main-*.js",
9+
"size": 577066,
10+
},
11+
],
12+
"builtAt": Any<Number>,
13+
"bundleName": "test-rollup-v3-iife",
14+
"bundler": {
15+
"name": "rollup",
16+
"version": "3.29.4",
17+
},
18+
"chunks": [
19+
{
20+
"entry": true,
21+
"files": [
22+
"main-cc182ba1.js",
23+
],
24+
"id": "main",
25+
"initial": false,
26+
"names": [
27+
"main",
28+
],
29+
"uniqueId": "0-main",
30+
},
31+
],
32+
"duration": Any<Number>,
33+
"modules": [
34+
{
35+
"chunkUniqueIds": [
36+
"0-main",
37+
],
38+
"name": "./commonjsHelpers.js",
39+
"size": 334,
40+
},
41+
{
42+
"chunkUniqueIds": [
43+
"0-main",
44+
],
45+
"name": "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js?commonjs-module",
46+
"size": 27,
47+
},
48+
{
49+
"chunkUniqueIds": [
50+
"0-main",
51+
],
52+
"name": "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js",
53+
"size": 560240,
54+
},
55+
{
56+
"chunkUniqueIds": [
57+
"0-main",
58+
],
59+
"name": "./test-apps/rollup/src/getRandomNumber.js",
60+
"size": 98,
61+
},
62+
{
63+
"chunkUniqueIds": [
64+
"0-main",
65+
],
66+
"name": "./test-apps/rollup/src/main.js",
67+
"size": 163,
68+
},
69+
],
70+
"outputPath": StringContaining "/distV3",
71+
"plugin": {
72+
"name": "codecov-rollup-bundle-analysis-plugin",
73+
"version": "1.0.0",
74+
},
75+
"version": "1",
76+
}
77+
`;
78+
79+
exports[`Generating rollup stats version 4 matches the snapshot 1`] = `
80+
{
81+
"assets": [
82+
{
83+
"name": "main-ChwnvxRF.js",
84+
"normalized": "main-ChwnvxRF.js",
85+
"size": 577066,
86+
},
87+
],
88+
"builtAt": Any<Number>,
89+
"bundleName": "test-rollup-v4-iife",
90+
"bundler": {
91+
"name": "rollup",
92+
"version": "4.9.6",
93+
},
94+
"chunks": [
95+
{
96+
"entry": true,
97+
"files": [
98+
"main-ChwnvxRF.js",
99+
],
100+
"id": "main",
101+
"initial": false,
102+
"names": [
103+
"main",
104+
],
105+
"uniqueId": "0-main",
106+
},
107+
],
108+
"duration": Any<Number>,
109+
"modules": [
110+
{
111+
"chunkUniqueIds": [
112+
"0-main",
113+
],
114+
"name": "./commonjsHelpers.js",
115+
"size": 334,
116+
},
117+
{
118+
"chunkUniqueIds": [
119+
"0-main",
120+
],
121+
"name": "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js?commonjs-module",
122+
"size": 27,
123+
},
124+
{
125+
"chunkUniqueIds": [
126+
"0-main",
127+
],
128+
"name": "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js",
129+
"size": 560240,
130+
},
131+
{
132+
"chunkUniqueIds": [
133+
"0-main",
134+
],
135+
"name": "./test-apps/rollup/src/getRandomNumber.js",
136+
"size": 98,
137+
},
138+
{
139+
"chunkUniqueIds": [
140+
"0-main",
141+
],
142+
"name": "./test-apps/rollup/src/main.js",
143+
"size": 163,
144+
},
145+
],
146+
"outputPath": StringContaining "/distV4",
147+
"plugin": {
148+
"name": "codecov-rollup-bundle-analysis-plugin",
149+
"version": "1.0.0",
150+
},
151+
"version": "1",
152+
}
153+
`;

integration-tests/fixtures/generate-bundle-stats/rollup/__snapshots__/rollup-v3-plugin.test.ts.snap

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

integration-tests/fixtures/generate-bundle-stats/rollup/__snapshots__/rollup-v4-plugin.test.ts.snap

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

0 commit comments

Comments
 (0)