Skip to content
This repository was archived by the owner on Mar 28, 2025. It is now read-only.
Open
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.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
java-version: '17'
cache: 'gradle'
- name: Production Build
run: ./gradlew clean jar
run: ./gradlew clean test jar
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ public class CLIPlugin extends NotificationPlugin {

public CLIPlugin() {
super(new EnvReader());
Configurator.setRootLevel(Level.ALL);
Configurator.setRootLevel(Level.INFO);
}

public static void main(String[] args) throws IOException {
CLIPlugin plugin = new CLIPlugin();
new CLIPlugin().run(plugin.provideContext());
plugin.run(plugin.provideContext());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import java.util.function.Function;
import java.util.stream.Collectors;

/**
* Parses the custom feedbacks from the results directory.
*/
public class CustomFeedbackParser {

private static final Logger LOGGER = LogManager.getLogger(CustomFeedbackParser.class);
Expand Down Expand Up @@ -51,7 +54,8 @@ public static Optional<Testsuite> extractCustomFeedbacks(Path resultsDir) throws
}
catch (IOException e) {
// TODO: taskListener.error(e.getMessage(), e);
LOGGER.error(e.getMessage(), e);
LOGGER.error("Error extracting custom feedback from file");
LOGGER.debug(e.getMessage(), e);
return Optional.empty();
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import de.tum.cit.ase.artemis_notification_plugin.model.Commit;
import de.tum.cit.ase.artemis_notification_plugin.model.TestResults;
import de.tum.cit.ase.artemis_notification_plugin.model.Testsuite;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
import org.apache.http.client.fluent.Request;
Expand Down Expand Up @@ -65,10 +64,12 @@ public void run(Context context) throws IOException {
results.setLogs(extractLogs(buildLogsFile));

postResult(results, context);
LOGGER.info("Successfully posted test results to server");
}

/**
* Sends the test results to the Artemis server.
*
* @param results the test results to send.
* @param context the context containing the configuration.
*/
Expand All @@ -86,12 +87,13 @@ public void postResult(TestResults results, Context context) {
.returnResponse();

if (response.getStatusLine().getStatusCode() != 200) {
throw new HttpException(String.format("Sending test results failed (%d) with response: %s",
response.getStatusLine().getStatusCode(), IOUtils.toString(response.getEntity().getContent(), Charset.defaultCharset())));
throw new HttpException(String.format("Sending test results failed (%d)",
response.getStatusLine().getStatusCode(), Charset.defaultCharset()));
}
}
catch (HttpException | IOException e) {
LOGGER.error(e.getMessage(), e);
LOGGER.error("Error posting results to server");
LOGGER.debug(e.getMessage(), e);
throw new PostResultException(e);
}
}
Expand Down Expand Up @@ -125,7 +127,8 @@ private Testsuite extractSingleReportFromFile(Path report) {
return testsuite.flatten();
}
catch (JAXBException | IOException e) {
LOGGER.error(e.getMessage(), e);
LOGGER.error("Error extracting test report from file");
LOGGER.debug(e.getMessage(), e);
throw new TestParsingException(e);
}
}
Expand Down