From c9fb3aaec3fe7e0c1787e5c95dd0412222dd7bfa Mon Sep 17 00:00:00 2001 From: Saurav Kothari Date: Mon, 24 Apr 2017 16:07:05 +0530 Subject: [PATCH 1/3] BROWSERSTACK_USER and BROWSERSTACK_ACCESSKEY also valid env variables. Add suffix for tracking sessions run via TeamCity --- .../automate/ci/teamcity/BrowserStackLocalAgent.java | 9 ++++++--- .../automate/ci/teamcity/BrowserStackParameters.java | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/browserstack-teamcity-agent/src/main/java/com/browserstack/automate/ci/teamcity/BrowserStackLocalAgent.java b/browserstack-teamcity-agent/src/main/java/com/browserstack/automate/ci/teamcity/BrowserStackLocalAgent.java index a55b996..2c8be5c 100644 --- a/browserstack-teamcity-agent/src/main/java/com/browserstack/automate/ci/teamcity/BrowserStackLocalAgent.java +++ b/browserstack-teamcity-agent/src/main/java/com/browserstack/automate/ci/teamcity/BrowserStackLocalAgent.java @@ -144,9 +144,12 @@ private void exportEnvVars(final BuildRunnerContext runner, final Map Date: Mon, 24 Apr 2017 16:08:08 +0530 Subject: [PATCH 2/3] Minor version bump --- browserstack-teamcity-agent/pom.xml | 2 +- browserstack-teamcity-common/pom.xml | 2 +- browserstack-teamcity-server/pom.xml | 2 +- build/pom.xml | 2 +- pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/browserstack-teamcity-agent/pom.xml b/browserstack-teamcity-agent/pom.xml index 13a0bd2..5a90b99 100644 --- a/browserstack-teamcity-agent/pom.xml +++ b/browserstack-teamcity-agent/pom.xml @@ -5,7 +5,7 @@ browserstack-teamcity com.browserstack - 1.0.1 + 1.0.2 browserstack-teamcity-agent diff --git a/browserstack-teamcity-common/pom.xml b/browserstack-teamcity-common/pom.xml index 8461625..35e5e34 100644 --- a/browserstack-teamcity-common/pom.xml +++ b/browserstack-teamcity-common/pom.xml @@ -5,7 +5,7 @@ browserstack-teamcity com.browserstack - 1.0.1 + 1.0.2 browserstack-teamcity-common jar diff --git a/browserstack-teamcity-server/pom.xml b/browserstack-teamcity-server/pom.xml index 7c06763..c1ffbda 100644 --- a/browserstack-teamcity-server/pom.xml +++ b/browserstack-teamcity-server/pom.xml @@ -4,7 +4,7 @@ browserstack-teamcity com.browserstack - 1.0.1 + 1.0.2 browserstack-teamcity-server jar diff --git a/build/pom.xml b/build/pom.xml index 8b3a189..04d396d 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -5,7 +5,7 @@ browserstack-teamcity com.browserstack - 1.0.1 + 1.0.2 build diff --git a/pom.xml b/pom.xml index 39a5493..5259f13 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.browserstack browserstack-teamcity - 1.0.1 + 1.0.2 pom From aeb92ac0d5e86ab73598e4012d3394b8582ff8cd Mon Sep 17 00:00:00 2001 From: Saurav Kothari Date: Fri, 28 Apr 2017 18:14:30 +0530 Subject: [PATCH 3/3] Check for both variants of username and access key --- .../automate/ci/teamcity/BrowserStackLocalAgent.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/browserstack-teamcity-agent/src/main/java/com/browserstack/automate/ci/teamcity/BrowserStackLocalAgent.java b/browserstack-teamcity-agent/src/main/java/com/browserstack/automate/ci/teamcity/BrowserStackLocalAgent.java index 2c8be5c..1fa225e 100644 --- a/browserstack-teamcity-agent/src/main/java/com/browserstack/automate/ci/teamcity/BrowserStackLocalAgent.java +++ b/browserstack-teamcity-agent/src/main/java/com/browserstack/automate/ci/teamcity/BrowserStackLocalAgent.java @@ -141,9 +141,10 @@ private void loadBuildFeature(final AgentRunningBuild build) { * @param config */ private void exportEnvVars(final BuildRunnerContext runner, final Map config) { - if (!config.containsKey(EnvVars.BROWSERSTACK_USERNAME) || !config.containsKey(EnvVars.BROWSERSTACK_ACCESS_KEY)) { - return; + if(!((config.containsKey(EnvVars.BROWSERSTACK_USERNAME) || config.containsKey(EnvVars.BROWSERSTACK_USER)) && (config.containsKey(EnvVars.BROWSERSTACK_ACCESS_KEY) || config.containsKey(EnvVars.BROWSERSTACK_ACCESSKEY)))) { + return; } + String username = config.get(EnvVars.BROWSERSTACK_USERNAME) == null ? config.get(EnvVars.BROWSERSTACK_USER) : config.get(EnvVars.BROWSERSTACK_USERNAME); String accesskey = config.get(EnvVars.BROWSERSTACK_ACCESS_KEY) == null ? config.get(EnvVars.BROWSERSTACK_ACCESSKEY) : config.get(EnvVars.BROWSERSTACK_ACCESS_KEY); runner.addEnvironmentVariable(EnvVars.BROWSERSTACK_USERNAME, username + "-teamcity");