Skip to content

Commit c29154b

Browse files
committed
Fix sending proper values in dictionary.
Send to pastebin in nightly build machine and not in testing farm Signed-off-by: Petr "Stone" Hracek <[email protected]>
1 parent fa1a583 commit c29154b

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

Diff for: daily_tests/daily_nightly_tests_report.py

+19-13
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,11 @@ def prepare(self) -> bool:
197197
return True
198198

199199
def send_file_to_pastebin(self, log_path, log_name: str):
200-
if not os.path.exists(log_name):
200+
if not os.path.exists(log_path):
201201
return
202202
send_paste_bin = os.getenv("HOME") + "/ci-scripts/send_to_paste_bin.sh"
203203
cmd = f'{send_paste_bin} "{log_path}" "{log_name}"'
204+
print(f"sending logs to pastebin: {cmd}")
204205
try:
205206
run_command(cmd)
206207
except subprocess.CalledProcessError:
@@ -244,14 +245,14 @@ def collect_data(self):
244245
for sclorg in ["S2I", "NOS2I"]:
245246
name = f"{test_case}-{sclorg}"
246247
self.send_file_to_pastebin(
247-
log_path=Path(SCLORG_DIR) / f"{test_case}-{sclorg}" / "log.txt",
248-
log_name=f"{RESULTS_DIR}/{name}.txt",
248+
log_path=Path(SCLORG_DIR) / f"{name}" / "log.txt",
249+
log_name=f"{path_dir}/{name}.log.txt",
249250
)
250251
self.data_dict["tmt"]["logs"].append(
251252
(
252253
name,
253-
Path(SCLORG_DIR) / f"{test_case}-{sclorg}" / "log.txt",
254-
Path(RESULTS_DIR) / f"{name}.txt",
254+
Path(SCLORG_DIR) / f"{name}" / "log.txt",
255+
Path(path_dir) / f"{name}.log.txt",
255256
)
256257
)
257258
failed_tests = True
@@ -267,14 +268,14 @@ def collect_data(self):
267268
for sclorg in ["S2I", "NOS2I"]:
268269
name = f"{test_case}-{sclorg}"
269270
self.send_file_to_pastebin(
270-
log_path=Path(SCLORG_DIR) / f"{test_case}-{sclorg}" / "log.txt",
271-
log_name=f"{RESULTS_DIR}/{name}.txt",
271+
log_path=Path(SCLORG_DIR) / f"{name}" / "log.txt",
272+
log_name=f"{path_dir}/{name}.log.txt",
272273
)
273274
self.data_dict["tmt"]["logs"].append(
274275
(
275276
name,
276-
Path(SCLORG_DIR) / f"{test_case}-{sclorg}" / "log.txt",
277-
Path(RESULTS_DIR) / f"{name}.txt",
277+
Path(SCLORG_DIR) / f"{name}" / "log.txt",
278+
Path(path_dir) / f"{name}.log.txt",
278279
)
279280
)
280281
failed_tests = True
@@ -288,20 +289,22 @@ def collect_data(self):
288289
for sclorg in ["S2I", "NOS2I"]:
289290
name = f"{test_case}-{sclorg}"
290291
self.send_file_to_pastebin(
291-
log_path=Path(SCLORG_DIR) / f"{test_case}-{sclorg}" / "log.txt",
292-
log_name=f"{RESULTS_DIR}/{name}.txt",
292+
log_path=Path(SCLORG_DIR) / f"{name}" / "log.txt",
293+
log_name=f"{path_dir}/{name}.log.txt",
293294
)
294295
self.data_dict["tmt"]["logs"].append(
295296
(
296297
name,
297-
Path(SCLORG_DIR) / f"{test_case}-{sclorg}" / "log.txt",
298-
Path(RESULTS_DIR) / f"{name}.txt",
298+
Path(SCLORG_DIR) / f"{name}" / "log.txt",
299+
Path(path_dir) / f"{name}.log.txt",
299300
)
300301
)
301302
failed_tests = True
302303
continue
303304
results_dir = data_dir / "results"
305+
print("Results dir is for failed_container: ", results_dir)
304306
failed_containers = list(results_dir.rglob("*.log"))
307+
print("Failed containers are: ", failed_containers)
305308
if not failed_containers:
306309
self.data_dict["SUCCESS"].append(test_case)
307310
if self.args.upstream_tests:
@@ -357,6 +360,9 @@ def generate_email_body(self):
357360

358361
def generate_failed_containers(self):
359362
for test_case, plan, msg in self.available_test_case:
363+
print(
364+
f"generate_email_body_for_failed_containers: {test_case}, {plan}, {msg}"
365+
)
360366
if test_case not in self.data_dict:
361367
continue
362368
print(

Diff for: daily_tests/daily_scl_tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function iterate_over_all_containers() {
9696
make "${TESTS}" TARGET="${TARGET}" > "${log_name}" 2>&1
9797
if [[ $? -ne 0 ]]; then
9898
echo "Tests for container $repo has failed."
99-
$PBINCLI send $PBINCLI_OPTS < "${log_name}" > "${RESULT_DIR}/${repo}.txt" 2>&1
99+
cp "${log_name}" "${RESULT_DIR}/"
100100
echo "Show the last 100 lines from file: ${RESULT_DIR}/${repo}.log"
101101
tail -100 "${RESULT_DIR}/${repo}.log"
102102
fi

0 commit comments

Comments
 (0)