Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arquillian/appclient wip progress logging changes #1647

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import tck.arquillian.protocol.common.TsTestPropsBuilder;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class AppClientMethodExecutor implements ContainerMethodExecutor {
Expand Down Expand Up @@ -61,33 +62,35 @@ public AppClientMethodExecutor(AppClientCmd appClient, AppClientProtocolConfigur
@Override
public TestResult invoke(TestMethodExecutor testMethodExecutor) {
TestResult result = TestResult.passed();
String appArchiveName = null;
String vehicleArchiveName = null;

// Run the appclient for the test if required
String testMethod = testMethodExecutor.getMethodName();
if (config.isRunClient()) {
log.info("Running appClient for: " + testMethod);
log.fine("Running appClient for: " + testMethod);
try {
Deployment deployment = deploymentInstance.get();
String appArchiveName = appClientArchiveName.get().name();
String vehicleArchiveName = TsTestPropsBuilder.vehicleArchiveName(deployment);
appArchiveName = appClientArchiveName.get().name();
vehicleArchiveName = TsTestPropsBuilder.vehicleArchiveName(deployment);
String[] additionalAgrs = TsTestPropsBuilder.runArgs(config, deployment, testMethodExecutor);
appClient.run(vehicleArchiveName, appArchiveName, additionalAgrs);
} catch (Exception ex) {
result = TestResult.failed(ex);
return result;
}
} else {
log.info("Not running appClient for: " + testMethod);
log.fine("Not running appClient for %s: " + testMethod);
}
String[] lines = appClient.readAll(config.getClientTimeout());

log.info(String.format("AppClient(%s) readAll returned %d lines\n", testMethod, lines.length));
log.fine(String.format("AppClient(%s) readAll returned %d lines\n", testMethod, lines.length));
boolean sawStatus = false;
MainStatus status = MainStatus.NOT_RUN;
String reason = "None";
String description = "None";
for (String line : lines) {
System.out.println(line);
log.finer(line);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part could end up making it look a little odd if it's already a formatted log line. I also feel this should be at level fine not finer.

if (line.contains("STATUS:")) {
sawStatus = true;
description = line;
Expand Down Expand Up @@ -117,6 +120,7 @@ public TestResult invoke(TestMethodExecutor testMethodExecutor) {
break;
}
result.addDescription(description);
log.log(Level.FINE, String.format("[%s] %s : %s", result.getStatus(), description, result));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still feel like it makes sense to make the level configurable. Meaning, use a level based on the status.

}

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,7 @@ optional.tech.packages.to.ignore=jakarta.xml.bind
########################################################################
harness.temp.directory=${ts.home}/tmp
harness.log.port=2000
harness.log.traceflag=true
harness.log.traceflag=false
harness.executeMode=0
harness.socket.retry.count=10
harness.log.delayseconds=1
Expand Down