From f82a9b33e0e21e6c82c9d3b7ed19d3f61f441d67 Mon Sep 17 00:00:00 2001 From: Mohamed Bilel Besrour Date: Wed, 4 Dec 2024 22:31:09 +0100 Subject: [PATCH] logging --- .../buildagent/service/BuildJobExecutionService.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobExecutionService.java b/src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobExecutionService.java index 91a86ae466d0..a467b71e092e 100644 --- a/src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobExecutionService.java +++ b/src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobExecutionService.java @@ -300,7 +300,7 @@ private BuildResult runScriptAndParseResults(BuildJobQueueItem buildJob, String ZonedDateTime buildCompletedDate = ZonedDateTime.now(); - msg = "~~~~~~~~~~~~~~~~~~~~ Moving test results to specified directory ~~~~~~~~~~~~~~~~~~~~"; + msg = "~~~~~~~~~~~~~~~~~~~~ Moving test results to specified directory for build job " + buildJob.id() + " ~~~~~~~~~~~~~~~~~~~~"; buildLogsMap.appendBuildLogEntry(buildJob.id(), msg); log.debug(msg); @@ -308,7 +308,7 @@ private BuildResult runScriptAndParseResults(BuildJobQueueItem buildJob, String // Get an input stream of the test result files. - msg = "~~~~~~~~~~~~~~~~~~~~ Collecting test results from container ~~~~~~~~~~~~~~~~~~~~"; + msg = "~~~~~~~~~~~~~~~~~~~~ Collecting test results from container " + containerName + " for build job " + buildJob.id() + " ~~~~~~~~~~~~~~~~~~~~"; buildLogsMap.appendBuildLogEntry(buildJob.id(), msg); log.info(msg); @@ -349,6 +349,10 @@ private BuildResult runScriptAndParseResults(BuildJobQueueItem buildJob, String } } + msg = "~~~~~~~~~~~~~~~~~~~~ Parsing test results for build job " + buildJob.id() + " ~~~~~~~~~~~~~~~~~~~~"; + buildLogsMap.appendBuildLogEntry(buildJob.id(), msg); + log.info(msg); + BuildResult buildResult; try { buildResult = parseTestResults(testResultsTarInputStream, buildJob.buildConfig().branch(), assignmentRepoCommitHash, testRepoCommitHash, buildCompletedDate, @@ -362,7 +366,7 @@ private BuildResult runScriptAndParseResults(BuildJobQueueItem buildJob, String } msg = "Building and testing submission for repository " + assignmentRepositoryUri.repositorySlug() + " and commit hash " + assignmentRepoCommitHash + " took " - + TimeLogUtil.formatDurationFrom(timeNanoStart); + + TimeLogUtil.formatDurationFrom(timeNanoStart) + " for build job " + buildJob.id(); buildLogsMap.appendBuildLogEntry(buildJob.id(), msg); log.info(msg);