Skip to content

Commit 8b3d7be

Browse files
committed
changes to try to get tests to run headless remotely
1 parent 03159d8 commit 8b3d7be

File tree

7 files changed

+37
-34
lines changed

7 files changed

+37
-34
lines changed

Dockerfile-tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ COPY build.sbt /app
99

1010
WORKDIR /app
1111

12-
CMD bash test.sh
12+
CMD bash test.sh

automation/docker/run-tests.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ docker-compose -f hub-compose.yml up -d
6060
docker-compose -f hub-compose.yml scale chrome=$NUM_NODES
6161

6262
# render ctmpls
63-
docker run --rm -e VAULT_TOKEN=${VAULT_TOKEN} \
64-
-e ENVIRONMENT=${ENV} -v $(pwd):/working \
65-
broadinstitute/dsde-toolbox:dev consul-template \
66-
-config=/etc/consul-template/config/config.json \
67-
-template=application.conf.ctmpl:application.conf \
68-
-once
63+
#docker run --rm -e VAULT_TOKEN=${VAULT_TOKEN} \
64+
#-e ENVIRONMENT=${ENV} -v $(pwd):/working \
65+
#broadinstitute/dsde-toolbox:dev consul-template \
66+
#-config=/etc/consul-template/config/config.json \
67+
#-template=application.conf.ctmpl:application.conf \
68+
#-once
6969

7070
# run tests
7171
docker run -e DOCKERHOST=$DOCKERHOST \
@@ -75,6 +75,7 @@ docker run -e DOCKERHOST=$DOCKERHOST \
7575
--add-host=firecloud-orchestration-fiab.dsde-${ENV}.broadinstitute.org:${DOCKERHOST} \
7676
-P --rm -t -e CHROME_URL="http://hub:4444/" \
7777
-v $PWD/application.conf:/app/automation/src/test/resources/application.conf \
78+
-v $PWD/firecloud-qa.pem:/app/automation/src/test/resources/firecloud-qa.pem \
7879
-v jar-cache:/root/.ivy -v jar-cache:/root/.ivy2 \
7980
--link docker_hub_1:hub --name ${TEST_CONTAINER} -w /app \
8081
${TEST_CONTAINER}:latest

automation/src/test/resources/application.conf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fireCloud {
2-
baseUrl = "http://local.broadinstitute.org/"
2+
baseUrl = "https://firecloud-fiab.dsde-qa.broadinstitute.org:22443/"
33
apiUrl = "https://firecloud-fiab.dsde-qa.broadinstitute.org:23443/"
44
rawlsApiUrl = "https://firecloud-fiab.dsde-qa.broadinstitute.org:24443/"
55
thurloeApiUrl = "https://firecloud-fiab.dsde-dev.broadinstitute.org:25443/"
@@ -8,12 +8,12 @@ fireCloud {
88
gcs {
99
serviceProject = "broad-dsde-qa"
1010
qaEmail = "[email protected]"
11-
qaPemFile = "/etc/firecloud-qa.pem"
11+
qaPemFile = "/app/automation/src/test/resources/firecloud-qa.pem"
1212
billingAccount = "Broad Institute - 4140002"
1313
}
1414

15-
accounts {
16-
notSoSecretPassword = ""
15+
users {
16+
notSoSecretPassword = "alohomora"
1717
dumbledore = "[email protected]"
1818
voldemort = "[email protected]"
1919
@@ -33,4 +33,6 @@ accounts {
3333

3434
chromeSettings {
3535
chromedriverHost = "http://hub:4444/wd/hub"
36+
chromedriverPath = "usr/local/bin/chromedriver"
3637
}
38+

automation/src/test/scala/org/broadinstitute/dsde/firecloud/Config.scala

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import org.broadinstitute.dsde.firecloud.auth.Credentials
66
object Config {
77
private val config = ConfigFactory.load()
88
private val fireCloud = config.getConfig("fireCloud")
9-
private val accounts = config.getConfig("accounts")
9+
private val users = config.getConfig("users")
1010
private val chromeSettings = config.getConfig("chromeSettings")
1111
private val gcsConfig = config.getConfig("gcs")
1212

@@ -22,29 +22,29 @@ object Config {
2222
}
2323

2424
object Users {
25-
val notSoSecretPassword = accounts.getString("notSoSecretPassword")
25+
val notSoSecretPassword = users.getString("notSoSecretPassword")
2626

27-
val dumbledore = Credentials(accounts.getString("dumbledore"), notSoSecretPassword)
28-
val voldemort = Credentials(accounts.getString("voldemort"), notSoSecretPassword)
27+
val dumbledore = Credentials(users.getString("dumbledore"), notSoSecretPassword)
28+
val voldemort = Credentials(users.getString("voldemort"), notSoSecretPassword)
2929
val admin = dumbledore
3030

31-
val hermione = Credentials(accounts.getString("hermione"), notSoSecretPassword)
31+
val hermione = Credentials(users.getString("hermione"), notSoSecretPassword)
3232
val owner = hermione
3333

34-
val mcgonagall = Credentials(accounts.getString("mcgonagall"), notSoSecretPassword)
35-
val snape = Credentials(accounts.getString("snape"), notSoSecretPassword)
34+
val mcgonagall = Credentials(users.getString("mcgonagall"), notSoSecretPassword)
35+
val snape = Credentials(users.getString("snape"), notSoSecretPassword)
3636
val curator = mcgonagall
3737

38-
val harry = Credentials(accounts.getString("harry"), notSoSecretPassword)
39-
val ron = Credentials(accounts.getString("ron"), notSoSecretPassword)
40-
val draco = Credentials(accounts.getString("draco"), notSoSecretPassword)
38+
val harry = Credentials(users.getString("harry"), notSoSecretPassword)
39+
val ron = Credentials(users.getString("ron"), notSoSecretPassword)
40+
val draco = Credentials(users.getString("draco"), notSoSecretPassword)
4141

42-
val fred = Credentials(accounts.getString("fred"), notSoSecretPassword)
43-
val george = Credentials(accounts.getString("george"), notSoSecretPassword)
44-
val bill = Credentials(accounts.getString("bill"), notSoSecretPassword)
42+
val fred = Credentials(users.getString("fred"), notSoSecretPassword)
43+
val george = Credentials(users.getString("george"), notSoSecretPassword)
44+
val bill = Credentials(users.getString("bill"), notSoSecretPassword)
4545

46-
val lunaTemp = Credentials(accounts.getString("luna"), notSoSecretPassword)
47-
val nevilleTemp = Credentials(accounts.getString("neville"), notSoSecretPassword)
46+
val lunaTemp = Credentials(users.getString("luna"), notSoSecretPassword)
47+
val nevilleTemp = Credentials(users.getString("neville"), notSoSecretPassword)
4848
val testUser = harry
4949
val dominique = harry
5050
val elvin = fred
@@ -60,6 +60,6 @@ object Config {
6060

6161
object ChromeSettings {
6262
val chromedriverHost = chromeSettings.getString("chromedriverHost")
63-
63+
val chromDriverPath = chromeSettings.getString("chromedriverPath")
6464
}
6565
}

automation/src/test/scala/org/broadinstitute/dsde/firecloud/WebBrowserUtil.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import org.scalatest.selenium.WebBrowser
99
* Mix-in utilities for ScalaTest's WebBrowser.
1010
*/
1111
trait WebBrowserUtil extends WebBrowser {
12-
val defaultTimeOutInSeconds: Long = 10
12+
val defaultTimeOutInSeconds: Long = 11
1313

1414
/**
1515
* Override of the base find() method to retry in the case of a

automation/src/test/scala/org/broadinstitute/dsde/firecloud/pages/WebBrowserSpec.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ trait WebBrowserSpec extends WebBrowserUtil {
2929
* @param testCode the test code to run
3030
*/
3131
def withWebDriver(testCode: (WebDriver) => Any): Unit = {
32-
val localBrowser = new SystemProperties().get("local.browser")
33-
localBrowser match {
34-
case Some("true") => runLocalChrome(testCode)
32+
val headless = new SystemProperties().get("headless")
33+
headless match {
34+
case Some("false") => runLocalChrome(testCode)
3535
case _ => runHeadless(testCode)
3636
}
3737
}
3838

3939
private def runLocalChrome(testCode: (WebDriver) => Any) = {
40-
val service = new ChromeDriverService.Builder().usingDriverExecutable(new File(Config.ChromeSettings.localChrome)).usingAnyFreePort().build()
40+
val service = new ChromeDriverService.Builder().usingDriverExecutable(new File(Config.ChromeSettings.chromDriverPath)).usingAnyFreePort().build()
4141
service.start()
4242
val driver = new RemoteWebDriver(service.getUrl, DesiredCapabilities.chrome())
4343
driver.setFileDetector(new LocalFileDetector())

automation/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22

3-
sbt test -Dlocal.browser=true -Djsse.enableSNIExtension=false
4-
sbt clean
3+
sbt test -Djsse.enableSNIExtension=false -Dheadless=true
4+
sbt clean

0 commit comments

Comments
 (0)