Skip to content

Commit e12388d

Browse files
authored
Merge pull request Webperf-se#279 from Webperf-se/issue-244
Issue 281
2 parents da31824 + bca40dd commit e12388d

21 files changed

+3428
-688
lines changed

.github/workflows/regression-test-http.yml

+20-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ubuntu-latest, windows-latest]
17-
config: ['review_show_improvements_only=True']
17+
config: ['review_show_improvements_only=True,sitespeed_use_docker=False,csp_only=False', 'review_show_improvements_only=True,sitespeed_use_docker=False,csp_only=True']
1818
version: [21]
19+
include:
20+
- os: ubuntu-latest
21+
config: 'review_show_improvements_only=True,sitespeed_use_docker=True'
22+
version: 21
1923
steps:
2024
- name: Check out repository code
2125
uses: actions/checkout@v4
@@ -26,6 +30,21 @@ jobs:
2630
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
2731
- name: Setup dependencies using pip
2832
run: pip install -r requirements.txt
33+
- name: Setup Node.js (v4 version 20.x)
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: '20.x'
37+
- if: ${{ matrix.os == 'ubuntu-latest' }}
38+
shell: bash
39+
name: Setup Google Chrome browser (ONLY used for Sitespeed)
40+
run: |
41+
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
42+
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
43+
sudo apt-get update
44+
sudo apt-get --only-upgrade install google-chrome-stable
45+
google-chrome --version
46+
- name: Setup Sitespeed.io npm package (ONLY used for Sitespeed)
47+
run: npm install sitespeed.io
2948
- if: ${{ matrix.os == 'ubuntu-latest' }}
3049
name: Setup config (using SAMPLE-config.py as config.py) - LINUX
3150
run: python .github/workflows/verify_result.py -c ${{ matrix.config }}

SAMPLE-config.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
# Tells sitespeed if we should use it as a docker image or a npm package
3434
sitespeed_use_docker = True
3535

36+
# Tells sitespeed max timeout for website calls
37+
sitespeed_timeout = 300
38+
3639
# how many iterations of Sitespeed.io requests would you like? Has to be at least 2 not to fail
3740
sitespeed_iterations = 2
3841

@@ -51,12 +54,18 @@
5154
# GITHUB API Token, used for calls to github API (to remove call limit)
5255
github_api_key = None
5356

57+
# Tell tests to use detailed report (when available) for review and rating
58+
use_detailed_report = False
59+
60+
# Tells HTTP test to ignore everything except the CSP part (great if you run it against sitemap to get CSP recommendation)
61+
csp_only = False
62+
63+
# Tells webperf_core to use following DNS Server for dns lookups
64+
dns_server = '8.8.8.8'
65+
5466
# Tell software test to use stealth mode or not, default is 'True'
5567
software_use_stealth = True
5668

57-
# Tell software test to use detailed report for review and rating
58-
software_use_detailed_report = False
59-
6069
# Tell software test the path to where you have repo of: https://github.com/github/advisory-database
6170
# Used to find CVE:s for npm packages
6271
software_github_adadvisory_database_path = None

docs/tests/http.md

+33-7
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ Add small description of what this test is.
1010

1111
Checks if HTTP requests are redirected to HTTPS.
1212
A common misstake is to forget to force this redirect for root domain if www. subdomain is used.
13+
Also checks for HSTS support.
1314

14-
### TLS and SSL support
15+
### TLS support
1516

1617
Checks for Secure encryption support
1718
* Checks for TLS 1.3 support
@@ -20,22 +21,24 @@ Checks for Secure encryption support
2021
Checks for Insecure encryption support
2122
* Checks for TLS 1.1 support
2223
* Checks for TLS 1.0 support
23-
* Checks for SSL 3.0 support (Require host modification)
24-
* Checks for SSL 2.0 support (Require host modification)
2524
* Checks if certificate used match website domain
2625

2726
### HTTP protocol support
2827

2928
* Checks for HTTP/1.1 support
3029
* Checks for HTTP/2 support
31-
* Checks for HTTP/3 support ( Tested using https://http3check.net/ )
32-
* Checks for Quick support ( Tested using https://http3check.net/ )
30+
* Checks for HTTP/3 support
3331

3432
### IPv6 and IPv4 support
3533

3634
* Checks for IPv4 support
3735
* Checks for IPv6 support
3836

37+
### Content Security Policy (CSP) support
38+
39+
* Checks for CSP support
40+
* Gives CSP recommendation if it could improve 0.75 or more in rating
41+
3942
## How are rating being calculated?
4043

4144
This section has not been written yet.
@@ -60,10 +63,33 @@ Read more on the [general page for github actions](../getting-started-github-act
6063
### Setup Locally
6164

6265
* Follow [general local setup steps for this repository](../getting-started-local.md)
63-
* Checking for HTTP/3 and Quick support require access to and from https://http3check.net/ to the url you want to test.
66+
* It is highly recommended to set `cache_when_possible` to `True` and to set `cache_time_delta` to
67+
* It is highly recommended to set `cache_time_delta` to at least 12 hours (Fail to do so may result in banning of service like github).
68+
69+
#### Using NPM package
70+
71+
* Download and install Node.js (v1 version 14.x)
72+
* Download and install Google Chrome browser
73+
* Download and install Mozilla Firefox browser
74+
* Install SiteSpeed NPM package ( `npm install sitespeed.io` )
75+
* Set `sitespeed_use_docker = False` in your `config.py`
76+
77+
##### Windows Specific
78+
79+
* Allow node to connect through Windows firewall
80+
81+
#### Using Docker image
6482

83+
* Make sure Docker command is globally accessible on your system.
84+
* Set `sitespeed_use_docker = True` in your `config.py`
6585

6686
## FAQ
6787

68-
No frequently asked questions yet :)
88+
### How to get CSP recommendation for website
89+
Did you know you can get a CSP recommendation for all/part of your website?
90+
Do the following and webperf_core will give a CSP recommendation for more than 1 page.
91+
* Set `csp_only = True` in your `config.py`
92+
* Point webperf_core to your sitemap or your own list pages you want to test.
6993

94+
Example, below will take first 25 items from sitemap:
95+
`python default.py -r -t 21 --input-take=25 -i https://nimbleinitiatives.com/sitemap.xml`

docs/tests/software.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ TODO: Add links to blogs and articles showing how to remove info regarding what
133133
* We recommend you to make use `software_use_stealth` is set to `True`, change this to `False` at your own risk.
134134
* It is highly recommended to set `cache_when_possible` to `True` and to set `cache_time_delta` to
135135
* It is highly recommended to set `cache_time_delta` to at least 12 hours (Fail to do so may result in banning of service like github).
136-
* If you want to get more detailed information, please set `software_use_detailed_report` to `True`.
136+
* If you want to get more detailed information, please set `use_detailed_report` to `True`.
137137
* Depending on your preference, follow below NPM package or Docker image steps below.
138138

139139
#### Using NPM package
2.45 KB
Binary file not shown.

0 commit comments

Comments
 (0)