You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,53 @@ This repository is a fork of [WPT](https://github.com/web-platform-tests/wpt), t
6
6
All test and analysis code for our paper can be found in the [_hp](./_hp/README.md) directory.
7
7
Our modified version of the wptserve HTTP server implementation can be found in the `tools/serve` and `tools/wptserve` directories. All other directories are untouched and required for `wptserve` to run, we removed the other WPT directories for clarity.
8
8
9
+
The project is made out of 6 parts:
10
+
1. Modified WPT server
11
+
- Dockerized and works on MacOS and Linux
12
+
- Optional: Configure settings: in `docker-compose.yml` and TODO, e.g., setup working certificates
13
+
- Start with `(sudo) docker compose up`, this starts a database, configures the HTTP responses, and starts our modified WPT server
14
+
- (Optional) Run tests to verify server is setup correctly: `sudo docker compose exec header-testing-server bash -c "poetry run -C _hp pytest /app/_hp"`
15
+
- The server is now serving all the tests pages and reponses for our paper. Depending on the configuration the server is now available within and outside the Docker network. E.g., by default it should bind to port 80 and 443 and `curl -I http://localhost/_hp/common/empty.html` and `curl -I -k https://localhost/_hp/common/empty.html` (our dummy certificates are not valid, thus `-k`/insecure is required) on the host should return a response from `BaseHTTP/0.6 Python/3.11.5`
16
+
2. (Optional) Analysis scripts
17
+
- Dockerized jupyter-lab and works on MacOS and Linux
18
+
- Run: `(sudo) docker compose exec header-testing-server bash -c "cd /app/_hp/hp/tools/analysis && poetry run jupyter-lab --allow-root --ip 0.0.0.0"` and access the URL printed on your local browser
19
+
- Open `analysis_ae.ipynb` and run it to analyze the browser runs; If none of the test runners were executed yet, no
20
+
- The files `analysis_may_2024.ipynb` and `analysis_december_2024.ipynb` contain the full analysis for the original browser run and the updated browser run experiments described in the paper, including the output of the analysis. Re-running them requires access to our originally collected data.
21
+
3. (Optional) Test runner for desktop linux browsers
22
+
- Dockerized and only work on Linux (issues with the MacOS Linux emulation)
23
+
- Run: `(sudo) docker compose exec header-testing-server bash -c "cd /app/_hp/hp/tools/crawler/ && poetry run python desktop_selenium.py --debug_browsers --resp_type debug --ignore_certs"` for a quick check that data can be collected
24
+
- This should take around 2-3m
25
+
- Check `_hp/hp/tools/crawler/logs/desktop-selenium/` for logs, there should be two rows with `Start chrome (128)` and two with `Finish chrome (128)` and no additional rows. The results of these tests can also be seen in the database or checked with the `analysis_ae.ipynb` script
26
+
- Reproduce the basic experiment:
27
+
- TODO (copy from below + verify, there are some issues with dockerized setup e.g. `--no-sandbox`?)
28
+
- Run `(sudo) docker compose exec header-testing-server bash -c "cd /app/_hp/hp/tools/crawler/ && for i in {1..5}; do poetry run python desktop_selenium.py --num_browsers 50 --resp_type basic --ignore_certs; done"`
29
+
- Reproduce the parsing experiment:
30
+
- TODO
31
+
- Reproduce the updated browser experiment and other notes:
32
+
- TODO
33
+
- The test runner can be also used outside of the docker container for efficiency:
34
+
- Requires `python 3.11.5`, `poetry`, various browser dependencies and if run on a server without a screen `Xvfb` installed. Check `setup.bash` on how to install them (verified to work on Ubuntu 22.04)
35
+
- Then install all dependencies: `cd _hp && poetry install`
36
+
- Lastly, the modified WPT server needs to be reachable. One option is to modify `/etc/hosts/` to point the required hosts to the docker container (see `_hp/host-config.txt`)
37
+
- Then `poetry run python desktop_selenium.py --help` can be used to see all settings of the test runner and then executed as wanted
38
+
4. (Optional) Test runner for macOS browser
39
+
- Requires access to a macOS device with a display
40
+
- The Safari version is bound to the operating system, for an exact reproduction of our results, macOS devices in the correct version are required. To test the test runner on macOS, the used version can be updated in `desktop_selenium.py`
41
+
- Requirements: `python=3.11.5`, `poetry` (see `setup.bash`) and access to the modified WPT server
42
+
- Install `poetry install`
43
+
- Run: TODO, copy from below (some manual steps in Safari are required) (Note: the device is not fully usable during the testing)
44
+
5. (Optional) Test runner for iPadOS browser
45
+
- Requires access to iPadOS devices (in the correct version)
46
+
- Only works in a setup where the server is setup to be reachable from the iPadOS (e.g., via public internet) and the server needs valid certificates
47
+
- Run: TODO, copy from below
48
+
6. (Optional) Test runner for emulated Android browsers
49
+
- Requires access to a linux machine
50
+
- TODO: copy from below, install and run
51
+
52
+
53
+
----
54
+
Old review below:
55
+
9
56
## Setup and Start the Header Testing Server
10
57
- Create a fresh Ubuntu22 container/VM: `lxc launch ubuntu:22.04 <name>` and connect to it `lxc exec <name> bash` (Other environments might also work but are not tested)
0 commit comments