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

TS-33618 Added debug logging #237

Draft
wants to merge 1 commit into
base: master
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 @@ -4,7 +4,7 @@
import com.teamscale.client.TeamscaleServer;
import com.teamscale.jacoco.agent.testimpact.TestwiseCoverageAgent;
import com.teamscale.jacoco.agent.util.LoggingUtils;
import com.teamscale.report.testwise.model.RevisionInfo;
import com.teamscale.jacoco.agent.options.RevisionInfo;
import org.conqat.lib.commons.string.StringUtils;
import org.slf4j.Logger;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.teamscale.report.testwise.model;
package com.teamscale.jacoco.agent.options;

import java.io.Serializable;

import com.teamscale.client.CommitDescriptor;
import com.teamscale.report.testwise.model.ERevisionType;

/** Revision information necessary for uploading reports to Teamscale. */
public class RevisionInfo implements Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public class CoverageToTeamscaleStrategy extends TestEventHandlerStrategyBase {

private final Logger logger = LoggingUtils.getLogger(this);

private final JsonAdapter<TestwiseCoverageReport> testwiseCoverageReportJsonAdapter = new Moshi.Builder().build()
.adapter(TestwiseCoverageReport.class);
private final JsonAdapter<TestwiseCoverageReport> testwiseCoverageReportJsonAdapter;

/**
* The path to the exec file into which the coverage of the current test run is appended to. Will be null if there
Expand All @@ -51,6 +50,8 @@ public class CoverageToTeamscaleStrategy extends TestEventHandlerStrategyBase {
public CoverageToTeamscaleStrategy(JacocoRuntimeController controller, AgentOptions agentOptions,
JaCoCoTestwiseReportGenerator reportGenerator) {
super(agentOptions, controller);
testwiseCoverageReportJsonAdapter = new Moshi.Builder().build()
.adapter(TestwiseCoverageReport.class);
this.reportGenerator = reportGenerator;

if (!agentOptions.getTeamscaleServerOptions().hasCommitOrRevision()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ public class TestExecutionWriter {

private final Logger logger = LoggingUtils.getLogger(this);

private final JsonAdapter<TestExecution> testExecutionAdapter = new Moshi.Builder().build()
.adapter(TestExecution.class);
private final JsonAdapter<TestExecution> testExecutionAdapter;

private final File testExecutionFile;
private boolean hasWrittenAtLeastOneExecution = false;

public TestExecutionWriter(File testExecutionFile) {
testExecutionAdapter = new Moshi.Builder().build()
.adapter(TestExecution.class);
this.testExecutionFile = testExecutionFile;
logger.debug("Writing test executions to {}", testExecutionFile);
}
Expand Down
4 changes: 4 additions & 0 deletions sample-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jar {
}
}

application {
mainClass = 'Main'
}

dependencies {
// this logback version is the oldest one available that I could get to work and possibly incompatible
// with the one used in the agent. This way, we can test if the shadowing works correctly
Expand Down