browsertime 22.4.0 → 22.4.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Browsertime changelog (we do [semantic versioning](https://semver.org))
2
2
 
3
+ ## 22.3.1 - 2024-06-07
4
+ ### Fixed
5
+ * Make sure the engine is stopped before the extra video/profile run [#2140](https://github.com/sitespeedio/browsertime/pull/2140).
6
+
3
7
  ## 22.3.0 - 2024-06-06
4
8
  ### Added
5
9
  * Use `--enableVideoRun` to get one extra run with a video and visual metrics [#2139](https://github.com/sitespeedio/browsertime/pull/2139)
@@ -123,40 +123,6 @@ async function run(urls, options) {
123
123
  );
124
124
  }
125
125
 
126
- if (options.enableProfileRun || options.enableVideoRun) {
127
- log.info('Make one extra run to collect trace/video information');
128
- options.iterations = 1;
129
- if (options.enableProfileRun) {
130
- if (options.browser === 'firefox') {
131
- options.firefox.geckoProfiler = true;
132
- } else if (options.browser === 'chrome') {
133
- options.chrome.timeline = true;
134
- options.cpu = true;
135
- options.chrome.enableTraceScreenshots = true;
136
- options.chrome.traceCategory = [
137
- 'disabled-by-default-v8.cpu_profiler'
138
- ];
139
- }
140
- }
141
- if (options.enableVideoRun) {
142
- if (options.video === true) {
143
- log.error(
144
- 'You can only configure video run if you do not collect any video'
145
- );
146
- // This is a hack to not get an error
147
- options.video = false;
148
- options.visualMetrics = false;
149
- } else {
150
- options.video = true;
151
- options.visualMetrics = true;
152
- }
153
- }
154
- const traceEngine = new Engine(options);
155
- await traceEngine.start();
156
- await traceEngine.runMultiple(urls, scriptsByCategory);
157
- await traceEngine.stop();
158
- }
159
-
160
126
  await Promise.all(saveOperations);
161
127
 
162
128
  const resultDirectory = relative(process.cwd(), storageManager.directory);
@@ -186,6 +152,41 @@ async function run(urls, options) {
186
152
  process.exitCode = 1;
187
153
  }
188
154
  }
155
+
156
+ if (options.enableProfileRun || options.enableVideoRun) {
157
+ log.info('Make one extra run to collect trace/video information');
158
+ options.iterations = 1;
159
+ if (options.enableProfileRun) {
160
+ if (options.browser === 'firefox') {
161
+ options.firefox.geckoProfiler = true;
162
+ } else if (options.browser === 'chrome') {
163
+ options.chrome.timeline = true;
164
+ options.cpu = true;
165
+ options.chrome.enableTraceScreenshots = true;
166
+ options.chrome.traceCategory = [
167
+ 'disabled-by-default-v8.cpu_profiler'
168
+ ];
169
+ }
170
+ }
171
+ if (options.enableVideoRun) {
172
+ if (options.video === true) {
173
+ log.error(
174
+ 'You can only configure video run if you do not collect any video'
175
+ );
176
+ // This is a hack to not get an error
177
+ options.video = false;
178
+ options.visualMetrics = false;
179
+ } else {
180
+ options.video = true;
181
+ options.visualMetrics = true;
182
+ }
183
+ }
184
+ const traceEngine = new Engine(options);
185
+ await traceEngine.start();
186
+ await traceEngine.runMultiple(urls, scriptsByCategory);
187
+ await traceEngine.stop();
188
+ log.info('Extra run finished');
189
+ }
189
190
  } catch (error) {
190
191
  log.error('Error running browsertime', error);
191
192
  process.exitCode = 1;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "browsertime",
3
3
  "description": "Get performance metrics from your web page using Browsertime.",
4
- "version": "22.4.0",
4
+ "version": "22.4.1",
5
5
  "bin": "./bin/browsertime.js",
6
6
  "type": "module",
7
7
  "types": "./types/scripting.d.ts",