Skip to content

Commit

Permalink
Merge pull request #828 from Webperf-se/sitespeed-browsertime-postjs-…
Browse files Browse the repository at this point in the history
…validation

Validate functionaliy in chrome-cookies.js and chrome-versions.js
  • Loading branch information
7h3Rabbit authored Dec 29, 2024
2 parents 8f2f312 + 6ae2c82 commit e86ae4b
Show file tree
Hide file tree
Showing 16 changed files with 153 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/regression-test-a11y-statement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ on:
- '**regression-test-software.yml'
- '**regression-test-standard-files.yml'
- '**regression-test-tracking.yml'
- '**regression-test-translations.yml'
- '**regression-test-webbkoll.yml'
- '**regression-test-ylt.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/regression-test-css.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ on:
- '**regression-test-software.yml'
- '**regression-test-standard-files.yml'
- '**regression-test-tracking.yml'
- '**regression-test-translations.yml'
- '**regression-test-webbkoll.yml'
- '**regression-test-ylt.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/regression-test-email.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ on:
- '**regression-test-software.yml'
- '**regression-test-standard-files.yml'
- '**regression-test-tracking.yml'
- '**regression-test-translations.yml'
- '**regression-test-webbkoll.yml'
- '**regression-test-ylt.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/regression-test-google-lighthouse-based.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ on:
- '**regression-test-software.yml'
- '**regression-test-standard-files.yml'
- '**regression-test-tracking.yml'
- '**regression-test-translations.yml'
- '**regression-test-webbkoll.yml'
- '**regression-test-ylt.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/regression-test-html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ on:
- '**regression-test-software.yml'
- '**regression-test-standard-files.yml'
- '**regression-test-tracking.yml'
- '**regression-test-translations.yml'
- '**regression-test-webbkoll.yml'
- '**regression-test-ylt.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/regression-test-http.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ on:
- '**regression-test-software.yml'
- '**regression-test-standard-files.yml'
- '**regression-test-tracking.yml'
- '**regression-test-translations.yml'
- '**regression-test-webbkoll.yml'
- '**regression-test-ylt.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/regression-test-lint-css.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ on:
- '**regression-test-software.yml'
- '**regression-test-standard-files.yml'
- '**regression-test-tracking.yml'
- '**regression-test-translations.yml'
- '**regression-test-webbkoll.yml'
- '**regression-test-ylt.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/regression-test-pa11y.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ on:
- '**regression-test-software.yml'
- '**regression-test-standard-files.yml'
- '**regression-test-tracking.yml'
- '**regression-test-translations.yml'
- '**regression-test-webbkoll.yml'
- '**regression-test-ylt.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
74 changes: 68 additions & 6 deletions .github/workflows/regression-test-sitespeed-browsertime-har.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ jobs:
- name: Testing sitespeed.io:s browsertime.har output using ${{ matrix.browser }}
if: always()
run: |
echo "TEST A"
sitespeedversion=$(python .github/workflows/verify_result.py --docker-sitespeed-version)
echo "TEST B: $sitespeedversion"
command="docker run --rm -v $(pwd):/sitespeed.io $sitespeedversion -b ${{ matrix.browser }} -n 1 --chrome.includeResponseBodies all --firefox.includeResponseBodies all https://webperf.se"
echo "TEST C: $command"
command="docker run -v $(pwd):/sitespeed.io $sitespeedversion -b ${{ matrix.browser }} -n 1 --chrome.includeResponseBodies all --firefox.includeResponseBodies all https://webperf.se"
echo "A: $command"
testresult=$($command)
echo "TEST D: $testresult"
echo "B: $testresult"
path=$(echo "$testresult" | grep -o "/sitespeed.io/.*")
echo "C: $path"
if [ -n "$path" ]; then
har_file=$(find $(pwd) -name "browsertime.har")
har_file=$(ls -t $(find $(pwd) -name "browsertime.har") | head -1)
echo "D: $har_file"
if [ -f "$har_file" ]; then
echo "Found browsertime.har at $har_file"
python .github/workflows/verify_browsertime_har.py --browsertime $har_file
Expand All @@ -50,3 +50,65 @@ jobs:
echo "Error: No path found starting with /sitespeed.io/"
exit 1
fi
- name: Testing sitespeed.io:s browsertime.har with chrome-cookies.cjs output using ${{ matrix.browser }}
if: always()
run: |
sitespeedversion=$(python .github/workflows/verify_result.py --docker-sitespeed-version)
command="docker run -v $(pwd):/sitespeed.io $sitespeedversion -b ${{ matrix.browser }} -n 1 --postScript chrome-cookies.cjs https://polisen.se"
echo "A: $command"
testresult=$($command)
echo "B: $testresult"
path=$(echo "$testresult" | grep -o "/sitespeed.io/.*")
echo "C: $path"
if [ -n "$path" ]; then
har_file=$(ls -t $(find $(pwd) -name "browsertime.har") | head -1)
echo "D: $har_file"
if [ -f "$har_file" ]; then
echo "Found browsertime.har at $har_file"
cookies=$(echo "$testresult" | grep -o "COOKIES:START")
echo "E: $cookies"
if [ -n "$cookies" ]; then
echo "Cookies found in $har_file"
else
echo "Cookies cookie not found in $har_file"
exit 1
fi
else
echo "Error: browsertime.har not found in $path"
exit 1
fi
else
echo "Error: No path found starting with /sitespeed.io/"
exit 1
fi
- name: Testing sitespeed.io:s browsertime.har with chrome-versions.cjs output using ${{ matrix.browser }}
if: always()
run: |
sitespeedversion=$(python .github/workflows/verify_result.py --docker-sitespeed-version)
command="docker run -v $(pwd):/sitespeed.io $sitespeedversion -b ${{ matrix.browser }} -n 1 --postScript chrome-versions.cjs https://webperf.se"
echo "A: $command"
testresult=$($command)
echo "B: $testresult"
path=$(echo "$testresult" | grep -o "/sitespeed.io/.*")
echo "C: $path"
if [ -n "$path" ]; then
har_file=$(ls -t $(find $(pwd) -name "browsertime.har") | head -1)
echo "D: $har_file"
if [ -f "$har_file" ]; then
echo "Found browsertime.har at $har_file"
versions=$(echo "$testresult" | grep -o "VERSIONS:START")
echo "E: $versions"
if [ -n "$versions" ]; then
echo "Versions found in $har_file"
else
echo "Versions not found in $har_file"
exit 1
fi
else
echo "Error: browsertime.har not found in $path"
exit 1
fi
else
echo "Error: No path found starting with /sitespeed.io/"
exit 1
fi
3 changes: 3 additions & 0 deletions .github/workflows/regression-test-sitespeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ on:
- '**regression-test-software.yml'
- '**regression-test-standard-files.yml'
- '**regression-test-tracking.yml'
- '**regression-test-translations.yml'
- '**regression-test-webbkoll.yml'
- '**regression-test-ylt.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/regression-test-software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ on:
- '**regression-test-sitespeed.yml'
- '**regression-test-standard-files.yml'
- '**regression-test-tracking.yml'
- '**regression-test-translations.yml'
- '**regression-test-webbkoll.yml'
- '**regression-test-ylt.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/regression-test-standard-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ on:
- '**regression-test-sitespeed.yml'
- '**regression-test-software.yml'
- '**regression-test-tracking.yml'
- '**regression-test-translations.yml'
- '**regression-test-webbkoll.yml'
- '**regression-test-ylt.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/regression-test-tracking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ on:
- '**regression-test-sitespeed.yml'
- '**regression-test-software.yml'
- '**regression-test-standard-files.yml'
- '**regression-test-translations.yml'
- '**regression-test-webbkoll.yml'
- '**regression-test-ylt.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/regression-test-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,24 @@ on:
- '**update_software_helper.py'
- '**software-rules.json'
- 'Dockerfile'
- '**regression-test-404.yml'
- '**regression-test-a11y-statement.yml'
- '**regression-test-css.yml'
- '**regression-test-docker-image.yml'
- '**regression-test-email.yml'
- '**regression-test-google-lighthouse-based.yml'
- '**regression-test-html.yml'
- '**regression-test-http.yml'
- '**regression-test-lint-css.yml'
- '**regression-test-pa11y.yml'
- '**regression-test-sitespeed-browsertime-har.yml'
- '**regression-test-sitespeed.yml'
- '**regression-test-software.yml'
- '**regression-test-standard-files.yml'
- '**regression-test-tracking.yml'
- '**regression-test-translations.yml'
- '**regression-test-webbkoll.yml'
- '**regression-test-ylt.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/regression-test-webbkoll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,23 @@ on:
- '**update_software_helper.py'
- '**software-rules.json'
- 'Dockerfile'
- '**regression-test-404.yml'
- '**regression-test-a11y-statement.yml'
- '**regression-test-css.yml'
- '**regression-test-docker-image.yml'
- '**regression-test-email.yml'
- '**regression-test-google-lighthouse-based.yml'
- '**regression-test-html.yml'
- '**regression-test-http.yml'
- '**regression-test-lint-css.yml'
- '**regression-test-pa11y.yml'
- '**regression-test-sitespeed-browsertime-har.yml'
- '**regression-test-sitespeed.yml'
- '**regression-test-software.yml'
- '**regression-test-standard-files.yml'
- '**regression-test-tracking.yml'
- '**regression-test-translations.yml'
- '**regression-test-ylt.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/regression-test-ylt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,23 @@ on:
- '**update_software_helper.py'
- '**software-rules.json'
- 'Dockerfile'
- '**regression-test-404.yml'
- '**regression-test-a11y-statement.yml'
- '**regression-test-css.yml'
- '**regression-test-docker-image.yml'
- '**regression-test-email.yml'
- '**regression-test-google-lighthouse-based.yml'
- '**regression-test-html.yml'
- '**regression-test-http.yml'
- '**regression-test-lint-css.yml'
- '**regression-test-pa11y.yml'
- '**regression-test-sitespeed-browsertime-har.yml'
- '**regression-test-sitespeed.yml'
- '**regression-test-software.yml'
- '**regression-test-standard-files.yml'
- '**regression-test-tracking.yml'
- '**regression-test-translations.yml'
- '**regression-test-webbkoll.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down

0 comments on commit e86ae4b

Please sign in to comment.