Skip to content

Commit

Permalink
fix(snackager): add e2e bundling test for `[email protected]
Browse files Browse the repository at this point in the history
….5` (#621)

* test(snackager): add e2e bundling test for `[email protected]`

* fix(snackager): add `babel-plugin-syntax-hermes-parser` to parse newer Flow syntax

* fix(snackager): update failing `git` E2E snapshots for SDK 52

* test(snackager): update snapshot sizes after babel flow change

* test(snackager): add test for `@draftbit/[email protected]`

* chore(snackager): bump shards to 5 to redistribute tests equally

* chore(snackager): increase E2E timeout with 1 minute
  • Loading branch information
byCedric authored Jan 3, 2025
1 parent 6acd10a commit 6aaf5c4
Show file tree
Hide file tree
Showing 16 changed files with 2,069 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/snackager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
shard: [1, 2, 3, 4, 5]
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repository
Expand All @@ -79,7 +79,7 @@ jobs:
uses: ./.github/actions/setup-snackager

- name: 🧪 Test snackager
run: yarn test:e2e --ci --shard=${{ matrix.shard }}/4
run: yarn test:e2e --ci --shard=${{ matrix.shard }}/5

build:
if: ${{ github.event_name == 'pull_request' }}
Expand Down
2 changes: 1 addition & 1 deletion snackager/jest/e2e.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ module.exports = {
testEnvironment: 'node',
setupFilesAfterEnv: ['<rootDir>/jest/unit.setup.js'],
testMatch: ['**/__e2e__/**/*.(spec|test).[tj]s?(x)'],
testTimeout: 1000 * 60 * 2,
testTimeout: 1000 * 60 * 3,
maxWorkers: 1,
};
3 changes: 2 additions & 1 deletion snackager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
"@babel/runtime": "^7.23.6",
"@expo/config": "^8.5.4",
"@expo/spawn-async": "^1.7.2",
"@react-native/babel-preset": "^0.73.19",
"aws-sdk": "^2.487.0",
"babel-loader": "^8.2.5",
"babel-plugin-syntax-hermes-parser": "^0.26.0",
"bunyan": "^1.8.12",
"bunyan-middleware": "^1.0.0",
"cors": "^2.8.5",
Expand All @@ -39,7 +41,6 @@
"lodash": "^4.17.11",
"md5": "^2.2.1",
"memory-fs": "^0.4.1",
"@react-native/babel-preset": "^0.73.19",
"node-fetch": "^2.6.0",
"picomatch": "^4.0.1",
"querystring": "^0.2.0",
Expand Down
6 changes: 3 additions & 3 deletions snackager/src/__e2e__/__snapshots__/git.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ exports[`git imports repository with no sdkVersion 1`] = `
},
"description": "test2 @ Jan 1, 2020",
"name": "test2",
"sdkVersion": "51.0.0",
"sdkVersion": "52.0.0",
},
},
"headers": {
Expand Down Expand Up @@ -261,7 +261,7 @@ exports[`git imports repository with too old sdkVersion 1`] = `
},
"description": "test3 @ Jan 1, 2020",
"name": "test3",
"sdkVersion": "51.0.0",
"sdkVersion": "52.0.0",
},
},
"headers": {
Expand Down Expand Up @@ -295,7 +295,7 @@ exports[`git imports repository without app.json 1`] = `
},
"description": "some-example @ Jan 1, 2020",
"name": "some-example",
"sdkVersion": "51.0.0",
"sdkVersion": "52.0.0",
},
},
"headers": {
Expand Down
1,748 changes: 1,748 additions & 0 deletions snackager/src/__e2e__/__snapshots__/lockfiles/@draftbit/[email protected]

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions snackager/src/__e2e__/__snapshots__/lockfiles/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@babel/[email protected]":
version "7.23.9"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.9.tgz#47791a15e4603bb5f905bc0753801cf21d6345f7"
integrity sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==
dependencies:
regenerator-runtime "^0.14.0"

escape-string-regexp@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==

[email protected]:
version "2.2.4"
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
dependencies:
loose-envify "^1.0.0"

"js-tokens@^3.0.0 || ^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==

loose-envify@^1.0.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
dependencies:
js-tokens "^3.0.0 || ^4.0.0"

regenerator-runtime@^0.14.0:
version "0.14.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f"
integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==
175 changes: 174 additions & 1 deletion snackager/src/__e2e__/bundler/__snapshots__/draftbit-ui.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,178 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`creates bundle for @draftbit/[email protected] 1`] = `
{
"files": {
"android": {
"assets/node_modules_reactnativedropdownpicker_src_themes_dark_icons_arrowdown.png": {
"size": 15000,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_dark_icons_arrowup.png": {
"size": 15000,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_dark_icons_close.png": {
"size": 15000,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_dark_icons_tick.png": {
"size": 15000,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_light_icons_arrowdown.png": {
"size": 0,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_light_icons_arrowup.png": {
"size": 0,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_light_icons_close.png": {
"size": 0,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_light_icons_tick.png": {
"size": 0,
},
"bundle.js": {
"externals": [
"@expo/vector-icons",
"AssetRegistry",
"expo",
"expo-av",
"expo-camera",
"expo-constants",
"expo-file-system",
"expo-linear-gradient",
"expo-modules-core",
"lottie-react-native",
"react",
"react-native",
"react-native-gesture-handler",
"react-native-reanimated",
"react-native-safe-area-context",
"react-native-svg",
"react-native/Libraries/BatchedBridge/BatchedBridge",
"react-native/Libraries/Image/resolveAssetSource",
"react-native/Libraries/NativeComponent/NativeComponentRegistry",
"react-native/Libraries/NativeComponent/ViewConfigIgnore",
"react-native/Libraries/ReactNative/RendererProxy",
"react-native/Libraries/Utilities/codegenNativeCommands",
"react-native/Libraries/Utilities/codegenNativeComponent",
"react/jsx-runtime",
"util",
],
"size": 1275000,
},
},
"ios": {
"assets/node_modules_reactnativedropdownpicker_src_themes_dark_icons_arrowdown.png": {
"size": 15000,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_dark_icons_arrowup.png": {
"size": 15000,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_dark_icons_close.png": {
"size": 15000,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_dark_icons_tick.png": {
"size": 15000,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_light_icons_arrowdown.png": {
"size": 0,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_light_icons_arrowup.png": {
"size": 0,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_light_icons_close.png": {
"size": 0,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_light_icons_tick.png": {
"size": 0,
},
"bundle.js": {
"externals": [
"@expo/vector-icons",
"AssetRegistry",
"expo",
"expo-av",
"expo-camera",
"expo-constants",
"expo-file-system",
"expo-linear-gradient",
"expo-modules-core",
"lottie-react-native",
"react",
"react-native",
"react-native-gesture-handler",
"react-native-reanimated",
"react-native-safe-area-context",
"react-native-svg",
"react-native/Libraries/Image/resolveAssetSource",
"react-native/Libraries/NativeComponent/NativeComponentRegistry",
"react-native/Libraries/NativeComponent/ViewConfigIgnore",
"react-native/Libraries/ReactNative/RendererProxy",
"react-native/Libraries/Utilities/codegenNativeCommands",
"react-native/Libraries/Utilities/codegenNativeComponent",
"react/jsx-runtime",
"util",
],
"size": 1275000,
},
},
"web": {
"assets/node_modules_reactnativedropdownpicker_src_themes_dark_icons_arrowdown.png": {
"size": 15000,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_dark_icons_arrowup.png": {
"size": 15000,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_dark_icons_close.png": {
"size": 15000,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_dark_icons_tick.png": {
"size": 15000,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_light_icons_arrowdown.png": {
"size": 0,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_light_icons_arrowup.png": {
"size": 0,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_light_icons_close.png": {
"size": 0,
},
"assets/node_modules_reactnativedropdownpicker_src_themes_light_icons_tick.png": {
"size": 0,
},
"bundle.js": {
"externals": [
"@expo/vector-icons",
"AssetRegistry",
"expo",
"expo-av",
"expo-camera",
"expo-file-system",
"expo-linear-gradient",
"expo-modules-core",
"lottie-react-native",
"react",
"react-dom",
"react-native",
"react-native-gesture-handler",
"react-native-reanimated",
"react-native-safe-area-context",
"react-native-svg",
"react-native-web",
"react/jsx-runtime",
"util",
],
"size": 2601000,
},
},
},
"name": "@draftbit/ui",
"peerDependencies": {
"react-native-reanimated": "~3.16.1",
},
"version": "52.0.5",
}
`;

exports[`externalizes package-externals of dependencies 1`] = `
{
"files": {
Expand Down Expand Up @@ -54,7 +227,7 @@ exports[`externalizes package-externals of dependencies 1`] = `
"react-native-svg",
"react/jsx-runtime",
],
"size": 699000,
"size": 696000,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ exports[`creates bundle for subpath 1`] = `
"react-native",
"react/jsx-runtime",
],
"size": 36000,
"size": 33000,
},
},
"ios": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports[`creates bundle for [email protected] 1`] = `
"react-native",
"react/jsx-runtime",
],
"size": 609000,
"size": 612000,
},
},
},
Expand Down Expand Up @@ -76,7 +76,7 @@ exports[`creates bundle for [email protected] 1`] = `
"react",
"react-native",
],
"size": 873000,
"size": 876000,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`creates bundle for react-native-webview 1`] = `
exports[`creates bundle for react-native-webview@13.7.0 1`] = `
{
"files": {
"android": {
Expand Down Expand Up @@ -53,3 +53,57 @@ exports[`creates bundle for react-native-webview 1`] = `
"version": "13.7.0",
}
`;

exports[`creates bundle for [email protected] 1`] = `
{
"files": {
"android": {
"bundle.js": {
"externals": [
"react",
"react-native",
"react-native/Libraries/BatchedBridge/BatchedBridge",
"react-native/Libraries/NativeComponent/NativeComponentRegistry",
"react-native/Libraries/NativeComponent/ViewConfigIgnore",
"react-native/Libraries/ReactNative/RendererProxy",
"react-native/Libraries/Utilities/codegenNativeCommands",
"react-native/Libraries/Utilities/codegenNativeComponent",
"react/jsx-runtime",
],
"size": 21000,
},
},
"ios": {
"bundle.js": {
"externals": [
"react",
"react-native",
"react-native/Libraries/NativeComponent/NativeComponentRegistry",
"react-native/Libraries/NativeComponent/ViewConfigIgnore",
"react-native/Libraries/ReactNative/RendererProxy",
"react-native/Libraries/Utilities/codegenNativeCommands",
"react-native/Libraries/Utilities/codegenNativeComponent",
"react/jsx-runtime",
],
"size": 18000,
},
},
"web": {
"bundle.js": {
"externals": [
"react",
"react-native",
"react/jsx-runtime",
],
"size": 0,
},
},
},
"name": "react-native-webview",
"peerDependencies": {
"react": "*",
"react-native": "*",
},
"version": "13.12.5",
}
`;
Loading

0 comments on commit 6aaf5c4

Please sign in to comment.