Skip to content
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
10 changes: 1 addition & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<artifactId>browserstack-integration</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.2-debug-4</version>
<packaging>hpi</packaging>

<name>BrowserStack</name>
Expand Down Expand Up @@ -250,14 +250,6 @@
<version>2.1.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.14.9</version>
</dependency>


<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.browserstack.automate.ci.common.BrowserStackBuildWrapperOperations;
import com.browserstack.automate.ci.common.analytics.Analytics;
import com.browserstack.automate.ci.common.constants.Constants;
import com.browserstack.automate.ci.common.tracking.PluginsTracker;
//import com.browserstack.automate.ci.common.tracking.PluginsTracker;
import com.browserstack.automate.ci.jenkins.local.BrowserStackLocalUtils;
import com.browserstack.automate.ci.jenkins.local.JenkinsBrowserStackLocal;
import com.browserstack.automate.ci.jenkins.local.LocalConfig;
Expand Down Expand Up @@ -77,7 +77,7 @@ private static <T extends BuildWrapper> BuildWrapperItem<T> findItemWithBuildWra
public Environment setUp(final AbstractBuild build, final Launcher launcher,
final BuildListener listener) throws IOException, InterruptedException {
final PrintStream logger = listener.getLogger();
final PluginsTracker tracker = new PluginsTracker();
// final PluginsTracker tracker = new PluginsTracker();

final BrowserStackCredentials credentials =
BrowserStackCredentials.getCredentials(build.getProject(), credentialsId);
Expand All @@ -91,9 +91,9 @@ public Environment setUp(final AbstractBuild build, final Launcher launcher,
if (credentials != null) {
this.username = credentials.getUsername();
this.accesskey = credentials.getDecryptedAccesskey();
tracker.setCredentials(this.username, this.accesskey);
// tracker.setCredentials(this.username, this.accesskey);
} else {
tracker.sendError("No Credentials Available", false, "PluginInitialization");
// tracker.sendError("No Credentials Available", false, "PluginInitialization");
}

AutomateBuildEnvironment buildEnv = new AutomateBuildEnvironment(credentials, launcher, logger);
Expand All @@ -102,15 +102,15 @@ public Environment setUp(final AbstractBuild build, final Launcher launcher,
buildEnv.startBrowserStackLocal(build.getFullDisplayName(), build.getEnvironment(listener));
} catch (Exception e) {
listener.fatalError(e.getMessage());
tracker.sendError(e.getMessage().substring(0, Math.min(100, e.getMessage().length())),
false, "LocalInitialization");
// tracker.sendError(e.getMessage().substring(0, Math.min(100, e.getMessage().length())),
// false, "LocalInitialization");
throw new IOException(e.getCause());
}
}

recordBuildStats();
EnvVars envs = build.getEnvironment(listener);
tracker.pluginInitialized(envs.get(Constants.JENKINS_BUILD_TAG), (this.localConfig != null), false);
// tracker.pluginInitialized(envs.get(Constants.JENKINS_BUILD_TAG), (this.localConfig != null), false);

return buildEnv;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.browserstack.automate.ci.common.clienthandler.ClientHandler;
import com.browserstack.automate.ci.common.constants.Constants;
import com.browserstack.automate.ci.common.enums.ProjectType;
import com.browserstack.automate.ci.common.tracking.PluginsTracker;
//import com.browserstack.automate.ci.common.tracking.PluginsTracker;
import com.browserstack.automate.exception.BuildNotFound;
import com.browserstack.automate.model.Build;
import com.browserstack.automate.model.Session;
Expand Down Expand Up @@ -37,7 +37,7 @@ public class BrowserStackReportForBuild extends AbstractBrowserStackReportForBui
private final ProjectType projectType;
private final transient PrintStream logger;
private final String customProxy;
private final transient PluginsTracker tracker;
// private final transient PluginsTracker tracker;
private final boolean pipelineStatus;
// to make them available in jelly
private final String errorConst = Constants.SessionStatus.ERROR;
Expand All @@ -49,7 +49,7 @@ public BrowserStackReportForBuild(final Run<?, ?> build,
final ProjectType projectType,
final String buildName,
final PrintStream logger,
final PluginsTracker tracker,
// final PluginsTracker tracker,
final boolean pipelineStatus,
final String customProxy) {
super();
Expand All @@ -61,7 +61,7 @@ public BrowserStackReportForBuild(final Run<?, ?> build,
this.projectType = projectType;
this.logger = logger;
this.customProxy = customProxy;
this.tracker = tracker;
// this.tracker = tracker;
this.pipelineStatus = pipelineStatus;
fetchBuildAndSessions();
}
Expand All @@ -70,18 +70,18 @@ private void fetchBuildAndSessions() {
final BrowserStackBuildAction browserStackBuildAction = getBuild().getAction(BrowserStackBuildAction.class);
if (browserStackBuildAction == null) {
logError(logger, "No BrowserStackBuildAction found");
tracker.sendError("BrowserStackBuildAction Not Found", pipelineStatus, "ReportGeneration");
// tracker.sendError("BrowserStackBuildAction Not Found", pipelineStatus, "ReportGeneration");
return;
}

final BrowserStackCredentials credentials = browserStackBuildAction.getBrowserStackCredentials();
if (credentials == null) {
logError(logger, "BrowserStack credentials could not be fetched");
tracker.sendError("No Credentials Available", pipelineStatus, "ReportGeneration");
// tracker.sendError("No Credentials Available", pipelineStatus, "ReportGeneration");
return;
}

tracker.setCredentials(credentials.getUsername(), credentials.getDecryptedAccesskey());
// tracker.setCredentials(credentials.getUsername(), credentials.getDecryptedAccesskey());

BrowserStackClient client =
ClientHandler.getBrowserStackClient(projectType, credentials.getUsername(), credentials.getDecryptedAccesskey(), customProxy, logger);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.browserstack.automate.ci.common.BrowserStackEnvVars;
import com.browserstack.automate.ci.common.constants.Constants;
import com.browserstack.automate.ci.common.enums.ProjectType;
import com.browserstack.automate.ci.common.tracking.PluginsTracker;
//import com.browserstack.automate.ci.common.tracking.PluginsTracker;
import hudson.EnvVars;
import hudson.Extension;
import hudson.FilePath;
Expand Down Expand Up @@ -39,7 +39,7 @@ public BuildStepMonitor getRequiredMonitorService() {
@Override
public void perform(@Nonnull Run<?, ?> build, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener) throws InterruptedException, IOException {
final PrintStream logger = listener.getLogger();
final PluginsTracker tracker = new PluginsTracker();
// final PluginsTracker tracker = new PluginsTracker();
final boolean pipelineStatus = false;

log(logger, "Generating BrowserStack Test Report");
Expand All @@ -54,19 +54,22 @@ public void perform(@Nonnull Run<?, ?> build, @Nonnull FilePath workspace, @Nonn
product = ProjectType.APP_AUTOMATE;
}

tracker.reportGenerationInitialized(browserStackBuildName, product.name(), pipelineStatus);
// tracker.reportGenerationInitialized(browserStackBuildName, product.name(), pipelineStatus);
log(logger, "BrowserStack Project identified as : " + product.name());

// final BrowserStackReportForBuild bstackReportAction =
// new BrowserStackReportForBuild(build, product, browserStackBuildName, logger, tracker, pipelineStatus, null);

final BrowserStackReportForBuild bstackReportAction =
new BrowserStackReportForBuild(build, product, browserStackBuildName, logger, tracker, pipelineStatus, null);
new BrowserStackReportForBuild(build, product, browserStackBuildName, logger, pipelineStatus, null);
final boolean reportResult = bstackReportAction.generateBrowserStackReport();
build.addAction(bstackReportAction);

String reportStatus = reportResult ? Constants.ReportStatus.SUCCESS : Constants.ReportStatus.FAILED;
log(logger, "BrowserStack Report Status: " + reportStatus);

tracker.reportGenerationCompleted(reportStatus, product.name(), pipelineStatus,
browserStackBuildName, bstackReportAction.getBrowserStackBuildID());
// tracker.reportGenerationCompleted(reportStatus, product.name(), pipelineStatus,
// browserStackBuildName, bstackReportAction.getBrowserStackBuildID());
}

@Extension
Expand Down
Loading