Commit e1d4c672 authored by Kammleiter's avatar Kammleiter
Browse files

temp disable shutdown

parent 85876e23
......@@ -27,31 +27,31 @@ public class TaskUpload {
@PostConstruct
public void startTest() {
String env = System.getenv("job_id");
if(env == null || env.equals("")) {
throw new IllegalArgumentException("Environment variable env not set");
}
LOG.info("Running jobId: " + env);
UserResult jUnitResult = null;
try {
jUnitResult = jUnitTestHelper.runUnitTests();
LOG.info("jUnitResult: " + jUnitResult.getCompilationErrors() + jUnitResult.getTestResults());
} catch (IOException | ClassNotFoundException e) {
LOG.error("Error while compiling or testing", e);
}
LOG.info("Posting UserResult to backend at: " + this.backendUrl);
ResponseEntity<Void> response = null;
try {
response = new RestTemplate().postForEntity(this.backendUrl + "?jobID=" + env, jUnitResult, Void.class);
} catch (Exception e) {
LOG.error("Error while Posting to backend: " + e.getMessage());
// System.exit(0);
}
if (response.getStatusCode() != HttpStatus.OK) {
LOG.error("Error while Posting to backend: " + response.toString());
} else {
LOG.info("Successfully tested and sent");
}
// System.exit(0);
// String env = System.getenv("job_id");
// if(env == null || env.equals("")) {
// throw new IllegalArgumentException("Environment variable env not set");
// }
// LOG.info("Running jobId: " + env);
// UserResult jUnitResult = null;
// try {
// jUnitResult = jUnitTestHelper.runUnitTests();
// LOG.info("jUnitResult: " + jUnitResult.getCompilationErrors() + jUnitResult.getTestResults());
// } catch (IOException | ClassNotFoundException e) {
// LOG.error("Error while compiling or testing", e);
// }
// LOG.info("Posting UserResult to backend at: " + this.backendUrl);
// ResponseEntity<Void> response = null;
// try {
// response = new RestTemplate().postForEntity(this.backendUrl + "?jobID=" + env, jUnitResult, Void.class);
// } catch (Exception e) {
// LOG.error("Error while Posting to backend: " + e.getMessage());
//// System.exit(0);
// }
// if (response.getStatusCode() != HttpStatus.OK) {
// LOG.error("Error while Posting to backend: " + response.toString());
// } else {
// LOG.info("Successfully tested and sent");
// }
//// System.exit(0);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment