From 5fab3d88233446c42c52d39458dc4727b06f0720 Mon Sep 17 00:00:00 2001 From: Felix Boerner Date: Tue, 9 Jan 2024 13:32:16 +0100 Subject: test: add mobile tests --- .github/workflows/peformance.yml | 40 +++++++++++++++++----- tests/exampleSiteWithImage/budget.desktop.json | 18 ++++++++++ tests/exampleSiteWithImage/budget.json | 18 ---------- tests/exampleSiteWithImage/budget.mobile.json | 18 ++++++++++ .../docker-compose.desktop.yml | 20 +++++++++++ .../exampleSiteWithImage/docker-compose.mobile.yml | 20 +++++++++++ tests/exampleSiteWithImage/docker-compose.yml | 20 ----------- tests/exampleSiteWithImage/urls.txt | 2 ++ tests/exampleSiteWithVideo/budget.desktop.json | 18 ++++++++++ tests/exampleSiteWithVideo/budget.json | 18 ---------- tests/exampleSiteWithVideo/budget.mobile.json | 18 ++++++++++ .../docker-compose.desktop.yml | 20 +++++++++++ .../exampleSiteWithVideo/docker-compose.mobile.yml | 20 +++++++++++ tests/exampleSiteWithVideo/docker-compose.yml | 20 ----------- tests/exampleSiteWithVideo/urls.txt | 2 ++ 15 files changed, 188 insertions(+), 84 deletions(-) create mode 100644 tests/exampleSiteWithImage/budget.desktop.json delete mode 100644 tests/exampleSiteWithImage/budget.json create mode 100644 tests/exampleSiteWithImage/budget.mobile.json create mode 100644 tests/exampleSiteWithImage/docker-compose.desktop.yml create mode 100644 tests/exampleSiteWithImage/docker-compose.mobile.yml delete mode 100644 tests/exampleSiteWithImage/docker-compose.yml create mode 100644 tests/exampleSiteWithImage/urls.txt create mode 100644 tests/exampleSiteWithVideo/budget.desktop.json delete mode 100644 tests/exampleSiteWithVideo/budget.json create mode 100644 tests/exampleSiteWithVideo/budget.mobile.json create mode 100644 tests/exampleSiteWithVideo/docker-compose.desktop.yml create mode 100644 tests/exampleSiteWithVideo/docker-compose.mobile.yml delete mode 100644 tests/exampleSiteWithVideo/docker-compose.yml create mode 100644 tests/exampleSiteWithVideo/urls.txt diff --git a/.github/workflows/peformance.yml b/.github/workflows/peformance.yml index 6fa8d0c..780b2f2 100644 --- a/.github/workflows/peformance.yml +++ b/.github/workflows/peformance.yml @@ -44,22 +44,46 @@ jobs: - name: Check out repository uses: actions/checkout@v4 - - name: Run sitespeed.io for example site with image + - name: Run sitespeed.io for example site with image in desktop mode run: | - docker compose --file tests/exampleSiteWithImage/docker-compose.yml up --exit-code-from sitespeed + rm --recursive --force tests/exampleSiteWithImage/sitespeed-result + docker compose --file tests/exampleSiteWithImage/docker-compose.desktop.yml up --exit-code-from sitespeed - - name: Upload sitespeed.io result for example site with image + - name: Upload sitespeed.io result for example site with image in desktop mode uses: actions/upload-artifact@v4 with: - name: sitespeed.io-example-site-with-image + name: sitespeed.io-example-site-with-image-desktop path: tests/exampleSiteWithImage/sitespeed-result - - name: Run sitespeed.io for example site with video + - name: Run sitespeed.io for example site with image in mobile mode run: | - docker compose --file tests/exampleSiteWithVideo/docker-compose.yml up --exit-code-from sitespeed + rm --recursive --force tests/exampleSiteWithImage/sitespeed-result + docker compose --file tests/exampleSiteWithImage/docker-compose.mobile.yml up --exit-code-from sitespeed - - name: Upload sitespeed.io result for example site with video + - name: Upload sitespeed.io result for example site with image in mobile mode uses: actions/upload-artifact@v4 with: - name: sitespeed.io-example-site-with-video + name: sitespeed.io-example-site-with-image-mobile + path: tests/exampleSiteWithImage/sitespeed-result + + - name: Run sitespeed.io for example site with video in desktop mode + run: | + rm --recursive --force tests/exampleSiteWithVideo/sitespeed-result + docker compose --file tests/exampleSiteWithVideo/docker-compose.desktop.yml up --exit-code-from sitespeed + + - name: Upload sitespeed.io result for example site with video in desktop mode + uses: actions/upload-artifact@v4 + with: + name: sitespeed.io-example-site-with-video-desktop + path: tests/exampleSiteWithVideo/sitespeed-result + + - name: Run sitespeed.io for example site with video in mobile mode + run: | + rm --recursive --force tests/exampleSiteWithVideo/sitespeed-result + docker compose --file tests/exampleSiteWithVideo/docker-compose.mobile.yml up --exit-code-from sitespeed + + - name: Upload sitespeed.io result for example site with video in mobile mode + uses: actions/upload-artifact@v4 + with: + name: sitespeed.io-example-site-with-video-mobile path: tests/exampleSiteWithVideo/sitespeed-result diff --git a/tests/exampleSiteWithImage/budget.desktop.json b/tests/exampleSiteWithImage/budget.desktop.json new file mode 100644 index 0000000..2917d78 --- /dev/null +++ b/tests/exampleSiteWithImage/budget.desktop.json @@ -0,0 +1,18 @@ +{ + "budget": { + "requests": { + "total": 9 + }, + "transferSize": { + "total": 321024 + }, + "thirdParty": { + "requests": 4 + }, + "score": { + "bestpractice": 93, + "privacy": 72, + "performance": 86 + } + } +} diff --git a/tests/exampleSiteWithImage/budget.json b/tests/exampleSiteWithImage/budget.json deleted file mode 100644 index 2917d78..0000000 --- a/tests/exampleSiteWithImage/budget.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "budget": { - "requests": { - "total": 9 - }, - "transferSize": { - "total": 321024 - }, - "thirdParty": { - "requests": 4 - }, - "score": { - "bestpractice": 93, - "privacy": 72, - "performance": 86 - } - } -} diff --git a/tests/exampleSiteWithImage/budget.mobile.json b/tests/exampleSiteWithImage/budget.mobile.json new file mode 100644 index 0000000..2917d78 --- /dev/null +++ b/tests/exampleSiteWithImage/budget.mobile.json @@ -0,0 +1,18 @@ +{ + "budget": { + "requests": { + "total": 9 + }, + "transferSize": { + "total": 321024 + }, + "thirdParty": { + "requests": 4 + }, + "score": { + "bestpractice": 93, + "privacy": 72, + "performance": 86 + } + } +} diff --git a/tests/exampleSiteWithImage/docker-compose.desktop.yml b/tests/exampleSiteWithImage/docker-compose.desktop.yml new file mode 100644 index 0000000..901df43 --- /dev/null +++ b/tests/exampleSiteWithImage/docker-compose.desktop.yml @@ -0,0 +1,20 @@ +services: + hugo: + image: hugomods/hugo:latest + volumes: + - type: bind + source: ../../../ + target: /src + command: ["hugo", "server", "--logLevel=info", "--bind=0.0.0.0", "--baseURL=http://hugo", "--disableLiveReload", "--source=/src/hugo-split-theme/tests/exampleSiteWithImage", "--themesDir=/src"] + ports: + - "1313:1313" + + sitespeed: + image: sitespeedio/sitespeed.io:latest + volumes: + - type: bind + source: . + target: /sitespeed.io + depends_on: + - hugo + command: ["--budget.configPath=budget.desktop.json", "urls.txt"] diff --git a/tests/exampleSiteWithImage/docker-compose.mobile.yml b/tests/exampleSiteWithImage/docker-compose.mobile.yml new file mode 100644 index 0000000..c82ac06 --- /dev/null +++ b/tests/exampleSiteWithImage/docker-compose.mobile.yml @@ -0,0 +1,20 @@ +services: + hugo: + image: hugomods/hugo:latest + volumes: + - type: bind + source: ../../../ + target: /src + command: ["hugo", "server", "--logLevel=info", "--bind=0.0.0.0", "--baseURL=http://hugo", "--disableLiveReload", "--source=/src/hugo-split-theme/tests/exampleSiteWithImage", "--themesDir=/src"] + ports: + - "1313:1313" + + sitespeed: + image: sitespeedio/sitespeed.io:latest + volumes: + - type: bind + source: . + target: /sitespeed.io + depends_on: + - hugo + command: ["--budget.configPath=budget.mobile.json", "--mobile", "urls.txt"] diff --git a/tests/exampleSiteWithImage/docker-compose.yml b/tests/exampleSiteWithImage/docker-compose.yml deleted file mode 100644 index 5f544ba..0000000 --- a/tests/exampleSiteWithImage/docker-compose.yml +++ /dev/null @@ -1,20 +0,0 @@ -services: - hugo: - image: hugomods/hugo:latest - volumes: - - type: bind - source: ../../../ - target: /src - command: ["hugo", "server", "--logLevel=info", "--bind=0.0.0.0", "--baseURL=http://hugo", "--disableLiveReload", "--source=/src/hugo-split-theme/tests/exampleSiteWithImage", "--themesDir=/src"] - ports: - - "1313:1313" - - sitespeed: - image: sitespeedio/sitespeed.io:latest - volumes: - - type: bind - source: . - target: /sitespeed.io - depends_on: - - hugo - command: ["http://hugo:1313/index.html", "--budget.configPath=budget.json"] diff --git a/tests/exampleSiteWithImage/urls.txt b/tests/exampleSiteWithImage/urls.txt new file mode 100644 index 0000000..65e6f69 --- /dev/null +++ b/tests/exampleSiteWithImage/urls.txt @@ -0,0 +1,2 @@ +http://hugo:1313/index.html +http://hugo:1313/ipsum-in.html diff --git a/tests/exampleSiteWithVideo/budget.desktop.json b/tests/exampleSiteWithVideo/budget.desktop.json new file mode 100644 index 0000000..2f2dc53 --- /dev/null +++ b/tests/exampleSiteWithVideo/budget.desktop.json @@ -0,0 +1,18 @@ +{ + "budget": { + "requests": { + "total": 9 + }, + "transferSize": { + "total": 2048000 + }, + "thirdParty": { + "requests": 4 + }, + "score": { + "bestpractice": 93, + "privacy": 72, + "performance": 84 + } + } +} diff --git a/tests/exampleSiteWithVideo/budget.json b/tests/exampleSiteWithVideo/budget.json deleted file mode 100644 index 2f2dc53..0000000 --- a/tests/exampleSiteWithVideo/budget.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "budget": { - "requests": { - "total": 9 - }, - "transferSize": { - "total": 2048000 - }, - "thirdParty": { - "requests": 4 - }, - "score": { - "bestpractice": 93, - "privacy": 72, - "performance": 84 - } - } -} diff --git a/tests/exampleSiteWithVideo/budget.mobile.json b/tests/exampleSiteWithVideo/budget.mobile.json new file mode 100644 index 0000000..6c92933 --- /dev/null +++ b/tests/exampleSiteWithVideo/budget.mobile.json @@ -0,0 +1,18 @@ +{ + "budget": { + "requests": { + "total": 9 + }, + "transferSize": { + "total": 2048000 + }, + "thirdParty": { + "requests": 4 + }, + "score": { + "bestpractice": 93, + "privacy": 72, + "performance": 82 + } + } +} diff --git a/tests/exampleSiteWithVideo/docker-compose.desktop.yml b/tests/exampleSiteWithVideo/docker-compose.desktop.yml new file mode 100644 index 0000000..e4eedad --- /dev/null +++ b/tests/exampleSiteWithVideo/docker-compose.desktop.yml @@ -0,0 +1,20 @@ +services: + hugo: + image: hugomods/hugo:latest + volumes: + - type: bind + source: ../../../ + target: /src + command: ["hugo", "server", "--logLevel=info", "--bind=0.0.0.0", "--baseURL=http://hugo", "--disableLiveReload", "--source=/src/hugo-split-theme/tests/exampleSiteWithVideo", "--themesDir=/src"] + ports: + - "1313:1313" + + sitespeed: + image: sitespeedio/sitespeed.io:latest + volumes: + - type: bind + source: . + target: /sitespeed.io + depends_on: + - hugo + command: ["--budget.configPath=budget.desktop.json", "urls.txt"] diff --git a/tests/exampleSiteWithVideo/docker-compose.mobile.yml b/tests/exampleSiteWithVideo/docker-compose.mobile.yml new file mode 100644 index 0000000..1af9453 --- /dev/null +++ b/tests/exampleSiteWithVideo/docker-compose.mobile.yml @@ -0,0 +1,20 @@ +services: + hugo: + image: hugomods/hugo:latest + volumes: + - type: bind + source: ../../../ + target: /src + command: ["hugo", "server", "--logLevel=info", "--bind=0.0.0.0", "--baseURL=http://hugo", "--disableLiveReload", "--source=/src/hugo-split-theme/tests/exampleSiteWithVideo", "--themesDir=/src"] + ports: + - "1313:1313" + + sitespeed: + image: sitespeedio/sitespeed.io:latest + volumes: + - type: bind + source: . + target: /sitespeed.io + depends_on: + - hugo + command: ["--budget.configPath=budget.mobile.json", "--mobile", "urls.txt"] diff --git a/tests/exampleSiteWithVideo/docker-compose.yml b/tests/exampleSiteWithVideo/docker-compose.yml deleted file mode 100644 index 5c900cd..0000000 --- a/tests/exampleSiteWithVideo/docker-compose.yml +++ /dev/null @@ -1,20 +0,0 @@ -services: - hugo: - image: hugomods/hugo:latest - volumes: - - type: bind - source: ../../../ - target: /src - command: ["hugo", "server", "--logLevel=info", "--bind=0.0.0.0", "--baseURL=http://hugo", "--disableLiveReload", "--source=/src/hugo-split-theme/tests/exampleSiteWithVideo", "--themesDir=/src"] - ports: - - "1313:1313" - - sitespeed: - image: sitespeedio/sitespeed.io:latest - volumes: - - type: bind - source: . - target: /sitespeed.io - depends_on: - - hugo - command: ["http://hugo:1313/index.html", "--budget.configPath=budget.json"] diff --git a/tests/exampleSiteWithVideo/urls.txt b/tests/exampleSiteWithVideo/urls.txt new file mode 100644 index 0000000..65e6f69 --- /dev/null +++ b/tests/exampleSiteWithVideo/urls.txt @@ -0,0 +1,2 @@ +http://hugo:1313/index.html +http://hugo:1313/ipsum-in.html -- cgit v1.2.3