Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix broken filename for when enabling profile runs and visual metrics #2213

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,7 @@ jobs:
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/scripting/common.js --cjs
- name: Run test with scripting.js
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/scripting/module.js
- name: Test extra profile run Chrome
run: ./bin/browsertime.js -b chrome http://127.0.0.1:3000/simple/ -n 1 --viewPort 1000x600 --xvfb --enableProfileRun
- name: Test extra profile run Firefox
run: ./bin/browsertime.js -b firefox http://127.0.0.1:3000/simple/ -n 1 --viewPort 1000x600 --xvfb --enableProfileRun
11 changes: 9 additions & 2 deletions lib/firefox/webdriver/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ export class Firefox {
}

if (this.firefoxConfig.geckoProfiler && this.options.visualMetrics) {
const profileFilename = `geckoProfile-${index}.json.gz`;
const profileFilename = this.options.enableProfileRun
? `geckoProfile-${index}-extra.json.gz`
: `geckoProfile-${index}.json.gz`;
const profileSubdir = pathToFolder(result.url, this.options);

try {
Expand Down Expand Up @@ -361,7 +363,12 @@ export class Firefox {
geckoProfile.meta.visualMetrics = result.visualMetrics;

await this.storageManager.writeJson(
path.join(profileSubdir, `geckoProfile-${index}.json`),
path.join(
profileSubdir,
this.options.enableProfileRun
? `geckoProfile-${index}-extra.json.gz`
: `geckoProfile-${index}.json`
),
geckoProfile,
true
);
Expand Down
Loading