sitespeed.io 30.2.1 → 30.4.0

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.
@@ -9,19 +9,19 @@ jobs:
9
9
  steps:
10
10
  -
11
11
  name: Set up QEMU
12
- uses: docker/setup-qemu-action@v2
12
+ uses: docker/setup-qemu-action@v3
13
13
  -
14
14
  name: Set up Docker Buildx
15
- uses: docker/setup-buildx-action@v2
15
+ uses: docker/setup-buildx-action@v3
16
16
  -
17
17
  name: Login to DockerHub
18
- uses: docker/login-action@v2
18
+ uses: docker/login-action@v3
19
19
  with:
20
20
  username: ${{ secrets.DOCKERHUB_USERNAME }}
21
21
  password: ${{ secrets.DOCKERHUB_TOKEN }}
22
22
  -
23
23
  name: Build and push sitespeed.io
24
- uses: docker/build-push-action@v4
24
+ uses: docker/build-push-action@v5
25
25
  with:
26
26
  platforms: linux/amd64
27
27
  push: true
@@ -9,16 +9,16 @@ jobs:
9
9
  steps:
10
10
  -
11
11
  name: Checkout
12
- uses: actions/checkout@v3
12
+ uses: actions/checkout@v4
13
13
  -
14
14
  name: Set up QEMU
15
- uses: docker/setup-qemu-action@v1
15
+ uses: docker/setup-qemu-action@v3
16
16
  -
17
17
  name: Set up Docker Buildx
18
- uses: docker/setup-buildx-action@v2
18
+ uses: docker/setup-buildx-action@v3
19
19
  -
20
20
  name: Login to DockerHub
21
- uses: docker/login-action@v2
21
+ uses: docker/login-action@v3
22
22
  with:
23
23
  username: ${{ secrets.DOCKERHUB_USERNAME }}
24
24
  password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -30,7 +30,7 @@ jobs:
30
30
  strip_v: true
31
31
  -
32
32
  name: Build and push sitespeed.io
33
- uses: docker/build-push-action@v4
33
+ uses: docker/build-push-action@v5
34
34
  with:
35
35
  context: .
36
36
  platforms: linux/amd64,linux/arm64
@@ -39,7 +39,7 @@ jobs:
39
39
  tags: sitespeedio/sitespeed.io:${{steps.tag.outputs.tag}},sitespeedio/sitespeed.io:latest
40
40
  -
41
41
  name: Build and push sitespeed.io+1
42
- uses: docker/build-push-action@v4
42
+ uses: docker/build-push-action@v5
43
43
  with:
44
44
  context: .
45
45
  platforms: linux/amd64,linux/arm64
@@ -50,7 +50,7 @@ jobs:
50
50
  tags: sitespeedio/sitespeed.io:${{steps.tag.outputs.tag}}-plus1
51
51
  -
52
52
  name: Build and push sitespeed.io+wpt
53
- uses: docker/build-push-action@v4
53
+ uses: docker/build-push-action@v5
54
54
  with:
55
55
  context: .
56
56
  platforms: linux/amd64,linux/arm64
@@ -61,7 +61,7 @@ jobs:
61
61
  tags: sitespeedio/sitespeed.io:${{steps.tag.outputs.tag}}-webpagetest
62
62
  -
63
63
  name: Build and push sitespeed.io-slim
64
- uses: docker/build-push-action@v4
64
+ uses: docker/build-push-action@v5
65
65
  with:
66
66
  context: .
67
67
  platforms: linux/amd64,linux/arm64
@@ -10,9 +10,9 @@ jobs:
10
10
  build:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
- - uses: actions/checkout@v3
13
+ - uses: actions/checkout@v4
14
14
  - name: Use Node.js
15
- uses: actions/setup-node@v3
15
+ uses: actions/setup-node@v4
16
16
  with:
17
17
  node-version: '20.x'
18
18
  - name: Install sitespeed.io
@@ -10,7 +10,7 @@ jobs:
10
10
  runs-on: ubuntu-20.04
11
11
  steps:
12
12
  - name: Checkout code
13
- uses: actions/checkout@v3
13
+ uses: actions/checkout@v4
14
14
 
15
15
  - name: Build an image from Dockerfile
16
16
  run: |
@@ -10,7 +10,7 @@ jobs:
10
10
  build:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
- - uses: actions/checkout@v3
13
+ - uses: actions/checkout@v4
14
14
  - name: Build Docker containers
15
15
  run: |
16
16
  docker buildx install
@@ -28,8 +28,10 @@ jobs:
28
28
  run: docker run --rm -v "$(pwd)":/sitespeed.io --network=host sitespeedio/sitespeed.io http://127.0.0.1:3001 -n 1 -b edge
29
29
  - name: Run test on slim container
30
30
  run: docker run --rm -v "$(pwd)":/sitespeed.io --network=host sitespeedio/sitespeed.io:slim http://127.0.0.1:3001 -n 1 --browsertime.firefox.preference "devtools.netmonitor.persistlog:true"
31
- - name: Test WebPageReplay with Chrome
31
+ - name: Test WebPageReplay with Chrome
32
32
  run: docker run --cap-add=NET_ADMIN --rm -v "$(pwd)":/sitespeed.io -e REPLAY=true -e LATENCY=100 sitespeedio/sitespeed.io https://www.sitespeed.io -n 3 -b chrome
33
+ - name: Test WebPageReplay user journey with Chrome
34
+ run: docker run --cap-add=NET_ADMIN --rm -v "$(pwd)":/sitespeed.io -e REPLAY=true -e LATENCY=100 sitespeedio/sitespeed.io test/prepostscripts/multiWindows.cjs -n 1 -b chrome --multi
33
35
  - name: Test WebPageReplay with Firefox
34
36
  run: docker run --cap-add=NET_ADMIN --rm -v "$(pwd)":/sitespeed.io --network=host -e REPLAY=true -e LATENCY=100 sitespeedio/sitespeed.io https://www.sitespeed.io -n 3 -b firefox --browsertime.firefox.acceptInsecureCerts true
35
37
  - name: Run Chrome test with config
@@ -10,9 +10,9 @@ jobs:
10
10
  build:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
- - uses: actions/checkout@v3
13
+ - uses: actions/checkout@v4
14
14
  - name: Use Node.js
15
- uses: actions/setup-node@v3
15
+ uses: actions/setup-node@v4
16
16
  with:
17
17
  node-version: '20.x'
18
18
  - name: Install sitespeed.io
@@ -24,6 +24,11 @@ jobs:
24
24
  sudo apt-get update
25
25
  sudo apt-get --only-upgrade install google-chrome-stable
26
26
  google-chrome --version
27
+ - name: Install dependencies
28
+ run: |
29
+ python -m pip install --upgrade --user pip
30
+ python -m pip install --user scipy
31
+ python -m pip show scipy
27
32
  - name: Install Firefox
28
33
  uses: browser-actions/setup-firefox@latest
29
34
  #with:
@@ -69,4 +74,6 @@ jobs:
69
74
  - name: Run test with Influx 2.6.1
70
75
  run: bin/sitespeed.js http://127.0.0.1:3001/simple/ -n 1 --influxdb.host 127.0.0.1 --influxdb.port 8087 --influxdb.version 2 --influxdb.organisation sitespeed --influxdb.token sitespeed --xvfb
71
76
  - name: Run Chrome test with config
72
- run: node bin/sitespeed.js --config test/exampleConfig.json http://127.0.0.1:3001/simple/ --xvfb
77
+ run: node bin/sitespeed.js --config test/exampleConfig.json http://127.0.0.1:3001/simple/ --xvfb
78
+ - name: Run Chrome test using compare plugin
79
+ run: node bin/sitespeed.js --compare.id compare --compare.saveBaseline --compare.baselinePath test/ http://127.0.0.1:3001/simple/ --xvfb
@@ -10,9 +10,9 @@ jobs:
10
10
  build:
11
11
  runs-on: macos-latest
12
12
  steps:
13
- - uses: actions/checkout@v3
13
+ - uses: actions/checkout@v4
14
14
  - name: Use Node.js
15
- uses: actions/setup-node@v3
15
+ uses: actions/setup-node@v4
16
16
  with:
17
17
  node-version: '20.x'
18
18
  - name: Install dependencies
@@ -9,7 +9,7 @@ jobs:
9
9
  name: running sitespeed.io
10
10
  steps:
11
11
  - name: code checkout
12
- uses: actions/checkout@v3
12
+ uses: actions/checkout@v4
13
13
  # Here we build our own container to make sure we test against our latest code
14
14
  # but YOU can just used the latest version by specifying
15
15
  # sitespeedio/sitespeed.io:VERSION
@@ -13,9 +13,9 @@ jobs:
13
13
  matrix:
14
14
  node-version: [18.x, 20.x]
15
15
  steps:
16
- - uses: actions/checkout@v3
16
+ - uses: actions/checkout@v4
17
17
  - name: Use Node.js ${{ matrix.node-version }}
18
- uses: actions/setup-node@v3
18
+ uses: actions/setup-node@v4
19
19
  with:
20
20
  node-version: ${{ matrix.node-version }}
21
21
  - name: Install dependencies and Chrome
@@ -10,9 +10,9 @@ jobs:
10
10
  build:
11
11
  runs-on: windows-latest
12
12
  steps:
13
- - uses: actions/checkout@v3
13
+ - uses: actions/checkout@v4
14
14
  - name: Use Node.js
15
- uses: actions/setup-node@v3
15
+ uses: actions/setup-node@v4
16
16
  with:
17
17
  node-version: '20.x'
18
18
  - name: Install sitespeed.io
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # CHANGELOG - sitespeed.io (we use [semantic versioning](https://semver.org))
2
2
 
3
+ ## 30.4.0 - 2023-11-27
4
+ ### Fixed
5
+ * Upgrade to Browsretime 19.1.0 with a fix for Geckodriver so that the correct ARM version is installed on Mac Arm machines.
6
+ ### Added
7
+ * The new compare plugin makes it easy to use Mann Whitney U/Wilcox for support to find performance egressions. Read all about the plugin in the [documentation](https://www.sitespeed.io/documentation/sitespeed.io/compare/).
8
+
9
+ ## 30.3.0 - 2023-11-09
10
+
11
+ ### Added
12
+ * Upgrade to Browsertime 18.0.0.
13
+ * Added support to run user journeys with WebPageReplay [#4005](https://github.com/sitespeedio/sitespeed.io/pull/4005).
14
+
15
+ ### Fixed
16
+ * Downgrade puppeteer in the +1 container for Lighthouse, thank you [bairov pavel](https://github.com/Amerousful) for PR [#123](https://github.com/sitespeedio/plugin-lighthouse/pull/123).
17
+
3
18
  ## 30.2.1 - 2023-11-03
4
19
  ### Fixed
5
20
  * The Docker+1 container got a fix for Lighthouse that didn't work in 30.2.0 (adding dev-shm when starting Chrome).
package/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM sitespeedio/webbrowsers:chrome-119.0-firefox-119.0-edge-119.0
1
+ FROM sitespeedio/webbrowsers:chrome-119.0-firefox-120.0-edge-119.0
2
2
 
3
3
  ARG TARGETPLATFORM=linux/amd64
4
4
 
@@ -44,4 +44,6 @@ RUN echo 'ALL ALL=NOPASSWD: /usr/sbin/tc, /usr/sbin/route, /usr/sbin/ip' > /etc/
44
44
 
45
45
  ENTRYPOINT ["/start.sh"]
46
46
  VOLUME /sitespeed.io
47
+ VOLUME /baseline
48
+
47
49
  WORKDIR /sitespeed.io
@@ -36,9 +36,18 @@ try {
36
36
  throw e;
37
37
  }
38
38
 
39
- async function testURLs(engine, urls) {
39
+ async function testURLs(engine, urls, isMulti) {
40
40
  try {
41
41
  await engine.start();
42
+
43
+ if(isMulti) {
44
+ const result = await engine.runMultiple(urls);
45
+ for (let errors of result[0].errors) {
46
+ if (errors.length > 0) {
47
+ process.exitCode = 1;
48
+ }
49
+ }
50
+ } else {
42
51
  for (let url of urls) {
43
52
  const result = await engine.run(url);
44
53
  for (let errors of result[0].errors) {
@@ -47,6 +56,7 @@ async function testURLs(engine, urls) {
47
56
  }
48
57
  }
49
58
  }
59
+ }
50
60
  } finally {
51
61
  engine.stop();
52
62
  }
@@ -203,11 +213,12 @@ async function runBrowsertime() {
203
213
  );
204
214
  }
205
215
  }
216
+
206
217
  const engine = new BrowsertimeEngine(btOptions);
207
- const urls = getURLs(parsed.argv._);
218
+ const urls = parsed.argv.multi ? parsed.argv._ : getURLs(parsed.argv._);
208
219
 
209
220
  try {
210
- await testURLs(engine, urls);
221
+ await testURLs(engine, urls, parsed.argv.multi);
211
222
  } catch (e) {
212
223
  console.error('Could not run ' + e);
213
224
  process.exit(1);
package/lib/cli/cli.js CHANGED
@@ -1870,6 +1870,68 @@ export async function parseCommandLine() {
1870
1870
  group: 'API'
1871
1871
  });
1872
1872
 
1873
+ parsed
1874
+ .option('compare.id', {
1875
+ type: 'string',
1876
+ describe:
1877
+ 'The id of the test. Will be used to find the baseline test, that is using the id as a part of the name.',
1878
+ group: 'compare'
1879
+ })
1880
+ .option('compare.baselinePath', {
1881
+ type: 'string',
1882
+ describe:
1883
+ 'Specifies the path to the baseline data file. This file is used as a reference for comparison against the current test data.',
1884
+ group: 'compare'
1885
+ })
1886
+ .option('compare.saveBaseline', {
1887
+ type: 'boolean',
1888
+ default: false,
1889
+ describe:
1890
+ 'Determines whether to save the current test data as the new baseline. Set to true to save the current data as baseline for future comparisons.',
1891
+ group: 'compare'
1892
+ })
1893
+ .option('compare.testType', {
1894
+ describe:
1895
+ 'Selects the statistical test type to be used for comparison. Options are mannwhitneyu for the Mann-Whitney U test and wilcoxon for the Wilcoxon signed-rank test.',
1896
+ choices: ['mannwhitneyu', ' wilcoxon'],
1897
+ default: 'mannwhitneyu',
1898
+ group: 'compare'
1899
+ })
1900
+ .option('compare.alternative', {
1901
+ choices: ['less', ' greater', 'two-sided'],
1902
+ default: 'less',
1903
+ describe:
1904
+ 'Specifies the alternative hypothesis to be tested. Options are less for one-sided test where the first group is expected to be less than the second, greater for one-sided test with the first group expected to be greater, or two-sided for a two-sided test.',
1905
+ group: 'compare'
1906
+ })
1907
+ .option('compare.wilcoxon.correction', {
1908
+ type: 'boolean',
1909
+ describe:
1910
+ 'Enables or disables the continuity correction in the Wilcoxon signed-rank test. Set to true to enable the correction.',
1911
+ default: false,
1912
+ group: 'compare'
1913
+ })
1914
+ .option('compare.wilcoxon.zeroMethod', {
1915
+ choices: ['wilcox', ' pratt', 'zsplit'],
1916
+ describe:
1917
+ 'Specifies the method for handling zero differences in the Wilcoxon test. wilcox discards all zero-difference pairs, pratt includes all, and zsplit splits them evenly among positive and negative ranks.',
1918
+ default: 'zsplit',
1919
+ group: 'compare'
1920
+ })
1921
+ .option('compare.mannwhitneyu.useContinuity', {
1922
+ type: 'boolean',
1923
+ default: false,
1924
+ describe:
1925
+ 'Determines whether to use continuity correction in the Mann-Whitney U test. Set to true to apply the correction.',
1926
+ group: 'compare'
1927
+ })
1928
+ .option('compare.mannwhitneyu.method', {
1929
+ choices: ['auto', ' exact', 'symptotic'],
1930
+ escribe:
1931
+ 'Selects the method for calculating the Mann-Whitney U test. auto automatically selects between exact and asymptotic based on sample size, exact uses the exact distribution of U, and symptotic uses a normal approximation.',
1932
+ default: 'auto',
1933
+ group: 'compare'
1934
+ });
1873
1935
  parsed
1874
1936
  .option('mobile', {
1875
1937
  describe:
@@ -0,0 +1,35 @@
1
+ import fs from 'node:fs/promises';
2
+ import { join, resolve } from 'node:path';
3
+
4
+ export async function getBaseline(id, compareOptions) {
5
+ try {
6
+ return JSON.parse(
7
+ await fs.readFile(
8
+ resolve(
9
+ join(compareOptions.baselinePath || process.cwd(), `${id}.json`)
10
+ )
11
+ )
12
+ );
13
+ } catch {
14
+ return;
15
+ }
16
+ }
17
+ /*
18
+ async function getBaselineFromInternet(url) {
19
+ try {
20
+ const response = await fetch(url);
21
+ return response.json();
22
+ } catch (error) {
23
+ log.error('Could not fetch', error);
24
+ }
25
+ }
26
+
27
+ async function getBaselineFromFile(path) {}
28
+
29
+ /*
30
+ export async function saveBaseline(json, options) {
31
+
32
+ }*/
33
+ export async function saveBaseline(json, name) {
34
+ return fs.writeFile(resolve(name), JSON.stringify(json));
35
+ }