Skip to content

Commit

Permalink
Merge pull request #794 from Webperf-se/unittest-test02
Browse files Browse the repository at this point in the history
404 Test - Regression test use offline version
  • Loading branch information
cockroacher authored Dec 18, 2024
2 parents c4dea1b + f8c0f34 commit d8b40b5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/regression-test-404.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ jobs:
- if: ${{ matrix.os == 'ubuntu-latest' }}
name: RUNNING TEST - LINUX
run: |
python default.py -t ${{ matrix.version }} -r -i defaults/sites.json -o data/testresult-${{ matrix.version }}.json --setting ${{ matrix.config }} --setting tests.sitespeed.xvfb=true
python default.py -t ${{ matrix.version }} -r -u https://webperf.se/2f08c/finns-det-en-sida/pa-den-har-adressen/testanrop/?webperf-core-test-2 -o data/testresult-${{ matrix.version }}.json --setting ${{ matrix.config }} --setting tests.sitespeed.xvfb=true --setting tests.page-not-found.override-url=false --setting general.cache.use=true --setting tests.sitespeed.cache.folder=unittests
python .github/workflows/verify_result.py -t ${{ matrix.version }}
- if: ${{ matrix.os == 'windows-latest' }}
name: RUNNING TEST - WINDOWS
run: |
python default.py -t ${{ matrix.version }} -r -i defaults\sites.json -o data\testresult-${{ matrix.version }}.json --setting ${{ matrix.config }}
python default.py -t ${{ matrix.version }} -r -u https://webperf.se/2f08c/finns-det-en-sida/pa-den-har-adressen/testanrop/?webperf-core-test-2 -o data\testresult-${{ matrix.version }}.json --setting ${{ matrix.config }} --setting tests.page-not-found.override-url=false --setting general.cache.use=true --setting tests.sitespeed.cache.folder=unittests
python .github\workflows\verify_result.py -t ${{ matrix.version }}
3 changes: 3 additions & 0 deletions defaults/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
"use": true
}
},
"page-not-found": {
"override-url": true
},
"webbkoll": {
"sleep": 20
}
Expand Down
5 changes: 4 additions & 1 deletion helpers/setting_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@
"mailipv6",
"tests.email.support.ipv6",
"email_network_support_ipv6_traffic",
"EMAIL_NETWORK_SUPPORT_IPV6_TRAFFIC"): "bool|tests.email.support.ipv6"
"EMAIL_NETWORK_SUPPORT_IPV6_TRAFFIC"): "bool|tests.email.support.ipv6",
(
"404url",
"tests.page-not-found.override-url"): "bool|tests.page-not-found.override-url"
}


Expand Down
5 changes: 4 additions & 1 deletion tests/page_not_found.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ def run_test(global_translation, org_url):
print(global_translation('TEXT_TEST_START').format(
datetime.now().strftime('%Y-%m-%d %H:%M:%S')))

url = change_url_to_404_url(org_url)
if get_config('tests.page-not-found.override-url'):
url = change_url_to_404_url(org_url)
else:
url = org_url

# checks http status code and content for url
request_text, code = get_http_content_with_status(url)
Expand Down
1 change: 1 addition & 0 deletions unittests/webperf.se/test-02-no-errors.har

Large diffs are not rendered by default.

0 comments on commit d8b40b5

Please sign in to comment.