browsertime icon indicating copy to clipboard operation
browsertime copied to clipboard

Inconsistent replacing of characters in path names

Open eserte opened this issue 4 years ago • 3 comments

Starting with sitespeed.io:16.0.2, some characters (at least the colon) in path names are in some places replaced to a "-", in other places not replaced at all.

To reproduce the issue create an urls.txt file with a ":" in the alias part:

$ cat /tmp/sitespeed/urls.txt 
https://www.sitespeed.io foo:bar

$ docker run --name=sitespeed_mobile --privileged --shm-size=1g --rm -v /tmp/sitespeed:/sitespeed.io sitespeedio/sitespeed.io:16.8.0 --browsertime.iterations 1 -b chrome ./urls.txt
...
[2021-02-08 13:59:50] INFO: Could not read filmstrip dir Error: ENOENT: no such file or directory, scandir '/sitespeed.io/sitespeed-result/www.sitespeed.io/2021-02-08-13-59-34/pages/www_sitespeed_io/foo-bar/data/filmstrip/1''
[2021-02-08 13:59:52] INFO: Could not read filmstrip dir Error: ENOENT: no such file or directory, scandir '/sitespeed.io/sitespeed-result/www.sitespeed.io/2021-02-08-13-59-34/pages/www_sitespeed_io/foo-bar/data/filmstrip/1''
...

Looking at the result pages, it's not possible to access the screenshot image or video.

The file tree also shows the inconsistent replacing:

$ cd /tmp/sitespeed/sitespeed-result/www.sitespeed.io/2021-02-08-13-59-34
$ find pages/www_sitespeed_io/
pages/www_sitespeed_io/
pages/www_sitespeed_io/foo:bar
pages/www_sitespeed_io/foo:bar/data
pages/www_sitespeed_io/foo:bar/data/video
pages/www_sitespeed_io/foo:bar/data/video/1.mp4
pages/www_sitespeed_io/foo:bar/data/video/images
pages/www_sitespeed_io/foo:bar/data/video/images/1
pages/www_sitespeed_io/foo:bar/data/screenshots
pages/www_sitespeed_io/foo:bar/data/screenshots/1
pages/www_sitespeed_io/foo:bar/data/screenshots/1/afterPageCompleteCheck.png
pages/www_sitespeed_io/foo:bar/data/filmstrip
pages/www_sitespeed_io/foo:bar/data/filmstrip/1
pages/www_sitespeed_io/foo:bar/data/filmstrip/1/ms_000733.png
pages/www_sitespeed_io/foo:bar/data/filmstrip/1/ms_000000.png
pages/www_sitespeed_io/foo:bar/data/filmstrip/1/ms_000666.png
pages/www_sitespeed_io/foo-bar
pages/www_sitespeed_io/foo-bar/data
pages/www_sitespeed_io/foo-bar/data/browsertime.har
pages/www_sitespeed_io/foo-bar/1.html
pages/www_sitespeed_io/foo-bar/index.html

eserte avatar Feb 09 '21 09:02 eserte

Hi @eserte thanks for filing the issue, let me fix that before the next release.

soulgalore avatar Feb 09 '21 14:02 soulgalore

Maybe it would be a good idea to test more systematically. I tried all printable ASCII characters as alias:

$ cat /tmp/sitespeed/urls.txt 
https://www.sitespeed.io !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

And run into the following error:

[2021-02-10 10:15:53] ERROR: VisualMetrics failed to run Error: Command failed with exit code 1: python /usr/src/app/node_modules/browsertime/browsertime/visualmetrics.py --dir /sitespeed.io/sitespeed-result/www.sitespeed.io/2021-02-10-10-15-39/pages/www_sitespeed_io/-------------.-0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~/data/filmstrip/1 --video /sitespeed.io/sitespeed-result/www.sitespeed.io/2021-02-10-10-15-39/pages/www_sitespeed_io/-------------.-0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~/data/video/1.mp4 --orange --force --renderignore 5 --json --viewport -q 75 --logfile /sitespeed.io/sitespeed-result/www.sitespeed.io/2021-02-10-10-15-39/pages/www_sitespeed_io/-------------.-0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~/data/video/1.visualmetrics.log -vvv
...
/bin/sh: 1: Syntax error: EOF in backquote substitution
...

So at least the backqoute needs special care, it seems.

eserte avatar Feb 10 '21 10:02 eserte

A command between backquotes even gets evaluated at some place:

$ cat /tmp/sitespeed/urls.txt 
https://www.sitespeed.io !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`date`abcdefghijklmnopqrstuvwxyz{|}~

Results in:

[2021-02-10 10:24:00] ERROR: VisualMetrics failed to run Error: Command failed with exit code 1: python /usr/src/app/node_modules/browsertime/browsertime/visualmetrics.py --dir /sitespeed.io/sitespeed-result/www.sitespeed.io/2021-02-10-10-23-47/pages/www_sitespeed_io/-------------.-0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`date`abcdefghijklmnopqrstuvwxyz{|}~/data/filmstrip/1 --video /sitespeed.io/sitespeed-result/www.sitespeed.io/2021-02-10-10-23-47/pages/www_sitespeed_io/-------------.-0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`date`abcdefghijklmnopqrstuvwxyz{|}~/data/video/1.mp4 --orange --force --renderignore 5 --json --viewport -q 75 --logfile /sitespeed.io/sitespeed-result/www.sitespeed.io/2021-02-10-10-23-47/pages/www_sitespeed_io/-------------.-0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`date`abcdefghijklmnopqrstuvwxyz{|}~/data/video/1.visualmetrics.log -vvv
...
mogrify-im6.q16: unable to open image `/sitespeed.io/sitespeed-result/www.sitespeed.io/2021-02-10-10-23-47/pages/www_sitespeed_io/-------------.-0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_Wed Feb 10 10:24:00 UTC 2021abcdefghijklmnopqrstuvwxyz{|}~/data/filmstrip/1/ms_*.png': No such file or directory @ error/blob.c/OpenBlob/2874.
...

eserte avatar Feb 10 '21 10:02 eserte