Skip to content

Commit

Permalink
ref: Refactor Integration Tests (#75)
Browse files Browse the repository at this point in the history
Refactor integration tests to use Bun shell util as well as bun tests to actually build the apps via the CLI.
  • Loading branch information
nicholas-codecov committed Feb 20, 2024
1 parent aa4ffc3 commit 11eed01
Show file tree
Hide file tree
Showing 28 changed files with 748 additions and 684 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const config = {
"**/dist/**",
"**/node_modules/**",
"**/test-apps/**",
"**/integration-tests/**/*.cjs",
],
parserOptions: {
ecmaVersion: "latest",
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ jobs:
name: Run Integration Tests (Node ${{ matrix.node-version }})
needs: install
runs-on: ubuntu-latest
services:
test-api:
image: codecov/codecov-javascript-bundler-plugins-test-api
ports:
- 8000:8000
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -283,7 +288,7 @@ jobs:
run: pnpm run build

- name: Run e2e tests
run: pnpm run test:e2e --maxWorkers=2
run: pnpm run test:e2e

upload-build-stats-production:
name: Build and upload ${{ matrix.example }} stats data to production
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
// Bun Snapshot v1, https://goo.gl/fbAQLP

exports[`Generating rollup stats version 3 matches the snapshot 1`] = `
{
"assets": [
{
"name": "main-cc182ba1.js",
"normalized": "main-*.js",
"size": 577066,
},
],
"builtAt": Any<Number>,
"bundleName": "test-rollup-v3-iife",
"bundler": {
"name": "rollup",
"version": "3.29.4",
},
"chunks": [
{
"entry": true,
"files": [
"main-cc182ba1.js",
],
"id": "main",
"initial": false,
"names": [
"main",
],
"uniqueId": "0-main",
},
],
"duration": Any<Number>,
"modules": [
{
"chunkUniqueIds": [
"0-main",
],
"name": "./commonjsHelpers.js",
"size": 334,
},
{
"chunkUniqueIds": [
"0-main",
],
"name": "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js?commonjs-module",
"size": 27,
},
{
"chunkUniqueIds": [
"0-main",
],
"name": "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js",
"size": 560240,
},
{
"chunkUniqueIds": [
"0-main",
],
"name": "./test-apps/rollup/src/getRandomNumber.js",
"size": 98,
},
{
"chunkUniqueIds": [
"0-main",
],
"name": "./test-apps/rollup/src/main.js",
"size": 163,
},
],
"outputPath": StringContaining "/distV3",
"plugin": {
"name": "codecov-rollup-bundle-analysis-plugin",
"version": "1.0.0",
},
"version": "1",
}
`;
exports[`Generating rollup stats version 4 matches the snapshot 1`] = `
{
"assets": [
{
"name": "main-ChwnvxRF.js",
"normalized": "main-ChwnvxRF.js",
"size": 577066,
},
],
"builtAt": Any<Number>,
"bundleName": "test-rollup-v4-iife",
"bundler": {
"name": "rollup",
"version": "4.9.6",
},
"chunks": [
{
"entry": true,
"files": [
"main-ChwnvxRF.js",
],
"id": "main",
"initial": false,
"names": [
"main",
],
"uniqueId": "0-main",
},
],
"duration": Any<Number>,
"modules": [
{
"chunkUniqueIds": [
"0-main",
],
"name": "./commonjsHelpers.js",
"size": 334,
},
{
"chunkUniqueIds": [
"0-main",
],
"name": "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js?commonjs-module",
"size": 27,
},
{
"chunkUniqueIds": [
"0-main",
],
"name": "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js",
"size": 560240,
},
{
"chunkUniqueIds": [
"0-main",
],
"name": "./test-apps/rollup/src/getRandomNumber.js",
"size": 98,
},
{
"chunkUniqueIds": [
"0-main",
],
"name": "./test-apps/rollup/src/main.js",
"size": 163,
},
],
"outputPath": StringContaining "/distV4",
"plugin": {
"name": "codecov-rollup-bundle-analysis-plugin",
"version": "1.0.0",
},
"version": "1",
}
`;

This file was deleted.

This file was deleted.

Loading

0 comments on commit 11eed01

Please sign in to comment.