diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index a3d4e5a1..82ddac36 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.13"] + python-version: ["3.10", "3.13"] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -23,4 +23,4 @@ jobs: pip install pylint - name: Analysing the code with pylint run: | - pylint $(git ls-files '*.py') --generated-members json,ssl,datetime --disable C0114 + pylint $(git ls-files '*.py') --generated-members json,ssl,datetime --disable C0114 --errors-only diff --git a/.github/workflows/regression-test-docker-image.yml b/.github/workflows/regression-test-docker-image.yml index 7e115fce..5cf6db67 100644 --- a/.github/workflows/regression-test-docker-image.yml +++ b/.github/workflows/regression-test-docker-image.yml @@ -35,11 +35,12 @@ jobs: run: | version=$(docker run ${{ env.TEST_TAG }} python --version) echo "Python version: $version" - if [[ "$version" != "Python 3.13"* ]]; then - echo "Error: Default python version is not 3.13 based, was we unable to change default version?" + if [[ "$version" != "Python 3.10"* ]] && [[ "$version" != "Python 3.11"* ]] && [[ "$version" != "Python 3.12"* ]] && [[ "$version" != "Python 3.13"* ]]; then + echo "Error: Default python version is not one of the allowed versions (3.10, 3.11, 3.12, 3.13)" exit 1 fi - name: Check if webperf_core help command works + if: always() run: | help=$(docker run ${{ env.TEST_TAG }} python default.py -h) echo "$help" @@ -48,6 +49,7 @@ jobs: exit 1 fi - name: Check if dependency tool works + if: always() run: | help=$(docker run ${{ env.TEST_TAG }} python default.py --dependency) echo "$help" diff --git a/.github/workflows/regression-test-google-lighthouse-based.yml b/.github/workflows/regression-test-google-lighthouse-based.yml index 4e806b8c..ba110d0d 100644 --- a/.github/workflows/regression-test-google-lighthouse-based.yml +++ b/.github/workflows/regression-test-google-lighthouse-based.yml @@ -66,8 +66,8 @@ jobs: - if: ${{ matrix.os == 'ubuntu-latest' && matrix.version == 1 }} name: RUNNING TEST - LINUX run: | - node node_modules/sitespeed.io/bin/sitespeed.js -b chrome --xvfb --plugins.remove screenshot --plugins.remove html --plugins.remove metrics --browsertime.screenshot false --screenshot false --screenshotLCP false --browsertime.screenshotLCP false --chrome.cdp.performance false --browsertime.chrome.timeline false --videoParams.createFilmstrip false --visualMetrics false --visualMetricsPerceptual false --visualMetricsContentful false --browsertime.headless true --browsertime.chrome.includeResponseBodies all --utc true --browsertime.chrome.args ignore-certificate-errors -n 1 --plugins.add ../../../@sitespeed.io/plugin-lighthouse/index.js --plugins.add ../../../webperf-sitespeedio-plugin/index.js --sustainable.enable=true https://webperf.se?webperf-core-test-${{ matrix.version }} + node node_modules/sitespeed.io/bin/sitespeed.js -b chrome --xvfb --plugins.remove screenshot --plugins.remove html --plugins.remove metrics --browsertime.screenshot false --screenshot false --screenshotLCP false --browsertime.screenshotLCP false --chrome.cdp.performance false --browsertime.chrome.timeline false --videoParams.createFilmstrip false --visualMetrics false --visualMetricsPerceptual false --visualMetricsContentful false --browsertime.headless true --browsertime.chrome.includeResponseBodies all --utc true --browsertime.chrome.args ignore-certificate-errors -n 1 --plugins.add ../../../@sitespeed.io/plugin-lighthouse/index.js --plugins.add ../../../webperf-sitespeedio-plugin/index.js https://webperf.se?webperf-core-test-${{ matrix.version }} - if: ${{ matrix.os == 'windows-latest' && matrix.version == 1 }} name: RUNNING TEST - WINDOWS run: | - node node_modules\sitespeed.io\bin\sitespeed.js -b chrome --plugins.remove screenshot --plugins.remove html --plugins.remove metrics --browsertime.screenshot false --screenshot false --screenshotLCP false --browsertime.screenshotLCP false --chrome.cdp.performance false --browsertime.chrome.timeline false --videoParams.createFilmstrip false --visualMetrics false --visualMetricsPerceptual false --visualMetricsContentful false --browsertime.headless true --browsertime.chrome.includeResponseBodies all --utc true --browsertime.chrome.args ignore-certificate-errors -n 1 --plugins.add ../../../@sitespeed.io/plugin-lighthouse/index.js --plugins.add ../../../webperf-sitespeedio-plugin/index.js --sustainable.enable=true https://webperf.se?webperf-core-test-${{ matrix.version }} + node node_modules\sitespeed.io\bin\sitespeed.js -b chrome --plugins.remove screenshot --plugins.remove html --plugins.remove metrics --browsertime.screenshot false --screenshot false --screenshotLCP false --browsertime.screenshotLCP false --chrome.cdp.performance false --browsertime.chrome.timeline false --videoParams.createFilmstrip false --visualMetrics false --visualMetricsPerceptual false --visualMetricsContentful false --browsertime.headless true --browsertime.chrome.includeResponseBodies all --utc true --browsertime.chrome.args ignore-certificate-errors -n 1 --plugins.add ../../../@sitespeed.io/plugin-lighthouse/index.js --plugins.add ../../../webperf-sitespeedio-plugin/index.js https://webperf.se?webperf-core-test-${{ matrix.version }} diff --git a/.github/workflows/verify_browsertime_har.py b/.github/workflows/verify_browsertime_har.py index 85da9fbe..5c2dd8f2 100644 --- a/.github/workflows/verify_browsertime_har.py +++ b/.github/workflows/verify_browsertime_har.py @@ -149,14 +149,14 @@ def validate_entry(entry_index, entry, page_refs, full_validation): print(f'Error: log.entries[{entry_index}].pageref is missing in browsertime.har file') is_ok = False elif entry['pageref'] not in page_refs: - print(f'Error: log.entries[{entry_index}].pageref has wrong value, actual value: {entry['pageref']}') + print(f"Error: log.entries[{entry_index}].pageref has wrong value, actual value: {entry['pageref']}") is_ok = False if 'time' not in entry: print(f'Error: log.entries[{entry_index}].time is missing in browsertime.har file') is_ok = False elif not isinstance(entry['time'], float) and not isinstance(entry['time'], int): - print(f'Error: log.entries[{entry_index}].time has wrong value, actual value: {entry['time']}') + print(f"Error: log.entries[{entry_index}].time has wrong value, actual value: {entry['time']}") is_ok = False return is_ok @@ -171,7 +171,7 @@ def validate_entry_response(entry_index, entry, full_validation): print(f'Error: log.entries[{entry_index}].response.status is missing in browsertime.har file') is_ok = False elif not isinstance(entry['response']['status'], int): - print(f'Error: log.entries[{entry_index}].response.status has wrong value, actual value: {entry['response']['status']}') + print(f"Error: log.entries[{entry_index}].response.status has wrong value, actual value: {entry['response']['status']}") is_ok = False elif entry['response']['status'] not in ( 100, 101, 102, 103, @@ -183,7 +183,7 @@ def validate_entry_response(entry_index, entry, full_validation): 431, 451, 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, 511 ): - print(f'Error: log.entries[{entry_index}].response.status has wrong value, actual value: {entry['response']['status']}') + print(f"Error: log.entries[{entry_index}].response.status has wrong value, actual value: {entry['response']['status']}") is_ok = False if 'content' not in entry['response']: @@ -194,26 +194,26 @@ def validate_entry_response(entry_index, entry, full_validation): print(f'Error: log.entries[{entry_index}].response.content.mimeType is missing in browsertime.har file') is_ok = False elif entry['response']['content']['mimeType'] not in ('text/html', 'text/html;charset=utf-8', 'text/html;charset=UTF-8', 'text/css', 'image/png', 'image/webp', 'text/javascript', 'font/woff2'): - print(f'Error: log.entries[{entry_index}].response.content.mimeType has wrong value, actual value: {entry['response']['content']['mimeType']}') + print(f"Error: log.entries[{entry_index}].response.content.mimeType has wrong value, actual value: {entry['response']['content']['mimeType']}") is_ok = False if 'size' not in entry['response']['content']: print(f'Error: log.entries[{entry_index}].response.content.size is missing in browsertime.har file') is_ok = False elif not isinstance(entry['response']['content']['size'], int): - print(f'Error: log.entries[{entry_index}].response.content.size has wrong value, actual value: {entry['response']['content']['size']}') + print(f"Error: log.entries[{entry_index}].response.content.size has wrong value, actual value: {entry['response']['content']['size']}") is_ok = False elif entry['response']['content']['size'] < 1 and ('status' not in entry['response'] and entry['response']['status'] != 204): - print(f'Error: log.entries[{entry_index}].response.content.size has wrong value, actual value: {entry['response']['content']['size']}') + print(f"Error: log.entries[{entry_index}].response.content.size has wrong value, actual value: {entry['response']['content']['size']}") is_ok = False if full_validation and 'compression' in entry['response']['content'] and not isinstance(entry['response']['content']['compression'], int): - print(f'Error: log.entries[{entry_index}].response.content.compression has wrong value type, actual value type: {type(entry['response']['content']['compression'])}') + print(f"Error: log.entries[{entry_index}].response.content.compression has wrong value type, actual value type: {type(entry['response']['content']['compression'])}") is_ok = False if 'text' not in entry['response']['content']: if 'mimeType' in entry['response']['content'] and entry['response']['content']['mimeType'] in ('text/html;charset=utf-8', 'text/css', 'text/javascript'): - print(f'Error: log.entries[{entry_index}].response.content.text is missing in browsertime.har file {entry['response']['content']['mimeType']}') + print(f"Error: log.entries[{entry_index}].response.content.text is missing in browsertime.har file {entry['response']['content']['mimeType']}") is_ok = False elif 'status' in entry['response'] and entry['response']['status'] == 204: # ignore this @@ -224,7 +224,7 @@ def validate_entry_response(entry_index, entry, full_validation): # We would prefer to be able to use Firefox for this but currently we have a workaround # in place to only use chrome for when we need to read content of text based files. if full_validation: - print(f'Error: log.entries[{entry_index}].response.content.text has wrong value, actual value: {entry['response']['content']['text']}, content-type: {entry['response']['content']['mimeType']}') + print(f"Error: log.entries[{entry_index}].response.content.text has wrong value, actual value: {entry['response']['content']['text']}, content-type: {entry['response']['content']['mimeType']}") is_ok = False if 'httpVersion' not in entry['response']: @@ -243,7 +243,7 @@ def validate_entry_response(entry_index, entry, full_validation): print(f'Error: log.entries[{entry_index}].response.statusText is missing in browsertime.har file') is_ok = False elif not isinstance(entry['response']['statusText'], str): - print(f'Error: log.entries[{entry_index}].response.statusText has wrong value, actual value: {entry['response']['statusText']}') + print(f"Error: log.entries[{entry_index}].response.statusText has wrong value, actual value: {entry['response']['statusText']}") is_ok = False if 'headersSize' not in entry['response']: @@ -270,14 +270,14 @@ def validate_entry_response_headers(entry_index, entry): print(f'Error: log.entries[{entry_index}].response.headers[{header_index}].name is missing in browsertime.har file') is_ok = False elif re.match(r'[0-9a-z\-]+', header['name'], re.IGNORECASE) is None: - print(f'Error: log.entries[{entry_index}].response.headers[{header_index}].name has wrong name, actual value: {header['name']}') + print(f"Error: log.entries[{entry_index}].response.headers[{header_index}].name has wrong name, actual value: {header['name']}") is_ok = False if 'value' not in header: print(f'Error: log.entries[{entry_index}].response.headers[{header_index}].value is missing in browsertime.har file') is_ok = False elif re.match(r'[0-9a-z\-\.\"]+', header['value'], re.IGNORECASE) is None: - print(f'Error: log.entries[{entry_index}].response.headers[{header_index}].value has wrong value, actual value: {header['value']}') + print(f"Error: log.entries[{entry_index}].response.headers[{header_index}].value has wrong value, actual value: {header['value']}") is_ok = False header_index += 1 @@ -297,10 +297,10 @@ def validate_entry_request(entry_index, entry, full_validation): is_ok = False else: if entry_index == 0 and entry['request']['url'] != 'https://webperf.se/': - print(f'Error: log.entries[{entry_index}].request.url has wrong value, actual value: {entry['request']['url']}') + print(f"Error: log.entries[{entry_index}].request.url has wrong value, actual value: {entry['request']['url']}") is_ok = False if not entry['request']['url'].startswith('http://') and not entry['request']['url'].startswith('https://'): - print(f'Error: log.entries[{entry_index}].request.url has wrong value, actual value: {entry['request']['url']}') + print(f"Error: log.entries[{entry_index}].request.url has wrong value, actual value: {entry['request']['url']}") is_ok = False if not full_validation: @@ -310,36 +310,36 @@ def validate_entry_request(entry_index, entry, full_validation): print(f'Error: log.entries[{entry_index}].request.method is missing in browsertime.har file') is_ok = False elif entry['request']['method'] not in ('GET','POST', 'HEAD', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'): - print(f'Error: log.entries[{entry_index}].request.method has wrong value, actual value: {entry['request']['method']}') + print(f"Error: log.entries[{entry_index}].request.method has wrong value, actual value: {entry['request']['method']}") is_ok = False if 'queryString' not in entry['request']: print(f'Error: log.entries[{entry_index}].request.queryString is missing in browsertime.har file') is_ok = False elif entry_index == 0 and entry['request']['queryString'] != []: - print(f'Error: log.entries[{entry_index}].request.queryString has wrong value, actual value: {entry['request']['queryString']}') + print(f"Error: log.entries[{entry_index}].request.queryString has wrong value, actual value: {entry['request']['queryString']}") is_ok = False if 'headersSize' not in entry['request']: print(f'Error: log.entries[{entry_index}].request.headersSize is missing in browsertime.har file') is_ok = False elif not isinstance(entry['request']['headersSize'], int): - print(f'Error: log.entries[{entry_index}].request.headersSize has wrong value, actual value: {entry['request']['headersSize']}') + print(f"Error: log.entries[{entry_index}].request.headersSize has wrong value, actual value: {entry['request']['headersSize']}") is_ok = False # NOTE: Not required by HAR specification 1.2 # elif entry['request']['headersSize'] == -1: - # print(f'Warning: log.entries[{entry_index}].request.headersSize has wrong value, actual value: {entry['request']['headersSize']}') + # print(f"Warning: log.entries[{entry_index}].request.headersSize has wrong value, actual value: {entry['request']['headersSize']}") # is_ok = False if 'bodySize' not in entry['request']: print(f'Error: log.entries[{entry_index}].request.bodySize is missing in browsertime.har file') is_ok = False elif not isinstance(entry['request']['bodySize'], int): - print(f'Error: log.entries[{entry_index}].request.bodySize has wrong value, actual value: {entry['request']['bodySize']}') + print(f"Error: log.entries[{entry_index}].request.bodySize has wrong value, actual value: {entry['request']['bodySize']}") is_ok = False # NOTE: Not required by HAR specification 1.2 # elif entry['request']['bodySize'] != 0: - # print(f'Error: log.entries[{entry_index}].request.bodySize has wrong value, actual value: {entry['request']['bodySize']}') + # print(f"Error: log.entries[{entry_index}].request.bodySize has wrong value, actual value: {entry['request']['bodySize']}") # is_ok = False if 'cookies' not in entry['request']: @@ -350,7 +350,7 @@ def validate_entry_request(entry_index, entry, full_validation): print(f'Error: log.entries[{entry_index}].request.httpVersion is missing in browsertime.har file') is_ok = False elif entry['request']['httpVersion'] not in ('http/1.1', 'h2','h3'): - print(f'Error: log.entries[{entry_index}].request.httpVersion has wrong value, actual value: {entry['request']['httpVersion']}') + print(f"Error: log.entries[{entry_index}].request.httpVersion has wrong value, actual value: {entry['request']['httpVersion']}") is_ok = False is_ok = validate_entry_request_headers(entry_index, entry) and is_ok @@ -369,14 +369,14 @@ def validate_entry_request_headers(entry_index, entry): print(f'Error: log.entries[{entry_index}].request.headers[{header_index}].name is missing in browsertime.har file') is_ok = False elif re.match(r'[\:0-9a-z\-]+', header['name'], re.IGNORECASE) is None: - print(f'Error: log.entries[{entry_index}].request.headers[{header_index}].name has wrong name, actual value: {header['name']}') + print(f"Error: log.entries[{entry_index}].request.headers[{header_index}].name has wrong name, actual value: {header['name']}") is_ok = False if 'value' not in header: print(f'Error: log.entries[{entry_index}].request.headers[{header_index}].value is missing in browsertime.har file') is_ok = False elif re.match(r'[0-9a-z\-\.\"\?/\*]*', header['value'], re.IGNORECASE) is None: - print(f'Error: log.entries[{entry_index}].request.headers[{header_index}].value has wrong value, actual value: {header['value']}') + print(f"Error: log.entries[{entry_index}].request.headers[{header_index}].value has wrong value, actual value: {header['value']}") is_ok = False header_index += 1 @@ -409,7 +409,7 @@ def validate_page(page_index, page, full_validation): is_ok = True page_ref = None if page['_url'] != 'https://webperf.se': - print(f'Error: log.pages[{page_index}]._url has wrong value, actual value: {page['_url']}') + print(f"Error: log.pages[{page_index}]._url has wrong value, actual value: {page['_url']}") is_ok = False if not full_validation: @@ -419,7 +419,7 @@ def validate_page(page_index, page, full_validation): print(f'Error: log.pages[{page_index}].id is missing in browsertime.har file') is_ok = False elif f'page_{page_index +1 }' not in page['id']: - print(f'Error: log.pages[{page_index}].id has wrong value, actual value: {page['id']}') + print(f"Error: log.pages[{page_index}].id has wrong value, actual value: {page['id']}") is_ok = False page_ref = page['id'] else: @@ -444,21 +444,21 @@ def validate_page(page_index, page, full_validation): print(f'Error: log.pages[{page_index}].pageTimings.onContentLoad is missing in browsertime.har file') is_ok = False elif not isinstance(page['pageTimings']['onContentLoad'], float) and not isinstance(page['pageTimings']['onContentLoad'], int): - print(f'Error: log.pages[{page_index}].pageTimings.onContentLoad has wrong value, actual value: {page['pageTimings']['onContentLoad']}') + print(f"Error: log.pages[{page_index}].pageTimings.onContentLoad has wrong value, actual value: {page['pageTimings']['onContentLoad']}") is_ok = False if 'onLoad' not in page['pageTimings']: print(f'Error: log.pages[{page_index}].pageTimings.onLoad is missing in browsertime.har file') is_ok = False elif not isinstance(page['pageTimings']['onLoad'], float) and not isinstance(page['pageTimings']['onLoad'], int): - print(f'Error: log.pages[{page_index}].pageTimings.onLoad has wrong value, actual value: {page['pageTimings']['onLoad']}') + print(f"Error: log.pages[{page_index}].pageTimings.onLoad has wrong value, actual value: {page['pageTimings']['onLoad']}") is_ok = False if '_url' not in page: print(f'Error: log.pages[{page_index}]._url is missing in browsertime.har file') is_ok = False if page['_url'] != 'https://webperf.se': - print(f'Error: log.pages[{page_index}]._url has wrong value, actual value: {page['_url']}') + print(f"Error: log.pages[{page_index}]._url has wrong value, actual value: {page['_url']}") is_ok = False if '_meta' not in page: @@ -476,14 +476,14 @@ def validate_browser(browsertime_har): print('Error: log.browser.name is missing in browsertime.har file') is_ok = False if browsertime_har['log']['browser']['name'] not in ('firefox', 'Chrome'): - print(f'Error: log.browser.name has wrong value, actual value: {browsertime_har['log']['browser']['name']}') + print(f"Error: log.browser.name has wrong value, actual value: {browsertime_har['log']['browser']['name']}") is_ok = False if 'version' not in browsertime_har['log']['browser']: print('Error: log.browser.version is missing in browsertime.har file') is_ok = False if re.match(r'[0-9\.]+', browsertime_har['log']['browser']['version'], re.IGNORECASE) is None: - print(f'Error: log.browser.name has wrong value, actual value: {browsertime_har['log']['browser']['version']}') + print(f"Error: log.browser.name has wrong value, actual value: {browsertime_har['log']['browser']['version']}") is_ok = False return is_ok diff --git a/Dockerfile b/Dockerfile index 9bbf8908..0ce9a322 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM sitespeedio/sitespeed.io:36.1.0 +FROM sitespeedio/sitespeed.io:36.2.5 USER root @@ -24,23 +24,6 @@ RUN apt-get update &&\ update-ca-certificates && \ rm -rf /var/lib/apt/lists/* -# NOTE: Python speed improvements from: https://tecadmin.net/how-to-install-python-3-12-on-ubuntu/ -RUN add-apt-repository ppa:deadsnakes/ppa -y - -RUN apt update - -RUN apt install -y python3.13 python3.13-venv - -RUN apt install -y python3-pip - -RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 311 - -RUN update-alternatives --config python3 - -RUN wget https://bootstrap.pypa.io/get-pip.py - -RUN python3.13 get-pip.py - RUN apt -y autoremove # Add user so we don't need --no-sandbox. @@ -66,18 +49,18 @@ COPY pa11y-docker-config.json /usr/src/runner/pa11y.json RUN chown --recursive sitespeedio:sitespeedio /usr/src/runner +RUN python3 -m pip install -r requirements.txt --break-system-packages && \ + python3 -m pip install --upgrade pip --break-system-packages && \ + python3 -m pip install --upgrade setuptools --break-system-packages && \ + python3 -m pip install pyssim Pillow image --break-system-packages + # Run everything after as non-privileged user. USER sitespeedio RUN npm ci --only=production -RUN python3.13 -m pip install -r requirements.txt --break-system-packages && \ - python3.13 -m pip install --upgrade pip --break-system-packages && \ - python3.13 -m pip install --upgrade setuptools --break-system-packages && \ - python3.13 -m pip install pyssim Pillow image --break-system-packages - -RUN python3.13 default.py --setting tests.sitespeed.xvfb=true --save-setting settings.json +RUN python3 default.py --setting tests.sitespeed.xvfb=true --save-setting settings.json ENTRYPOINT [] -CMD ["python3.13", "default.py -h"] +CMD ["python3", "default.py -h"] diff --git a/LICENSE b/LICENSE index 7feab5d0..38d573cf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Webperf.se +Copyright (c) 2020-2025 Webperf.se Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/defaults/software-full.json b/defaults/software-full.json index 89a2e76a..5ac63c1d 100644 --- a/defaults/software-full.json +++ b/defaults/software-full.json @@ -266,6 +266,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "5.5.9": [], "5.5.7": [], "5.5.6": [], "5.5.5": [], @@ -736,6 +737,8 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "1.15.3": [], + "1.15.2": [], "1.15.1": [], "1.15.0": [], "1.14.9": [], @@ -1029,6 +1032,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "4.12.5": [], "4.12.4": [], "4.12.3": [], "4.12.2": [], @@ -8285,6 +8289,8 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "5.10.18": [], + "5.10.17": [], "5.10.16": [], "5.10.15": [], "5.10.14": [], @@ -8386,6 +8392,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "4.5.0": [], "4.4.0": [], "4.3.1": [], "4.3.0": [], @@ -9709,6 +9716,7 @@ ], "archived": false, "versions": { + "8.2.0": [], "8.1.3": [], "8.1.2": [], "8.1.1": [], @@ -14479,6 +14487,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "3.27.1": [], "3.27.0": [], "3.26.5": [], "3.26.4": [], @@ -15507,6 +15516,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "1.1.7": [], "1.1.6": [], "1.1.5": [], "1.1.4": [], @@ -16323,6 +16333,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "5.18.1": [], "5.18.0.1": [], "5.18.0": [], "5.17.0.1": [], @@ -16786,6 +16797,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "1.6.13": [], "1.6.12": [], "1.6.11": [], "1.6.10": [], @@ -16909,6 +16921,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "3.0.9": [], "3.0.8.1": [], "3.0.8": [], "3.0.7.1": [], @@ -18623,6 +18636,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "1.15.32": [], "1.15.31": [], "1.15.30": [], "1.15.29": [], @@ -19384,6 +19398,7 @@ ], "archived": false, "versions": { + "4.0.33": [], "4.0.32": [], "4.0.31": [], "4.0.30": [], @@ -19669,10 +19684,6 @@ "CVE-2022-1330", "CVE-2022-1295" ], - "2.4.8.1": [ - "CVE-2022-1330", - "CVE-2022-1295" - ], "2.2.8": [ "CVE-2022-1330", "CVE-2022-1295" @@ -20805,6 +20816,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "3.10.3": [], "3.10.2": [], "3.10.1": [], "3.10.0": [], @@ -21508,6 +21520,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "1.30": [], "1.29": [], "1.28": [], "1.27": [], @@ -30351,6 +30364,7 @@ ], "archived": false, "versions": { + "3.9.4": [], "3.9.3": [], "3.9.2": [], "3.9.1": [], @@ -31895,6 +31909,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "8.6.6": [], "8.6.5": [], "8.6.4": [], "8.6.3": [], @@ -33032,6 +33047,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "3.8.24": [], "3.8.23": [], "3.8.22": [], "3.8.21": [], @@ -33320,6 +33336,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "2.4.3": [], "2.4.2": [], "2.4.1": [], "2.4.0": [], @@ -36338,190 +36355,190 @@ "8.1.1": [], "8.1.0": [], "8.0.30": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.29": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.28": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.27": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.26": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.25": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.24": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.23": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.22": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.21": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.20": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.19": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.18": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.17": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.16": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.15": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.14": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.13": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.12": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.11": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.10": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.9": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.8": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.7": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.6": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.5": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.3": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.2": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.1": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "8.0.0": [ - "END_OF_LIFE (1 year, 1 month ago)" + "END_OF_LIFE (1 year, 2 months ago)" ], "7.4.33": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.32": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.30": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.29": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.28": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.27": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.26": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.25": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.24": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.23": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.22": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.21": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.20": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.19": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.18": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.16": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.15": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.14": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.13": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.12": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.11": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.10": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.9": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.8": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.7": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.6": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.5": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.4": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.3": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.2": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.1": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.4.0": [ - "END_OF_LIFE (2 years, 1 month ago)" + "END_OF_LIFE (2 years, 2 months ago)" ], "7.3.33": [ "END_OF_LIFE (3 years, 1 month ago)" @@ -40257,6 +40274,7 @@ ], "archived": false, "versions": { + "9.5.1": [], "9.5.0": [], "9.4.4": [], "9.4.3": [], @@ -44168,6 +44186,8 @@ ], "archived": false, "versions": { + "36.2.1": [], + "36.2.0": [], "36.1.0": [], "36.0.3": [], "36.0.2": [], @@ -44263,9 +44283,7 @@ "30.0.0": [], "29.9.0": [], "29.8.0": [], - "29.7.0": [], - "29.6.0": [], - "29.5.0": [] + "29.7.0": [] } }, "sizzle": { @@ -45824,6 +45842,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "3.0.2": [], "3.0.1": [], "3.0": [], "2.4.4": [], @@ -46530,6 +46549,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "2.10.45": [], "2.10.44": [], "2.10.43": [], "2.10.42": [], @@ -46902,6 +46922,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "4.0.4": [], "4.0.2": [], "4.0.1": [], "4.0.0": [], @@ -48596,12 +48617,12 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "1.2.4": [], "1.2.3": [], "1.2.2": [], "1.2.1": [] }, - "archived": false, - "notice": "Warning! This plugin hasn't been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress." + "archived": false }, "verge": { "github-owner": "ryanve", @@ -50198,6 +50219,7 @@ "[peterk](https://github.com/peterk)" ], "versions": { + "2025.1.8": [], "2025.1.7": [], "2025.1.6": [], "2025.1.5": [], @@ -52225,6 +52247,7 @@ "type": "wordpress-plugin", "last_pushed_year": "2024", "versions": { + "9.0.01.001": [], "9.0.00.009": [], "9.0.00.008": [], "9.0.00.007": [], diff --git a/helpers/dependency_helper.py b/helpers/dependency_helper.py index 99754bd4..333a1ff3 100644 --- a/helpers/dependency_helper.py +++ b/helpers/dependency_helper.py @@ -30,34 +30,29 @@ def test_cmd(command): process.kill() return result, 'Not found.' + def check_python(): result, error = test_cmd('python -V') - # if python_error is not None or python_error != b'': - # print('\t- Python:', 'ERROR:', python_error) - # return if result is None: print('\t- Python:', 'ERROR: Unknown return') return version = None - regex = r"Python (?P[0-9\.]+)" - matches = re.finditer( - regex, result, re.MULTILINE) + regex = r"Python (?P[0-9]+)\.(?P[0-9]+)" + matches = re.finditer(regex, result, re.MULTILINE) for _, match in enumerate(matches, start=1): - version = match.group('version') + version = packaging.version.Version(f"{match.group('major')}.{match.group('minor')}") if version is None: print('\t- Python:', 'ERROR: Unable to get version') return - version = packaging.version.Version(version) - repo_version = packaging.version.Version("3.13") - if version.major is not repo_version.major: - print('\t- Python:', 'WARNING: wrong major version') - return + # Define acceptable versions, only considering major and minor + acceptable_versions = {packaging.version.Version('3.10'), packaging.version.Version('3.11'), + packaging.version.Version('3.12'), packaging.version.Version('3.13')} - if version.minor is not repo_version.minor: - print('\t- Python:', 'WARNING: wrong minor version') + if version not in acceptable_versions: + print('\t- Python:', 'WARNING: version not in supported range (3.10-3.13)') return print('\t- Python:', 'OK') @@ -82,17 +77,13 @@ def check_java(): def check_node(): result, error = test_cmd('node -v') - # if python_error is not None or python_error != b'': - # print('\t- Python:', 'ERROR:', python_error) - # return if result is None: print('\t- Node:', 'ERROR: Unknown return') return version = None regex = r"v(?P[0-9\.]+)" - matches = re.finditer( - regex, result, re.MULTILINE) + matches = re.finditer(regex, result, re.MULTILINE) for _, match in enumerate(matches, start=1): version = match.group('version') @@ -102,12 +93,15 @@ def check_node(): version = packaging.version.Version(version) repo_version = packaging.version.Version("20.17") - if version.major is not repo_version.major: - print('\t- Node:', 'WARNING: wrong major version') + + # Check if the major version is between 20 and 22 + if not (20 <= version.major <= 22): + print('\t- Node:', 'WARNING: Major version not between 20 and 22') return - if version.minor < repo_version.minor: - print('\t- Node:', 'WARNING: wrong minor version') + # Check if the minor version is at least as high as the repository's minor version + if version.major == repo_version.major and version.minor < repo_version.minor: + print('\t- Node:', 'WARNING: Minor version is below required') return print('\t- Node:', 'OK') diff --git a/helpers/test_helper.py b/helpers/test_helper.py index f65151ed..30afdfea 100644 --- a/helpers/test_helper.py +++ b/helpers/test_helper.py @@ -161,9 +161,7 @@ def get_error_info(url, test_type, ex): result.extend(get_versions()) result.extend(['###############################################', '\n# Information:', - f"\nDateTime: { \ - datetime.now().strftime('%Y-%m-%d %H:%M:%S') \ - }", + f"\nDateTime: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}", f'\nUrl: {url}', f'\nTest Type(s): {test_type}', '\n###############################################' diff --git a/helpers/translation_helper.py b/helpers/translation_helper.py index 78eb82d6..c26da423 100644 --- a/helpers/translation_helper.py +++ b/helpers/translation_helper.py @@ -80,7 +80,7 @@ def validate_po_file(locales_dir, locale_name, language_sub_directory, file, msg if not os.path.exists(file_mo): print( (f' Expected compiled translation file not found, ' - f'file: "{file.replace('.po', '.mo')}"')) + f"file: \"{file.replace('.po', '.mo')}\"")) return False clear_cache = True @@ -304,10 +304,11 @@ def validate_msg_ids(available_languages, msg_ids): for msg in msg_list: msg_langs.append(msg['locale_name']) nof_langs = len(msg_langs) + tmp_str = '","'.join(msg_langs) if nof_langs < nof_languages: - print(f" # msgid \"{msg_id}\" only in \"{'\",\"'.join(msg_langs)}\"") + print(f" # msgid \"{msg_id}\" only in \"{tmp_str}\"") else: - print(f" # msgid \"{msg_id}\" occur multiple times \"{'\",\"'.join(msg_langs)}\"") + print(f" # msgid \"{msg_id}\" occur multiple times \"{tmp_str}\"") if len(msg_ids_with_missing_language) > 0: is_valid = False @@ -477,7 +478,7 @@ def validate_locales(base_directory, msg_ids): if len(available_languages) > 0: print('') - print(f' Available Languages: {', '.join(available_languages)}') + print(f" Available Languages: {', '.join(available_languages)}") else: print(' No languages found') @@ -523,9 +524,8 @@ def validate_locale(msg_ids, locales_dir, if msgfmt_path is not None: print( ' - Trying to generate .mo file so it matches .po file') - bash_command = (f"python {msgfmt_path} -o " - f"{os.path.join(lang_sub_directory, - file.replace('.po', '.mo'))} " + bash_command = (f"python {msgfmt_path} -o ", + f"{os.path.join(lang_sub_directory, file.replace('.po', '.mo'))} ", f"{os.path.join(lang_sub_directory, file)}") with subprocess.Popen( diff --git a/package.json b/package.json index a5e2167a..c9667e97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webperf_core", - "version": "2025.1.8", + "version": "2025.2.0", "description": "You probably want to read the documentation available at homepage.", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" @@ -13,13 +13,13 @@ "@sitespeed.io/plugin": "1.0.0", "@sitespeed.io/plugin-lighthouse": "12.3.0", "pa11y": "8.0.0", - "sitespeed.io": "36.1.0", - "stylelint": "16.13.2", + "sitespeed.io": "36.2.5", + "stylelint": "16.14.1", "vnu-jar": "23.4.11", "webperf-sitespeedio-plugin": "2025.1.4", "yellowlabtools": "3.0.1" }, "engines": { - "node": "20.x" + "node": ">=20.x" } } \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 2505ae61..1732c677 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,5 +10,5 @@ Pillow==11.1.0 OpenCV-Python==4.11.0.86 Numpy==2.2.2 cryptography==44.0.0 -pylint==3.3.3 +pylint==3.3.4 packaging==24.2 diff --git a/tests/frontend_quality_yellow_lab_tools.py b/tests/frontend_quality_yellow_lab_tools.py index cf6a49c8..d2b867ae 100644 --- a/tests/frontend_quality_yellow_lab_tools.py +++ b/tests/frontend_quality_yellow_lab_tools.py @@ -136,7 +136,7 @@ def add_category_ratings(global_translation, local_translation, result_dict): if 'label' not in rule['policy']: continue - rule_label = f'- {local_translation(rule['policy']['label'])}' + rule_label = f"- {local_translation(rule['policy']['label'])}" # only do stuff for rules we know how to place in category if rule_key in performance_keys: diff --git a/tests/lint_base.py b/tests/lint_base.py index 26b7d4f1..a4c94f01 100644 --- a/tests/lint_base.py +++ b/tests/lint_base.py @@ -57,7 +57,7 @@ def get_errors(test_type, params): if 'https://' not in url and 'http://' not in url: raise ValueError( - f'Tested url must start with \'https://\' or \'http://\': {url}') + f"Tested url must start with \'https://\' or \'http://\': {url}") file_path = get_cache_path_for_file(url, True) if is_html: diff --git a/tests/performance_sitespeed_io.py b/tests/performance_sitespeed_io.py index aecbf130..26ea1879 100644 --- a/tests/performance_sitespeed_io.py +++ b/tests/performance_sitespeed_io.py @@ -203,7 +203,7 @@ def validate_on_mobile_using_validator(url, validator_config): '--speedIndex true ' '--browsertime.videoParams.createFilmstrip false ' '--browsertime.chrome.args ignore-certificate-errors ' - f'-n {get_config('tests.sitespeed.iterations')} ' + f"-n {get_config('tests.sitespeed.iterations')} " '--preScript chrome-custom.cjs ' f'{url}' f'{browertime_plugin_options}' @@ -242,16 +242,16 @@ def get_browsertime_plugin_options(validator_config): for header in validator_config['headers']: browertime_plugin_options += ( f' --browsertime.webperf.header0{index}' - f' {header['name'].replace(' ', '%20').replace('=', '%3D')}=' - f'{header['value'].replace(' ', '%20').replace('=', '%3D')}') + f" {header['name'].replace(' ', '%20').replace('=', '%3D')}=" + f"{header['value'].replace(' ', '%20').replace('=', '%3D')}") index += 1 if 'htmls' in validator_config: index = 1 for header in validator_config['htmls']: browertime_plugin_options += ( f' --browsertime.webperf.HTML0{index}' - f' {header['replace'].replace(' ', '%20').replace('=', '%3D')}=' - f'{header['replaceWith'].replace(' ', '%20').replace('=', '%3D')}') + f" {header['replace'].replace(' ', '%20').replace('=', '%3D')}=" + f"{header['replaceWith'].replace(' ', '%20').replace('=', '%3D')}") index += 1 return browertime_plugin_options @@ -278,7 +278,7 @@ def validate_on_desktop_using_validator(url, validator_config): '--speedIndex true ' '--browsertime.videoParams.createFilmstrip false ' '--browsertime.chrome.args ignore-certificate-errors ' - f'-n {get_config('tests.sitespeed.iterations')} ' + f"-n {get_config('tests.sitespeed.iterations')} " '--preScript chrome-custom.cjs ' f'{url}' f'{browertime_plugin_options}' @@ -312,7 +312,7 @@ def validate_on_desktop(url): '--speedIndex true ' '--browsertime.videoParams.createFilmstrip false ' '--browsertime.chrome.args ignore-certificate-errors ' - f'-n {get_config('tests.sitespeed.iterations')} ' + f"-n {get_config('tests.sitespeed.iterations')} " '--preScript chrome-custom.cjs ' f'{url}' ) @@ -344,7 +344,7 @@ def validate_on_mobile(url): '--speedIndex true ' '--browsertime.videoParams.createFilmstrip false ' '--browsertime.chrome.args ignore-certificate-errors ' - f'-n {get_config('tests.sitespeed.iterations')} ' + f"-n {get_config('tests.sitespeed.iterations')} " '--preScript chrome-custom.cjs ' f'{url}' ) diff --git a/tests/sitespeed_base.py b/tests/sitespeed_base.py index 202412c3..eb95746d 100644 --- a/tests/sitespeed_base.py +++ b/tests/sitespeed_base.py @@ -449,6 +449,9 @@ def get_browsertime_har_path(parent_path): if not os.path.exists(parent_path): return '' + if not os.path.isdir(parent_path): + return '' + sub_dirs = os.listdir(parent_path) if 'browsertime.har' in sub_dirs: return os.path.join(parent_path, 'browsertime.har') diff --git a/tests/utils.py b/tests/utils.py index 12633a25..02b12975 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -394,7 +394,7 @@ def get_http_content(url, allow_redirects=False, use_text_instead_of_content=Tru headers = {'user-agent': get_config('useragent')} hostname = urlparse(url).hostname if hostname == 'api.github.com' and get_config('github.api.key') is not None: - headers['authorization'] = f'Bearer {get_config('github.api.key')}' + headers['authorization'] = f"Bearer {get_config('github.api.key')}" response = requests.get(url, allow_redirects=allow_redirects, headers=headers, timeout=get_config('general.request.timeout')*2) diff --git a/tests/w3c_base.py b/tests/w3c_base.py index b39069f5..bd414c3c 100644 --- a/tests/w3c_base.py +++ b/tests/w3c_base.py @@ -55,7 +55,7 @@ def get_errors(test_type, params): if 'https://' not in url and 'http://' not in url: raise ValueError( - f'Tested url must start with \'https://\' or \'http://\': {url}') + f"Tested url must start with \'https://\' or \'http://\': {url}") file_path = get_cache_path_for_file(url, True) if is_html: