aboutsummaryrefslogtreecommitdiff
path: root/.github/prtester.py
diff options
context:
space:
mode:
authorGravatar Bocki <henning@bocklage.com> 2024-10-16 15:36:57 +0200
committerGravatar GitHub <noreply@github.com> 2024-10-16 15:36:57 +0200
commit63c16e470daf6ee4fd2123295bd05ae0a15c7c0c (patch)
tree7a42de1f974f841d0e3817f704d822193e4868a2 /.github/prtester.py
parentaf26d845d907cf810bd4028a5ea587fb902a9225 (diff)
downloadrss-bridge-63c16e470daf6ee4fd2123295bd05ae0a15c7c0c.tar.gz
rss-bridge-63c16e470daf6ee4fd2123295bd05ae0a15c7c0c.tar.zst
rss-bridge-63c16e470daf6ee4fd2123295bd05ae0a15c7c0c.zip
[prtester] Rework test storage (#4292)
* Update prtester.py * Update prhtmlgenerator.yml
Diffstat (limited to '.github/prtester.py')
-rw-r--r--.github/prtester.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/.github/prtester.py b/.github/prtester.py
index 3d7dae99..53d77725 100644
--- a/.github/prtester.py
+++ b/.github/prtester.py
@@ -4,7 +4,7 @@ import re
from bs4 import BeautifulSoup
from datetime import datetime
from typing import Iterable
-import os.path
+import os
import urllib
# This script is specifically written to be used in automation for https://github.com/RSS-Bridge/rss-bridge
@@ -39,6 +39,8 @@ def main(instances: Iterable[Instance], with_upload: bool, with_reduced_upload:
def testBridges(instance: Instance, bridge_cards: Iterable, with_upload: bool, with_reduced_upload: bool) -> Iterable:
instance_suffix = ''
+ prid = os.getenv("PR")
+ tester_url = f'https://rss-bridge.github.io/rss-bridge-tests/prs/{prid}'
if instance.name:
instance_suffix = f' ({instance.name})'
table_rows = []
@@ -140,10 +142,10 @@ def testBridges(instance: Instance, bridge_cards: Iterable, with_upload: bool, w
if status_is_ok:
status = '✔️'
if with_upload and (not with_reduced_upload or not status_is_ok):
- termpad = requests.post(url="https://termpad.com/", data=page_text)
- termpad_url = termpad.text.strip()
- termpad_url = termpad_url.replace('termpad.com/','termpad.com/raw/')
- table_rows.append(f'| {bridge_name} | [{form_number} {context_name}{instance_suffix}]({termpad_url}) | {status} |')
+ filename = f'{os.getcwd()}/{instance.name}_{form_number}.html'
+ with open(file=filename, mode='wb') as file:
+ file.write(page_text)
+ table_rows.append(f'| {bridge_name} | [{form_number} {context_name}{instance_suffix}]({tester_url}/{instance.name}_{form_number}.html) | {status} |')
form_number += 1
return table_rows
@@ -187,4 +189,4 @@ if __name__ == '__main__':
with_reduced_upload=args.reduced_upload and not args.no_upload,
title=args.title,
output_file=args.output_file
- ); \ No newline at end of file
+ );