@memlab/e2e 2.0.5 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,86 @@
1
- ## memlab E2E
1
+ # @memlab/e2e
2
2
 
3
- This is the memlab E2E testing framework for headless/headful Chromium. It is mainly responsible
4
- for controling/interacting with browser, recording heap snapshots, and logging other execution meta data.
3
+ memlab's browser automation layer. It drives Chromium through
4
+ [Puppeteer](https://pptr.dev/), runs the steps of a test scenario, and records
5
+ what memlab needs to find memory leaks: a JavaScript heap snapshot after each
6
+ step, screenshots, the browser console output, and metadata about the run.
7
+
8
+ You rarely need to depend on this package directly.
9
+ [`memlab run`](https://www.npmjs.com/package/memlab) and
10
+ [`@memlab/api`](https://www.npmjs.com/package/@memlab/api) use it for you. It
11
+ is published separately so the other memlab packages can share it.
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ npm install @memlab/e2e
17
+ ```
18
+
19
+ ## What a run does
20
+
21
+ For a [test scenario](https://meta.github.io/memlab/docs/api/core/src/interfaces/IScenario)
22
+ with `url`, `action`, and `back` callbacks, the browser run:
23
+
24
+ 1. Launches Chromium, headless by default.
25
+ 2. Calls `beforeInitialPageLoad`, sets `cookies`, and loads the page returned
26
+ by `url`. Then it calls `setup` once. After this and every later step, it
27
+ waits until `isPageLoaded` returns true or, without that callback, until
28
+ the page has had no network connections for 500ms.
29
+ 3. Takes the **baseline** heap snapshot.
30
+ 4. Calls `action`, the interaction you suspect leaks memory, and takes the
31
+ **target** heap snapshot.
32
+ 5. Calls `back` to undo the interaction and takes the **final** heap snapshot.
33
+ With `repeat`, it runs `action` and `back` extra times first.
34
+
35
+ Before each snapshot it runs garbage collection in the page, and on the target
36
+ and final pages it does extra interactions such as scrolling and waiting.
37
+ Comparing the three snapshots finds objects that were allocated by `action`
38
+ but are still alive after `back`. See
39
+ [How memlab Works](https://meta.github.io/memlab/docs/how-memlab-works).
40
+
41
+ ## What it writes
42
+
43
+ Results go to the working directory (`--work-dir`, or
44
+ `memlab get-default-work-dir`):
45
+
46
+ ```
47
+ data/cur/
48
+ ├── s1.heapsnapshot # baseline: after the initial page load
49
+ ├── s2.heapsnapshot # target: after action
50
+ ├── s3.heapsnapshot # final: after back
51
+ ├── screenshot-1.png # one screenshot per step
52
+ ├── ...
53
+ ├── browser-info.txt # browser console output
54
+ ├── run-meta.json # browser and run configuration
55
+ └── snap-seq.json # one entry per interaction step
56
+ ```
57
+
58
+ Another E2E framework, such as Playwright or Cypress, can write these files
59
+ itself and hand them to memlab. See
60
+ [Integrate with Test Frameworks](https://meta.github.io/memlab/docs/guides/integrate-with-e2e-frameworks)
61
+ for the format of `snap-seq.json` and `run-meta.json`.
62
+
63
+ ## Browser options
64
+
65
+ These `memlab run` and `memlab snapshot` options are handled here:
66
+
67
+ | Option | Effect |
68
+ | --- | --- |
69
+ | `--headful` | Show the browser window |
70
+ | `--device <name>` | Emulate a device, for example a phone |
71
+ | `--user-agent <ua>` | Override the browser's user agent |
72
+ | `--chromium-binary <path>` | Use a specific Chromium build |
73
+ | `--full` | Take a heap snapshot after every step, not just the three above |
74
+ | `--skip-gc`, `--skip-scroll`, `--skip-extra-ops`, `--skip-screenshot` | Skip parts of each step to make a run faster |
75
+ | `--display-leak-outlines` | Outline leaked components on the page (with `--headful`), using [`@memlab/lens`](https://www.npmjs.com/package/@memlab/lens) |
76
+ | `--disable-xvfb` | Don't use a virtual display for headful runs on Linux |
77
+ | `--protocol-timeout <ms>` | Allow more time for very large heap snapshots |
78
+
79
+ The full list is in the
80
+ [CLI reference](https://meta.github.io/memlab/docs/cli/run/).
5
81
 
6
82
  ## Online Resources
7
- * [Official Website and Demo](https://facebook.github.io/memlab)
8
- * [Documentation](https://facebook.github.io/memlab/docs/intro)
83
+
84
+ * [Official Website and Demo](https://meta.github.io/memlab)
85
+ * [Documentation](https://meta.github.io/memlab/docs/intro)
86
+ * [Test scenario reference](https://meta.github.io/memlab/docs/api/core/src/interfaces/IScenario)
@@ -37,7 +37,7 @@ class E2EInteractionManager {
37
37
  this.evalFuncAfterInitLoad = null;
38
38
  this.page = page;
39
39
  this.browser = browser;
40
- this.networkManager = new NetworkManager_1.default(page);
40
+ this.networkManager = new NetworkManager_1.default();
41
41
  }
42
42
  getChosenCDPSession() {
43
43
  return __awaiter(this, void 0, void 0, function* () {
@@ -7,13 +7,12 @@
7
7
  * @format
8
8
  * @oncall memory_lab
9
9
  */
10
- import type { CDPSession, Page } from 'puppeteer-core';
10
+ import type { CDPSession } from 'puppeteer-core';
11
11
  export default class NetworkManager {
12
12
  private cdpSession;
13
- private page;
14
13
  private requestCache;
15
14
  private scriptManager;
16
- constructor(page: Page);
15
+ constructor();
17
16
  setCDPSession(session: CDPSession): void;
18
17
  private networkLog;
19
18
  interceptScript(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkManager.d.ts","sourceRoot":"","sources":["../src/NetworkManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,gBAAgB,CAAC;AAgBrD,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,OAAO,CAAC,UAAU,CAA8B;IAChD,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,YAAY,CAAsB;IAC1C,OAAO,CAAC,aAAa,CAAgB;gBAEzB,IAAI,EAAE,IAAI;IAMf,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;IAI/C,OAAO,CAAC,UAAU;IAML,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;CAiH9C"}
1
+ {"version":3,"file":"NetworkManager.d.ts","sourceRoot":"","sources":["../src/NetworkManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAgB/C,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,OAAO,CAAC,UAAU,CAA8B;IAChD,OAAO,CAAC,YAAY,CAAsB;IAC1C,OAAO,CAAC,aAAa,CAAgB;;IAO9B,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;IAI/C,OAAO,CAAC,UAAU;IAML,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;CAiH9C"}
@@ -25,9 +25,8 @@ const core_1 = require("@memlab/core");
25
25
  const ScriptManager_1 = __importDefault(require("./ScriptManager"));
26
26
  const patterns = ['*'];
27
27
  class NetworkManager {
28
- constructor(page) {
28
+ constructor() {
29
29
  this.cdpSession = null;
30
- this.page = page;
31
30
  this.requestCache = new Map();
32
31
  this.scriptManager = new ScriptManager_1.default();
33
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TestRunnerLoader.d.ts","sourceRoot":"","sources":["../src/TestRunnerLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAC,iCAAiC,EAAC,MAAM,cAAc,CAAC;AAIpE,cAAM,gBAAgB;IACpB,IAAI,IAAI,iCAAiC,EAAE;CAuB5C;;AAED,wBAAsC"}
1
+ {"version":3,"file":"TestRunnerLoader.d.ts","sourceRoot":"","sources":["../src/TestRunnerLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAC,iCAAiC,EAAC,MAAM,cAAc,CAAC;AAMpE,cAAM,gBAAgB;IACpB,IAAI,IAAI,iCAAiC,EAAE;CAyB5C;;AAED,wBAAsC"}
@@ -15,6 +15,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const path_1 = __importDefault(require("path"));
16
16
  const core_1 = require("@memlab/core");
17
17
  const BaseSynthesizer_1 = __importDefault(require("./BaseSynthesizer"));
18
+ const DefaultScenarioSynthesizer_1 = __importDefault(require("./plugins/DefaultScenarioSynthesizer"));
19
+ const TestSPAVisitSynthesizer_1 = __importDefault(require("./plugins/TestSPAVisitSynthesizer"));
18
20
  class TestRunnerLoader {
19
21
  load() {
20
22
  const ret = [];
@@ -35,7 +37,9 @@ class TestRunnerLoader {
35
37
  }
36
38
  ret.push(constructor);
37
39
  });
38
- return ret;
40
+ return ret.length > 0
41
+ ? ret
42
+ : [DefaultScenarioSynthesizer_1.default, TestSPAVisitSynthesizer_1.default];
39
43
  }
40
44
  }
41
45
  exports.default = new TestRunnerLoader();
@@ -18,7 +18,6 @@ export type ClosureScope = {
18
18
  loc: Optional<SourceLocation>;
19
19
  };
20
20
  export default class Script {
21
- private code;
22
21
  private ast;
23
22
  private closureScopeTree;
24
23
  constructor(code: string);
@@ -26,7 +25,6 @@ export default class Script {
26
25
  private locToStr;
27
26
  private findParentFunctionPath;
28
27
  private findParentFunctionClosureScope;
29
- private findGrandparentFunctionClosureScope;
30
28
  private buildClosureScopeTree;
31
29
  }
32
30
  //# sourceMappingURL=Script.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../src/code-analysis/Script.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAW,QAAQ,EAAC,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAQV,cAAc,EACf,MAAM,cAAc,CAAC;AAQtB,MAAM,MAAM,YAAY,GAAG;IACzB,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,4BAA4B,EAAE,MAAM,EAAE,CAAC;IACvC,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B,GAAG,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;CAC/B,CAAC;AAmBF,MAAM,CAAC,OAAO,OAAO,MAAM;IACzB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,GAAG,CAAwB;IACnC,OAAO,CAAC,gBAAgB,CAAe;gBAE3B,IAAI,EAAE,MAAM;IAQjB,mBAAmB,IAAI,YAAY;IAI1C,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,sBAAsB;IAmB9B,OAAO,CAAC,8BAA8B;IAiBtC,OAAO,CAAC,mCAAmC;IAuB3C,OAAO,CAAC,qBAAqB;CA+F9B"}
1
+ {"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../src/code-analysis/Script.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAW,QAAQ,EAAC,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAQV,cAAc,EACf,MAAM,cAAc,CAAC;AAQtB,MAAM,MAAM,YAAY,GAAG;IACzB,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,4BAA4B,EAAE,MAAM,EAAE,CAAC;IACvC,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B,GAAG,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;CAC/B,CAAC;AAmBF,MAAM,CAAC,OAAO,OAAO,MAAM;IACzB,OAAO,CAAC,GAAG,CAAwB;IACnC,OAAO,CAAC,gBAAgB,CAAe;gBAE3B,IAAI,EAAE,MAAM;IAOjB,mBAAmB,IAAI,YAAY;IAI1C,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,sBAAsB;IAmB9B,OAAO,CAAC,8BAA8B;IAiBtC,OAAO,CAAC,qBAAqB;CA0F9B"}
@@ -24,7 +24,6 @@ function isFunctionType(type) {
24
24
  }
25
25
  class Script {
26
26
  constructor(code) {
27
- this.code = code;
28
27
  this.ast = (0, parser_1.parse)(code, {
29
28
  sourceType: 'script',
30
29
  });
@@ -64,21 +63,6 @@ class Script {
64
63
  }
65
64
  return parentClosureScope;
66
65
  }
67
- findGrandparentFunctionClosureScope(locToClosureScopeMap, path) {
68
- const parentPath = this.findParentFunctionPath(path);
69
- if (!parentPath) {
70
- throw core_1.utils.haltOrThrow('cannot find parent scope');
71
- }
72
- const grandparentPath = this.findParentFunctionPath(parentPath);
73
- if (!grandparentPath) {
74
- return null;
75
- }
76
- const grandparentClosureScope = locToClosureScopeMap.get(this.locToStr(grandparentPath.node.loc));
77
- if (!grandparentClosureScope) {
78
- throw core_1.utils.haltOrThrow('cannot find parent scope');
79
- }
80
- return grandparentClosureScope;
81
- }
82
66
  buildClosureScopeTree(ast) {
83
67
  const root = {
84
68
  functionName: null,
@@ -90,10 +74,8 @@ class Script {
90
74
  };
91
75
  const locToClosureScopeMap = new Map();
92
76
  locToClosureScopeMap.set(this.locToStr(ast.program.loc), root);
93
- // eslint-disable-next-line @typescript-eslint/no-this-alias
94
- const self = this;
95
77
  // build closure scope hierarchy
96
- const buildClosureScopeFromFunction = function (path) {
78
+ const buildClosureScopeFromFunction = (path) => {
97
79
  var _a, _b;
98
80
  const closureScope = {
99
81
  functionName: 'id' in path.node ? (_b = (_a = path.node) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.name : null,
@@ -103,9 +85,9 @@ class Script {
103
85
  nestedClosures: [],
104
86
  loc: path.node.loc,
105
87
  };
106
- locToClosureScopeMap.set(self.locToStr(path.node.loc), closureScope);
88
+ locToClosureScopeMap.set(this.locToStr(path.node.loc), closureScope);
107
89
  // find and connect to parent closure scope
108
- const parentClosureScope = self.findParentFunctionClosureScope(locToClosureScopeMap, path);
90
+ const parentClosureScope = this.findParentFunctionClosureScope(locToClosureScopeMap, path);
109
91
  parentClosureScope.nestedClosures.push(closureScope);
110
92
  };
111
93
  // Traverse the parent scope of the containing scope
@@ -113,28 +95,28 @@ class Script {
113
95
  // 1. This is a var use in the containing scope
114
96
  // 2. This is a var defined in the direct parent scope
115
97
  // of the containing scope
116
- // If true, add the identifer name to the usedVariablesFromParentScope
98
+ // If true, add the identifier name to the usedVariablesFromParentScope
117
99
  // of the containing scope
118
- const fillInVarInfo = function (path) {
100
+ const fillInVarInfo = (path) => {
119
101
  // if the identifier is a function name of a function definition
120
102
  if (isFunctionType(path.parentPath.node.type)) {
121
103
  return;
122
104
  }
123
105
  const name = path.node.name;
124
- let parentPath = self.findParentFunctionPath(path);
106
+ let parentPath = this.findParentFunctionPath(path);
125
107
  let parentClosureScope = parentPath
126
- ? locToClosureScopeMap.get(self.locToStr(parentPath.node.loc))
108
+ ? locToClosureScopeMap.get(this.locToStr(parentPath.node.loc))
127
109
  : null;
128
110
  // eslint-disable-next-line no-constant-condition
129
111
  while (true) {
130
112
  if (!parentPath || !parentClosureScope) {
131
113
  break;
132
114
  }
133
- const grandparentPath = self.findParentFunctionPath(parentPath);
115
+ const grandparentPath = this.findParentFunctionPath(parentPath);
134
116
  if (!grandparentPath) {
135
117
  break;
136
118
  }
137
- const grandparentClosureScope = locToClosureScopeMap.get(self.locToStr(grandparentPath.node.loc));
119
+ const grandparentClosureScope = locToClosureScopeMap.get(this.locToStr(grandparentPath.node.loc));
138
120
  if (!grandparentClosureScope) {
139
121
  break;
140
122
  }
@@ -1 +1 @@
1
- {"version":3,"file":"E2EUtils.d.ts","sourceRoot":"","sources":["../../src/lib/E2EUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,qBAAqB,EACrB,SAAS,EACT,QAAQ,EACR,aAAa,EAGd,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,gBAAgB,CAAC;AAQrD,KAAK,gBAAgB,GAAG,CAAC,EAAE,EAAE,KAAK,KAAK,IAAI,CAAC;AAE5C,iBAAS,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CASnD;AAGD,iBAAS,eAAe,CACtB,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,qBAAqB,GAC/B,MAAM,CAcR;AAED,iBAAS,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAajD;AAED,iBAAS,cAA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B,CAAC,EAAE,MAAM,CAAA;CAAM,GACrE,OAAO,CAAC,IAAI,CAAC,CA4Bf;AAED,iBAAe,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAUrD;AAED,iBAAe,iBAAiB,CAC9B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,iBAAe,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBlE;AAED,iBAAe,0BAA0B,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAUrE;AAID,iBAAe,2BAA2B,CACxC,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,UAAU,CAAC,CAarB;AAED,iBAAS,kBAAkB,CAAC,QAAQ,GAAE,QAAQ,CAAC,SAAS,CAAQ,GAAG,MAAM,CAKxE;;;;;;;;;;;;;;;;;;;;;;AAMD,wBAwBE"}
@@ -111,14 +111,12 @@ function checkURL(page, intendedURL) {
111
111
  function injectPageReloadChecker(page) {
112
112
  return __awaiter(this, void 0, void 0, function* () {
113
113
  yield page.evaluate(() => {
114
- // @ts-expect-error TODO: add Window shim type
115
114
  window.__memlab_check_reload = 1;
116
115
  });
117
116
  });
118
117
  }
119
118
  function checkPageReload(page) {
120
119
  return __awaiter(this, void 0, void 0, function* () {
121
- // @ts-expect-error TODO: add Window shim type
122
120
  const flag = yield page.evaluate(() => window.__memlab_check_reload);
123
121
  if (flag !== 1) {
124
122
  core_2.utils.haltOrThrow('The page is reloaded. MemLab cannot analyze heap across page reloads. ' +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memlab/e2e",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "license": "MIT",
5
5
  "description": "memlab browser E2E interaction libraries",
6
6
  "author": "Liang Gong <lgong@meta.com>",
@@ -25,8 +25,8 @@
25
25
  "@babel/parser": "^7.16.4",
26
26
  "@babel/template": "^7.16.0",
27
27
  "@babel/traverse": "^7.16.3",
28
- "@memlab/core": "^2.0.5",
29
- "@memlab/lens": "^2.0.5",
28
+ "@memlab/core": "^2.0.7",
29
+ "@memlab/lens": "^2.0.7",
30
30
  "ansi": "^0.3.1",
31
31
  "babar": "^0.2.0",
32
32
  "chalk": "^4.0.0",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "repository": {
53
53
  "type": "git",
54
- "url": "git+https://github.com/facebook/memlab.git",
54
+ "url": "git+https://github.com/meta/memlab.git",
55
55
  "directory": "packages/e2e"
56
56
  },
57
57
  "scripts": {
@@ -61,7 +61,7 @@
61
61
  "clean-pkg": "rm -rf ./dist && rm -rf ./node_modules && rm -f ./tsconfig.tsbuildinfo"
62
62
  },
63
63
  "bugs": {
64
- "url": "https://github.com/facebook/memlab/issues"
64
+ "url": "https://github.com/meta/memlab/issues"
65
65
  },
66
- "homepage": "https://github.com/facebook/memlab#readme"
66
+ "homepage": "https://github.com/meta/memlab#readme"
67
67
  }