Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
registry_username: ${{ secrets.QUAY_IMAGE_SCLORG_BUILDER_USERNAME }}
registry_token: ${{ secrets.QUAY_IMAGE_SCLORG_BUILDER_TOKEN }}
dockerfile: Dockerfile.daily-tests
tag: "0.8.5"
tag: "0.8.6"
image_name: "upstream-daily-tests"
quay_application_token: ${{ secrets.QUAY_IMAGE_SCLORG_UPDATE_DESC }}
2 changes: 1 addition & 1 deletion Dockerfile.daily-tests
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM quay.io/fedora/fedora:42

ENV SHARED_DIR="/var/ci-scripts" \
VERSION="42" \
RELEASE_UPSTREAM="0.8.5" \
RELEASE_UPSTREAM="0.8.6" \
UPSTREAM_TMT_REPO="https://github.com/sclorg/sclorg-testing-farm" \
UPSTREAM_TMT_DIR="sclorg-testing-farm" \
HOME="/home/nightly" \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ shellcheck:
./run-shellcheck.sh `git ls-files *.sh`

build_images:
podman build -t quay.io/sclorg/upstream-daily-tests:0.8.5 -f Dockerfile.daily-tests .
podman build -t quay.io/sclorg/upstream-daily-tests:0.8.6 -f Dockerfile.daily-tests .
31 changes: 16 additions & 15 deletions daily_tests/daily_nightly_tests_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pathlib import Path
from typing import Dict, List

default_mails: List[str] = []
DEFAULT_MAILS: List[str] = []
SCLORG_MAILS = {}
SEND_PASTE_BIN = "/root/ci-scripts/send_to_paste_bin.sh"

Expand Down Expand Up @@ -58,8 +58,6 @@

# The default directory used for nightly build
RESULTS_DIR = Path("/var/ci-scripts/daily_reports_dir")
# The default directory used for running build
SCLORG_DIR = Path("/var/ci-scripts/daily_scl_tests")


def run_command(
Expand Down Expand Up @@ -118,9 +116,8 @@ def __init__(self):
self.mime_msg = MIMEMultipart()
self.body = ""
self.date = date.today().strftime("%Y-%m-%d")
self.nightly_builds_url = ""
self.reports_dir = RESULTS_DIR / self.date
self.sclorg_dir = SCLORG_DIR / self.date
self.add_email = []
self.full_success = False
self.smtp_port = 25
self.smtp_server = "smtp.redhat.com"
Expand Down Expand Up @@ -178,12 +175,14 @@ def load_mails_from_environment(self):
if "SMTP_PORT" in os.environ:
self.smtp_port = int(os.getenv("SMTP_PORT", 25))
if "DEFAULT_MAILS" in os.environ:
default_mails.extend(os.environ["DEFAULT_MAILS"].split(","))
DEFAULT_MAILS = os.environ["DEFAULT_MAILS"].split(",")
if "NIGHTLY_BUILDS_URL" in os.environ:
self.nightly_builds_url = os.environ("NIGHTLY_BUILDS_URL", "")
self.send_email = os.environ.get("SEND_EMAIL", False)
self.send_email = True

print(f"Loaded mails from environment: '{SCLORG_MAILS}'")
print(f"Default mails: '{default_mails}'")
print(f"Default mails: '{DEFAULT_MAILS}'")
print(f"Send email: '{self.send_email}'")

def send_file_to_pastebin(self, log_path, log_name: Path):
Expand Down Expand Up @@ -235,8 +234,8 @@ def store_tmt_logs_to_dict(
else:
dictionary_key = "tmt_failed"
self.data_dict["tmt"][dictionary_key].append(test_case)
log_path = self.sclorg_dir / f"{test_case}" / "log.txt"
log_name = path_dir / f"{test_case}.log.txt"
log_path = self.reports_dir / test_case / "tmt-verbose-log"
log_name = path_dir / "tmt-verbose-log.txt"
self.send_file_to_pastebin(log_path=log_path, log_name=log_name)
if log_name.exists():
with open(log_name) as f:
Expand Down Expand Up @@ -376,7 +375,7 @@ def generate_success_containers(self):

def generate_tmt_logs_containers(self):
for test_case, cont_path, log_name in self.data_dict["tmt"]["logs"]:
print(test_case, cont_path, log_name)
print(f"generate_tmt_logs_containers: {test_case}, {cont_path}, {log_name}")
if os.path.exists(log_name):
self.body += (
f"<b>{test_case}</b> <a href='{self.get_pastebin_url(log_name=log_name)}'>"
Expand All @@ -386,7 +385,7 @@ def generate_tmt_logs_containers(self):
else:
self.body += (
f"<b>{test_case}</b> No logs available. "
f"Check nightly build machine<br>"
f"<a href='{self.nightly_builds_url}'>Check nightly build machine</a><br>"
)
self.body += "<br>"

Expand All @@ -399,9 +398,11 @@ def generate_emails(self):
for cont, mails in SCLORG_MAILS.items():
if str(Path(name).with_suffix("")) != cont:
continue
self.add_email.extend(
[ml for ml in mails if ml not in self.add_email]
)
for ml in mails:
if ml in DEFAULT_MAILS:
continue
DEFAULT_MAILS.append(ml)
print(f"generate_emails: Additional emails: {DEFAULT_MAILS}")

def send_emails(self):
if not self.send_email:
Expand All @@ -422,7 +423,7 @@ def send_emails(self):
if self.args.upstream_tests:
send_to = SCLORG_MAILS.get("upstream-tests", [])
else:
send_to = default_mails + self.add_email
send_to = DEFAULT_MAILS

self.mime_msg["From"] = send_from
self.mime_msg["To"] = ", ".join(send_to)
Expand Down