mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-17 13:38:03 +00:00
Improve CI output visibility and remove buffering
- Add flush=True to all colored_print calls for immediate output - Add PYTHONUNBUFFERED=1 to all deployment and performance test jobs - Replace simple sleep with countdown progress indicator - Show 'Retrying in X seconds...' with real-time countdown - Clear progress line after countdown completes - Better visibility of what the script is doing during long waits
This commit is contained in:
@@ -161,6 +161,7 @@ performance_tests_dev:
|
||||
when: on_success # Run automatically after successful deployment verification
|
||||
variables:
|
||||
DEV_URL: "https://dev.libravatar.org"
|
||||
PYTHONUNBUFFERED: 1
|
||||
before_script:
|
||||
- apk add --no-cache curl
|
||||
- pip install requests Pillow prettytable pyLibravatar dnspython py3dns
|
||||
@@ -185,6 +186,7 @@ performance_tests_prod:
|
||||
when: on_success # Run automatically after successful deployment verification
|
||||
variables:
|
||||
PROD_URL: "https://libravatar.org"
|
||||
PYTHONUNBUFFERED: 1
|
||||
before_script:
|
||||
- apk add --no-cache curl
|
||||
- pip install requests Pillow prettytable pyLibravatar dnspython py3dns
|
||||
@@ -209,6 +211,7 @@ performance_tests_prod_manual:
|
||||
when: manual # Manual trigger for on-demand performance testing
|
||||
variables:
|
||||
PROD_URL: "https://libravatar.org"
|
||||
PYTHONUNBUFFERED: 1
|
||||
before_script:
|
||||
- apk add --no-cache curl
|
||||
- pip install requests Pillow prettytable pyLibravatar dnspython py3dns
|
||||
@@ -231,6 +234,7 @@ verify_dev_deployment:
|
||||
DEV_URL: "https://dev.libravatar.org"
|
||||
MAX_RETRIES: 30
|
||||
RETRY_DELAY: 60
|
||||
PYTHONUNBUFFERED: 1
|
||||
before_script:
|
||||
- apk add --no-cache curl git
|
||||
- pip install Pillow
|
||||
@@ -249,6 +253,7 @@ verify_prod_deployment:
|
||||
PROD_URL: "https://libravatar.org"
|
||||
MAX_RETRIES: 10
|
||||
RETRY_DELAY: 30
|
||||
PYTHONUNBUFFERED: 1
|
||||
before_script:
|
||||
- apk add --no-cache curl git
|
||||
- pip install Pillow
|
||||
|
||||
@@ -54,8 +54,8 @@ class Colors:
|
||||
|
||||
|
||||
def colored_print(message: str, color: str = Colors.NC) -> None:
|
||||
"""Print a colored message."""
|
||||
print(f"{color}{message}{Colors.NC}")
|
||||
"""Print a colored message with immediate flush."""
|
||||
print(f"{color}{message}{Colors.NC}", flush=True)
|
||||
|
||||
|
||||
def get_current_commit_hash() -> Optional[str]:
|
||||
@@ -485,7 +485,11 @@ def test_deployment(
|
||||
colored_print(
|
||||
f"Waiting {retry_delay} seconds before next attempt...", Colors.BLUE
|
||||
)
|
||||
time.sleep(retry_delay)
|
||||
# Show progress during wait
|
||||
for remaining in range(retry_delay, 0, -1):
|
||||
print(f"\r⏳ Retrying in {remaining:2d} seconds...", end="", flush=True)
|
||||
time.sleep(1)
|
||||
print("\r" + " " * 30 + "\r", end="", flush=True) # Clear the line
|
||||
|
||||
colored_print(
|
||||
f"❌ FAILED: {name} deployment verification timed out after {max_retries} attempts",
|
||||
|
||||
Reference in New Issue
Block a user